This page's content:

Features

  • Create Token
  • Set CVV
  • Get all tokens
  • Get token by masked creditcard number
  • Delete token
  • Delete all tokens

Requirements

  • Android 4.0.3+

Integration

Download

Download the latest aar

Gradle

Copy
compile 'com.ebanx:sdk:1.0.0'

Maven

<dependency>
    <groupId>com.ebanx</groupId>
    <artifactId>sdk</artifactId>
    <version>1.0.0</version>
    <type>pom</type>
</dependency>

Configuration

How to get a Public Key

The public key and the integration key are generated at the time of the merchant’s account creation.

Click here for more details

Set Public Key

Copy
// Configuration for production environment
EBANX.configure(getApplicationContext(), "your public key");

// Configuration for development environment
EBANX.configure(getApplicationContext(), "your public key", true);

Usage

Create Token

The token operation is used to create a token for a given credit card to be used for recurrent payments.

Copy
// Create a creditcard
EBANXCreditCard card = new EBANXCreditCard("Fulano de tal", "4012888888881881", "12/2016", "321", EBANXCreditCardType.Visa);

EBANX.Token.create(card, EBANXCountry.BR, new EBANXTokenRequestComplete() {
  @Override
  public void Success(EBANXToken token) {
    // Object EBANXToken
  }

  @Override
  public void APIError(EBANXError error) {
    // Object EBANXError
    // possibles type values:
    // PublicKeyNotSet - Public key is not set in EBANX.configure()
    // InvalidPublicKey - Public key invalid (API response)
    // ParseError - Object not found
    // GenericError
  }

@Override
public void NetworkError(Exception e) {
  // Object error from NSURLSession case request fail
}
});

Set CVV

The setCVV operation is used to temporary associate a CVV with an existing token. This CVV will be used by the next request made with the associated token and then discarded.

The setCVV operation is useful for one-click payments, where you already have the customer’s credit card information and cannot send the CVV from your server.

Copy
// Set CVV from credicard token
EBANXToken token = new EBANXToken("123456......123456", "4111********1111");

EBANX.Token.setCVV(token, "123", new EBANXTokenRequestComplete() {
  @Override
  public void Success(EBANXToken token) {
    // Object EBANXToken
}

@Override
public void APIError(EBANXError error) {
  // Object EBANXError
  // possibles type values:
  // PublicKeyNotSet - Public key is not set in EBANX.configure()
  // InvalidPublicKey - Public key invalid (API response)
  // ParseError - Object not found
  // GenericError
}

@Override
public void NetworkError(Exception e) {
  // Object error from NSURLSession case request fail
}
});

Get all tokens

Copy
// return List
List tokenList = EBANX.Token.getTokens();

Get token by masked creditcard number

Copy
// return EBANXToken
EBANXToken token = EBANX.Token.getToken("4111********1111");

Delete token

Copy
EBANToken currentToken = .......

EBANX.Token.deleteToken(token);

Delete all tokens

Copy
EBANX.Token.deleteAllTokens();

Credit

EBANX Android SDK is owned and maintained by EBANX.

If you have any doubts, you can send an email to mobile@ebanx.com.