react-native-webview-braintree
A React Native component for making payments using Braintree that uses no native code, only JavaScript.
Last updated 10 months ago by reggie3 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-native-webview-braintree 
SYNC missed versions from official npm registry.

React Native Webview Braintree

A Braintree payment component with no native code for React Native apps.

npm npm npm npm

Usage

<WebViewBraintree
    clientToken={this.state.clientToken}
    nonceObtainedCallback={this.handlePaymentMethod}
    navigationBackCallback={this.navigationBackCallback}
    paymentAPIResponse={this.state.paymentAPIResponse}
/>	

This component accepts the following props

  • clientToken
  • nonceObtainedCallback
  • navigationBackCallback
  • paymentAPIResponse
Name Required Description
clientToken yes Braintree client token used to create the dropin UI
nonceObtainedCallback yes Function called once a Braintree payment nonce is obtained, the nonce value is passed to ehe function as the only parameter
paymentAPIResponse yes A string indicated the success of the an API to Braintree transaction API. The string should be either "PAYMENT_SUCCESS" "PAYMENT_REJECTED"
navigationBackCallback no Function that can be called in order to initiate navigation. This function will be called when the user clicks on a button labeled "Return to Shop" that appears after a rejected or successful purchase

Example use of the paymentAPIResponse string

brainTreeUtils
    .postPurchase(nonce, this.props.cart.totalPrice, {})
    .then(response => {
        if (response.type === "success") {
            this.setState({ paymentAPIResponse: "PAYMENT_SUCCESS" });
            this.props.dispatch(actions.cartActions.emptyCart());
        } else {
            this.setState({ paymentAPIResponse: "PAYMENT_REJECTED" });
        }
});

Example Application

React Native Webview Braintree test application

TODOs

Integrate Paypal payments

LICENSE

MIT

Current Tags

  • 0.0.5                                ...           latest (10 months ago)

12 Versions

  • 0.0.5                                ...           10 months ago
  • 0.0.34                                ...           2 years ago
  • 0.0.33                                ...           2 years ago
  • 0.0.32                                ...           2 years ago
  • 0.0.31                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.212-alpha                                ...           2 years ago
  • 0.0.211                                ...           2 years ago
  • 0.0.21                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |