rn-braintree
v0.2.0
Published
React Native interface to Braintree's Android and iOS SDKs
Downloads
5
Maintainers
Readme
React Native Braintree
React Native interface to Braintree's Android and iOS SDKs
Install
npm install --save rn-braintree
react-native link rn-braintree
iOS
Refer to the official Braintree iOS SDK documentation: https://github.com/braintree/braintree_ios#getting-started
Usage
Configure
import Braintree from "rn-braintree";
Braintree.configure("<token>");
Tokenize
import Braintree from "rn-braintree";
// Braintree.configure must have been called previously
Braintree.tokenize({
card: {
number: "4111111111111111",
expirationMonth: "12",
expirationYear: "2020",
cvv: "123",
},
}).then((result) => {
// result.nonce => "..."
// result.type => "visa"
// result.isDefault => true
// result.description => "..."
}).catch((err) => {
// [...]
});