braintree-as-promised
Add native promises to braintree gateway
Getting Started
Install the module with: npm install braintree-as-promised
var braintree = ;var promised = ;var gateway = ; gatewayclientToken ; gatewaytransaction ;
Documentation
calling promised(gateway)
will return a new gateway object with all the methods converted to promise-based ones, using native promises. You can continue to use your gateway object normal, as it does not change anything on the original object.
Additionally it handles the "result.success" parameter, so that if success === false, the promise is rejected with the returned error message.
License
Copyright (c) 2016 Enhancv Licensed under the MIT license.