0.2.0 • Published 7 years ago

rn-braintree v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

React Native Braintree

React Native interface to Braintree's Android and iOS SDKs

Install

  1. npm install --save rn-braintree

  2. 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) => {
  // [...]
});