Skip to main content

About the React Native SDK

Integrate Atoa into your React Native app in minutes using our dedicated SDK. Easily add seamless Pay by Bank payments to new or existing React Native apps. The SDK is available on npm, where developers are welcome to contribute and provide feedback. Atoa SDK Flow

Prerequisites

Before you start, ensure the following setup is complete:
  • Create an Atoa account: Sign up using our Business App or Web Dashboard.
  • Generate API keys: Go to API Access inside the Atoa Business App and generate keys for Sandbox (testing) and Production (live).
  • Backend readiness: You must be able to create a Payment Request on your backend server using Atoa APIs before calling the React Native SDK.
See the Getting Started guide for more information.

1: Install the SDK

Run the following to add the Atoa SDK to your React Native project
or

2. Install required dependencies

The SDK uses a few community libraries for its payment sheet UI. Most React Native projects already have some of these — only add the ones you’re missing. Install all at once (skip any you already have):
Using Expo? Use npx expo install instead to ensure compatible versions:
Note: react-native-reanimated requires a Babel plugin. If you haven’t already, add 'react-native-reanimated/plugin' to your babel.config.js. See the Reanimated installation guide for details.
For usage, sample code to integrate can be found in Example app.

3. Wrap Your App with AtoaProvider

Wrap your app root with <AtoaProvider> to enable the Atoa payment modal. This is required for AtoaSdk.pay() to work.
Alternatively, if you already use react-native-root-siblings in your project, you can wrap with <RootSiblingParent> directly:

4: Generate a Payment Request (Backend)

You can generate a payment using the payment-process API, which must be called from your server while creating an order. Refer to the getting started guide to know more
Note: redirectUrl can be used to redirect the user back to your app after the payment is completed. Follow the information given in the handle redirection steps below

5. Launch the Payment Dialog

Do not display the payment widget before your backend has successfully created a valid paymentRequestId.
After obtaining a valid paymentRequestId, you can now invoke the React Native SDK’s Pay method to show the checkout experience:
Pass customerDetails if available. It pre-selects the user’s previous bank for faster checkout.

SDK Parameters

Below are the payload structures you can expect inside each callback:

onError

Triggered when an error occurs during the payment process

onPaymentStatusChange

Triggered when the payment status updates. Handle COMPLETED, PENDING and FAILED statuses.

onUserClose

Triggered when the user closes the payment verification sheet

6. Handle Payment Response

You can handle the payment success, failure, pending and other statuses based on payment response
Sample response can be seen here. While calling payment-process API to generate a payment, you can specify a redirectUrl in your request body. The redirectUrl, which should be passed as body parameters, redirects to your website and then opens your app via deep linking. This enables users to open your application after payment. Following the completion of the payment by the customer’s bank app, they will be redirected back to their browser. Atoa will transmit the idempotency id, amount and redirect URL with status as query parameters appended to your specified Redirected URL, forming a URL structure like:
Resources For Implementing deep-linking for your app Atoa uses webhooks to notify your application whenever an event happens in your account. Webhooks are particularly useful for events such as changes in payment status, such as completion, failure, or pending. To get started, you must Register your webhook endpoint so Atoa knows where to deliver events. After registration, your endpoint will start receiving detailed webhook payloads. These will inform you of payment status updates, such as COMPLETED, PENDING, or FAILED.

Store Fields in Server

Store the following in your backend once the transaction is complete.

8. Check Bank App Installation (Android/iOS Requirements)

Our mobile SDK checks if the bank(using for making payments) app is installed or not. For that, you need to add ‘queries’ tag for android and ‘LSApplicationQueriesSchemes’ key for iOS
In Android, you need to add ‘queries’ tag in AndroidManifest.xml
In iOS, you need to add ‘LSApplicationQueriesSchemes’ key in Info.plist

9. Verify Payment Signature

This is a mandatory step to confirm the authenticity of the details returned to the Checkout form for successful payments. You can verify the signature by doing this.

10: Test in Sandbox

Use the sandbox for testing different flows
Refer to the Sandbox Guide to simulate different outcomes.

11: Brand & Customize (Optional)

Theme Color: Choose your brand’s hex color in the dashboard. The widget will automatically reflect your theme color. Update your theme color here Design Guidelines: Refer to our official branding guide to correctly showcase “Pay by Bank” in your checkout. View Figma file Note: You do not need to pass the theme color in the SDK. Simply configure these once from your Dashboard or Atoa Business App