Skip to content
React Native plugin for using Payabbhi native SDKs (Android & iOS)
Java JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android
.gitignore
.npmignore
CHANGELOG.md
LICENSE
README.md
index.android.js
package.json

README.md

react-native-payabbhi

React Native plugin for using Payabbhi native SDKs (Android & iOS)

Installation

$ npm i react-native-payabbhi --save
$ react-native link react-native-payabbhi

Usage

  1. Import PayabbhiCheckout module to your component:

    import PayabbhiCheckout from 'react-native-payabbhi';
  2. Call PayabbhiCheckout.open method with the argument options. This method will return a JS Promise where then part corresponds to a successful payment and the catch part corresponds to payment failure.

    <TouchableHighlight onPress={() => {
      var options = {
        access_id: "<access_id>",
        order_id: "<order_id>",
        amount: <amount>,
        description: "<description>",
        prefill: {
          name: "<name>",
          email: "<email>",
          contact: "<contact>"
        },
        notes: {
          merchant_order_id: "<merchant_order_id>"
        }
      };
      PayabbhiCheckout.open(options).then((data) => {
        alert(`Success: ${data.order_id} | ${data.payment_id}`);
      }).catch((error) => {
        alert(`Error: ${error.code} | ${error.message}`);
      });
    }}>
    <Text style = {styles.text}>PAY</Text>
    </TouchableHighlight>
You can’t perform that action at this time.