0.2.14 • Published 3 years ago

@levistrauss/braintree-react-native v0.2.14

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

braintree-react-native

React native bridge wrapper for Braintree Payments SDK

Installation

npm install @levistrauss/braintree-react-native

or

yarn add @levistrauss/braintree-react-native

Manual iOS Installation Steps

  • Add Application query scheme in Info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>com.venmo.touch.v2</string>
</array>
  • Create Url scheme under Xcode > Targets > Info > Url Types

  • Add Url scheme ceated above for Venmo app result in Info.plist

<key>VenmoResultUrlScheme</key>
<string>venmo.example.payment</string>

Usage

import { Venmo } from "@levistrauss/braintree-react-native";

// Initializing Venmo
Venmo.init("<client token or tokenized key>");

// Listening to Venmo events
const subscription = Venmo.addVenmoListener((event) => {
      switch (event.type) {
        case VenmoEventType.VENMO_READY:
          break;
        case VenmoEventType.VENMO_APP_NOT_INSTALLED:
          break;
        case VenmoEventType.VENMO_MERCHANT_DISABLED:
          break;
        case VenmoEventType.PAYMENT_NONCE_CREATED:
          break;
        case VenmoEventType.PAYMENT_ERROR:
          break;
        case VenmoEventType.PAYMENT_CANCELLED:
          break;
      }
    });

// Launching Venmo App for payment
Venmo.launch();

// Collecting device data
Venmo.getDeviceData().then((deviceData) => {
    console.log(deviceData);
});
  
// Clean up
Venmo.removeVenmoListener(subscription);
Venmo.dispose();

Contributings

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago