Skip to content
This repository has been archived by the owner on Feb 13, 2021. It is now read-only.

Latest commit

 

History

History
46 lines (28 loc) · 1.46 KB

File metadata and controls

46 lines (28 loc) · 1.46 KB

ARCHIVED

HOW TO USE

  1. Add compile 'com.aol.obi:android-tokenization-stech-lib-lib:1.0'

under dependencies of app level build.gradle file

  1. Sync project

  2. Add permission request for ACCESS_FINE_LOCATION for Android API >= 23

  3. Use the following code

a) to validate, encrypt and tokenize a credit card number and cvv using library:

 Tokenize tokenize = new Tokenize(context);
 String encryptedCreditCard = tokenize.creditCard(cardNumber, cardCvv, domain, merchantId);

b) to encrypt and tokenize a bank account number using Kount:

 Tokenize tokenize = new Tokenize(context);
 String encryptedBankAccount = tokenize.bankAccount(accountNumber, domain, merchantId);

c) to only encrypt a credit card number:

 String encryptedCard = Encrypt.encrypt(cardNumber, cardCvv, domain);

d) to only encrypt a bank account number:

 String encryptedBankAccount = Encrypt.encrypt(accountNumber, "", domain);

e) to validate a credit card

 boolean isValid = Validator.validate(cardNumber);

f) Exceptions:

 OBIValidationException -> Throws this exception when invalid card passed. User need to correct the input
 OBISystemException -> Throws this exception incase of unknown system errors, user can retry.

Notes: All parameters are Strings except merchantId, which is int. Parameter domain shows the environment of the library usage and can be "DEV" or "PROD" or "QA". Any other value of domain will be considered as "QA".