@levistrauss/braintree-react-native
v0.2.14
Published
React native bridge wrapper for Braintree Payments SDK
Downloads
15
Readme
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