Integrate this SDK with your React Native App ( both iOS and Android ) and start accepting payments from your customers.
- You can refer to the Nimbbl sample app to learn how the SDK has been integrated.
- Nimbbl React Native Sample App
Compatibilities and Dependencies
- React Native version
0.63.0
or higher. - Kindly make sure that the React Native version and Webview versions are compatible.
For eg: React Native is
0.63.0
compatible with Webview10.10.2
.
Install Nimbbl React Native SDK
$ npm install nimbbl_react_native_sdk --save
Import / Add the Checkout library
Import the NimbblReactNative component to your file where checkout will be initiated.
import NimbblReactNative from "nimbbl_react_native_sdk";
Launching the Nimbbl Checkout
Nimbbl React Native Checkout offers a versatile range of props
, allowing you to tailor the checkout experience to your specific needs. By simply configuring the relevant properties in <NimbblReactNative {...props} />
component, you can seamlessly integrate Nimbbl into your platform.
Launching Nimbbl React Native Checkout will require props
to be passed to <NimbblReactNative {...props} />
component.
let props: IProps = {
//add properties here
};
<NimbblReactNative {...props} />;
Understanding Checkout Options
Read more about props
below.
Properties to Identify Yourself
These four properties are always required to launch the checkout
Properties | Type | Mandatory? | Description |
---|---|---|---|
show | boolean | true | This will handle the web view show hide state |
access_key | string | true | Access Key generated from the Nimbbl Dashboard. |
order_id | string | true | Order ID generated via Creating an Order step. |
onClose | function | true | This callback func will return the response that you need to capture and send to your server |
Properties related to Custom Parameters
Furthermore, you can utilize custom
property to store additional information as key-value pairs.
Option Properties | Type | Mandatory? | Description |
---|---|---|---|
custom | object | false | Key-value pair that can be used to store additional information. |
Properties related to Payment Mode
Nimbbl lets you enforce a payment mode on the Checkout. This can be done by passing the payment_mode_code
property.There are other related properties in to each different payment mode, you can read it in the table below. If you don't pass payment_mode_code
the consumer is shown the full Checkout with all available payment modes.
Properties | Type | Mandatory? | Description |
---|---|---|---|
payment_mode_code | string | false | In case of specific payment mode, this property is mandatory. Possible values net_banking , card , upi , wallet . If you don't pass payment_mode_code the consumer is shown the full Checkout with all available payment modes. |
bank_code | string | false | Only to be passed in case of net_banking . Example: hdfc . To get the full list of banks supported for you, please use this API. If it isn't passed, Checkout will open with a page for the user to choose their bank from enabled banks |
wallet_code | string | false | Only to be passed in case of wallet . Example: jio_money . To get the full list of wallets supported for you, please use this API. If it isn't passed, Checkout will open with a page for the user to choose their wallet from enabled wallets |
payment_flow | string | false | Only to be passed in case of upi to determine the flow. Possible values collect , intent . If it isn't passed, Checkout will open with page for the user to enter their UPI ID or pay using a QR or choose a UPI app |
upi_id | string | false | Only to be passed in case of upi and payment_flow is collect . It is the UPI ID of the customer. Example:wonderwoman@ybl . Checkout will open with the transaction initiated for the upi id passed in the upi_id field. If it isn't passed, Checkout will open with page for the user to enter their UPI ID |
upi_app_code | string | false | Only to be passed in case of upi and payment_flow is intent . Possible values phonepe , gpay . Checkout will open with the transaction initiated for the upi app passed in the upi_app_code field. If it isn't passed, Checkout will show a UPI QR or prompt user to choose a UPI app |
Get the UPI Intent list
For fetching the list of Available UPI Intent from the user device, you will have to import a function from nimbbl_react_native_sdk
and use as below to get a JSON object with a list of UPI Intent
- Using `getApps()`
- Response
import { getListOfUpiIntent } from "nimbbl_react_native_sdk";
const getApps = async () => {
const result = await getListOfUpiIntent();
console.log("getApps():", result);
};
getApps();
[
{
logo_url:
"https://s3.ap-south-1.amazonaws.com/nimbbl/upi/phonepeupi_v2.png",
name: "PhonePe",
package_name: "com.phonepe.app",
upi_app_code: "phonepe",
},
{
logo_url: "https://s3.ap-south-1.amazonaws.com/nimbbl/upi/paytmupi_v9.png",
name: "PayTM",
package_name: "net.one97.paytm",
upi_app_code: "paytm",
},
{
logo_url: "https://s3.ap-south-1.amazonaws.com/nimbbl/upi/amzpayupi_v2.png",
name: "Amazon Pay",
package_name: "in.amazon.mShop.android.shopping",
upi_app_code: "amazon_pay",
},
];
Setting the Props and Invoking React Native Checkout
Set all the relevant properties for your use case in the props
as shown below
import { NimbblReactNative } from 'nimbbl_react_native_sdk';
<NimbblReactNative
{
show: boolean;
accessKey: string;
orderId: string;
onClose: (responseObj) => void;
// only if you want to enforce a specific payment method
payment_mode_code: string;
bank_code: string;
wallet_code: string;
payment_flow: string;
upi_id: string;
upi_app_code: string;
}
/>
Capture Transaction Response
The final step in completing the client integration is capturing the response and sending it to your server
After a successful transaction or close event of webview, the close
callback function will return a response from checkout. You need to store these fields in your server.
onClose: (responseObj) => {
// send the response to your server for processing
};
- Share the response parameters received to your server
- This will need to be validated on your server before you decide to provide goods or services
- More details available on processing the response in Completing the Integration :::