cordova-plugin-conekta
v0.3.0
Published
Cordova plugin that lets you use Conekta's Native SDKs for Android and iOS
Downloads
4
Maintainers
Readme
Cordova Conekta Plugin
A Cordova plugin that lets you use Conekta's Native SDKs for Android and iOS.
Installation
cordova plugin add cordova-plugin-conekta
Usage
First we need to set our public key.
cordova.plugins.conekta.setPublicKey('key_MyPublicKey');
or if using TypeScript
(<any>window)['cordova'].plugins.conekta.setPublicKey('key_MyPublicKey');
Get a token:
let card = {
"number": '4242424242424242',
"name": 'Jorge López',
"exp_year": 2025,
"exp_month": 12,
"cvc": 123,
};
let onSuccess = (tokenId) => {
console.log('Got card token!', tokenId);
};
let onError = (error) => {
console.log('Error getting card token', error.message_to_purchaser);
};
cordova.plugins.conekta.createCardToken(card, onSuccess, onError);