---
updatedAt: 2026-02-26T13:11:22.000Z
agentTools:
  projectIndex: https://docs.ksa.ngenius-payments.com/llms.txt
---

# React native SDK

The N-Genius React Native SDK enables seamless in-app payment acceptance for merchants using React Native. It acts as a wrapper around the native Android and iOS SDKs, allowing cross-platform developers to initiate and manage payments securely.

> Before continuing, ensure your backend is set up to authenticate and create orders. Refer to [Creating Orders](https://docs.ksa.ngenius-payments.com/ksa/reference/creating-orders)  .

***

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/b4d5d7f761cf094ff20ef08403bbc0cd32f2042488be47603f6b99ceae1a3f1e-react-native-sdk.png",
        "",
        "A flowchart showing the payment process using the N-Genius React Native SDK: The mobile app collects order details and sends them to the merchant server, which then creates an order via the N-Genius API. The server returns an orderId to the app, which initiates the payment via the SDK. The SDK manages the payment UI and returns the result to the app, which then updates the user and backend accordingly."
      ],
      "align": "center",
      "caption": "React Native SDK Payment Flow"
    }
  ]
}
[/block]

## Installation

You can install the SDK using either **npm** or **yarn**:

```bash
npm i @network-international/react-native-ngenius
```

Or:

```bash
yarn add @network-international/react-native-ngenius
```

For iOS, make sure to run:

```bash
cd ios && pod install
```

> If your project targets iOS 10, you must update your deployment target to 11.0+ in your `Podfile` and `.xcworkspace` project settings.

To download the React Native repository,[ click here](https://github.com/network-international/react-native-ngenius).

***

## Requirements

<br />

| Requirement            | Details                                       |
| :--------------------- | :-------------------------------------------- |
| React Native           | 0.60+                                         |
| iOS Deployment Target  | 12.0+ (Minimum 11.0)                          |
| Android minSDK Version | 19+                                           |
| Backend Server         | Must handle authentication and order creation |

## Usage Example

Here is a basic example of initiating a payment:

```jsx
import { startPayment } from '@network-international/react-native-payment-sdk';

const handlePayment = async () => {
  const response = await startPayment({
    orderId: 'YOUR_ORDER_ID_HERE',
    environment: 'SANDBOX', // or 'PRODUCTION'
  });

  if (response.status === 'SUCCESS') {
    console.log('Payment successful!');
  } else {
    console.warn('Payment failed:', response.errorMessage);
  }
};
```

***

## Supported Payment Methods

### Card Payment

```js
import { initiateCardPayment } from '@network-international/react-native-payment-sdk';

const makeCardPayment = async () => {
  try {
    const resp = await initiateCardPayment(order);
  } catch (err) {
    console.log({ err });
  }
};
```

<br />

### Apple Pay

```js
import { initiateApplePay } from '@network-international/react-native-payment-sdk';

const makeApplePayPayment = async () => {
  try {
    const resp = await initiateApplePay(order, {
      merchantIdentifier: '', // From Apple portal
      countryCode: '',        // e.g. 'SA' for KSA
      merchantName: '',       // Displayed on Apple Pay button
    });
  } catch (err) {
    console.log({ err });
  }
};
```

***

## SDK Configuration

### Set Display Language

```js
import { configureSDK } from '@network-international/react-native-payment-sdk';

configureSDK({
  language: isEnglish ? 'en' : 'ar',
});
```

### Show Order Amount

```js
configureSDK({
  shouldShowOrderAmount: true,
});
```

***

## Checking Payment Support

### Samsung Pay Support

```js
import { isSamsungPaySupported } from '@network-international/react-native-payment-sdk';

const isSamsungPayEnabled = await isSamsungPaySupported();
```

### Apple Pay Support

```js
import { isApplePaySupported } from '@network-international/react-native-payment-sdk';

const isApplePayEnabled = await isApplePaySupported();
```

***

## Features and Platform Support

<br />

| Feature                              | Android | iOS |
| :----------------------------------- | :------ | :-- |
| initiateCardPayment                  | ✅       | ✅   |
| initiateSamsungPay                   | ✅       | 🚫  |
| initiateApplePay                     | 🚫      | ✅   |
| configureSDK - shouldShowOrderAmount | ✅       | 🚫  |
| configureSDK - language              | 🚫      | ✅   |

## Integration Flow

1. The app collects order details.
2. These details are sent to your merchant server.
3. Your server creates an order via the N-Genius API and returns the `orderId`.
4. The React Native app uses this `orderId` to initiate the payment.
5. The SDK handles the payment UI.
6. A success or failure callback is returned to the app.

***

## Handling Results

The SDK returns a structured response after the transaction is completed:

```json
{
  "status": "SUCCESS", // or "FAILURE"
  "transactionId": "123456789",
  "errorMessage": "" // present only if status is FAILURE
}
```

Use this response to update the UI, notify the user, or trigger backend updates.

***

## 3DS2 Support for Saved Cards

To invoke the EMV 3-D Secure workflow (commonly used with saved cards), use the `executeThreeDSTwo` method:

```kotlin
executeThreeDSTwo(paymentResponse)
```

Where `paymentResponse` is the full JSON response returned by N-Genius to your merchant server when using the `savedCard` payment request API.

> 📘 Need help preparing the `paymentResponse` and handling saved card payments? See the details recipe below:

[block:tutorial-tile]
{
  "backgroundColor": "#018FF4",
  "emoji": "🇸🇮",
  "id": "683ebf669b5558001289be69",
  "link": "https://docs.ksa.ngenius-payments.com/v3.1/recipes/emv-3ds2-authentication-with-n-genius-one-stage-payments",
  "slug": "emv-3ds2-authentication-with-n-genius-one-stage-payments",
  "title": "EMV 3DS2 Authentication with N-Genius (one-stage Payments.)"
}
[/block]

***

## Testing

Use your **UAT credentials** and one of the following [test cards](https://docs.ksa.ngenius-payments.com/ksa/reference/sandbox-test-environment#emv-3ds-20-test-cards--web) to simulate payment:

* **Card Number:** 4111 1111 1111 1111
* **Expiry Date:** Any future date
* **CVV:** Any 3-digit number

> Test cards will not result in real charges.

***

## Additional Resources

* [Merchant Server Sample (PHP)](https://github.com/network-international/sample-merchant-server-php)
* [Creating Orders](https://docs.ksa.ngenius-payments.com/ksa/reference/creating-orders)
* [iOS SDK Reference](https://docs.ksa.ngenius-payments.com/ksa/reference/ios-sdk)
* [Android SDK Reference](https://docs.ksa.ngenius-payments.com/ksa/reference/android-sdk)

***

If you encounter issues, contact our [support team](ecom-integration@network.global).