conekta-errback
v1.1.0
Published
Wrap Conekta.js async methods to use node-style callbacks
Downloads
10
Maintainers
Readme
conekta-errback
Wrap Conekta.js async methods to use node-style callbacks
Install
$ npm install --save conekta-errback
Usage
var conektaErrback = require('conekta-errback')
var conekta = conektaErrback(window.Conekta)
conekta.token.create(data, function (err, data) {
if (err) { /* console.error(err) */ }
else { /* token = data.id... */ }
})
API
conektaErrback(Conekta)
-> object
Wraps window.Conekta
to call a Node-style callback (function (err, data)
) with results instead of using Conekta's function (response)
functions.
Conekta
Required
Type: object
The Conekta.js browser library (window.Conekta
).
The returned object wraps the following methods in addition to exposing utility methods:
card.createToken
This configuration is exposed as conektaErrback.methods
with {async, sync}
containing arrays of dot property paths.
License
MIT ©