react-native-payments-addon-braintree

0.4.0 • Public • Published

react-native-payments-addon-braintree

React Native Payments add-on for processing payments with Braintree.

Installation

First, download the package:

$ yarn add react-native-payments-addon-braintree

Second, install the React Native Payments CLI:

$ yarn add react-native-payments-cli

Lastly, link the native dependencies with the React Native Payments CLI:

$ yarn react-native-payments-cli -- link braintree

NOTE: react-native-payments-cli adds a Build Phase Script to your Xcode project that depends on Carthage.

Usage

In order to receive chargeable Braintree tokens as part of your PaymentResponse, you'll need to add some Braintree specific parameters to your PaymentMethodData.

Here's an example of a Braintree enabled Payment Method Data:

const METHOD_DATA = [{
  supportedMethods: ['apple-pay'],
  data: {
    merchantIdentifier: 'merchant.com.your-app.namespace',
    supportedNetworks: ['visa', 'mastercard', 'amex'],
    countryCode: 'US',
    currencyCode: 'USD',
+   paymentMethodTokenizationParameters: {
+     parameters: {
+       gateway: 'braintree',
+       'braintree:tokenizationKey': 'your_tokenization_key'
+     }
+   }
  }
}];

Resources

/react-native-payments-addon-braintree/

    Package Sidebar

    Install

    npm i react-native-payments-addon-braintree

    Weekly Downloads

    15

    Version

    0.4.0

    License

    MIT

    Last publish

    Collaborators

    • react-native-payments
    • andreyco
    • naoufal