The EBANX Android SDK was created to facilitate the creation of tokens, set the CVV created a token and tokens list already created by the SDK.
Other features need to be made from server to server using its integration key.
- Create Token
- Set CVV
- Get all tokens
- Get token by masked creditcard number
- Delete token
- Delete all tokens
- Android 4.0.3+
Download the latest aar
compile 'com.ebanx:sdk:1.0.0'
<dependency>
<groupId>com.ebanx</groupId>
<artifactId>sdk</artifactId>
<version>1.0.0</version>
<type>pom</type>
</dependency>
Public key and the integration of key are generated at the time of creation of the merchant account.
// Configuration for production environment
EBANX.configure(getApplicationContext(), "your public key");
// Configuration for development environment
EBANX.configure(getApplicationContext(), "your public key", true);
The token operation is used to create a token for a given credit card to be used for recurrent payments.
// 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
}
});
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.
// 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
}
});
// return List<EBANXToken>
List<EBANXToken> tokenList = EBANX.Token.getTokens();
// return EBANXToken
EBANXToken token = EBANX.Token.getToken("4111********1111");
EBANToken currentToken = .......
EBANX.Token.deleteToken(token);
EBANX.Token.deleteAllTokens();
EBANX SDK is owned and maintained by the EBANX
Contact email [email protected]
EBANX SDK is released under the MIT license. See LICENSE for details.