Secure Store client browser library
HOW TO USE:
-
Add the javascript file as a script to the HTML page
-
Construct an instance of the class as follows:
const ccStore = new SecShiftSecureStoreCC(API_KEY,API_URL)
-
Use the class to get the type of a credit card:
ccStore.getCardType(CREDIT_CARD_NUMBER)
-
Use the class to validate credit card details:
ccStore.validateCardDetails(CARD_HOLDER_NAME,CREDIT_CARD_NUMBER,CREDIT_CARD_EXPIRY)
NOTE: CREDIT_CARD_EXPIRY format is MM/YY
-
Use the class to store a credit card:
ccStore.store(STORE_AUTH_TOKEN,CARD_HOLDER_NAME,CREDIT_CARD_NUMBER,CREDIT_CARD_EXPIRY,RESPONSE_CALLBACK)
RESPONSE_CALLBACK should take one parameter which is the response object from the storage api, this should be sent back to the server for verification and storage
-
Use the class to retrieve a credit card:
ccStore.retrieve(RETRIEVE_AUTH_TOKEN,RESPONSE_CALLBACK)
RESPONSE_CALLBACK should take one parameter which is the details stored in the storage system