0.0.6 • Published 6 years ago
capacitor-braintree v0.0.6
capacitor-braintree
A Capacitor plugin for the Braintree mobile payment processing SDK
Installation
$ npm i capacitor-braintree
iOS configuration
Add the following in the ios/App/App/info.plist
file:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>capacitor-braintree</string>
<key>CFBundleURLSchemes</key>
<array>
<string>{Bundle Identifier}.payments</string>
</array>
</dict>
</array>
More information can be found here: https://developers.braintreepayments.com/guides/paypal/client-side/ios/v4
Android configuration
(Under development)
Usage
import {Braintree, DropInResult} from 'capacitor-braintree';
...
const braintree = new Braintree();
braintree.setToken({
token: token
}).then(
() => {
braintree.showDropIn({
amount: '10.0',
disabled: ['venmo'] // (optional) 'paypal', 'card', 'venmo', 'applePay'
}).then(
(payment: DropInResult) => {
console.log(payment);
}).catch((error) => {
console.log(error);
});
}).catch((error) => {
console.log(error);
});