Skip to content
logo
  • Products
    • Amwal Checkout
    • Merchant App
    • Merchant Control Panel
  • Pricing
  • Developers
  • About us
  • Contact Us
Sign In
BA Booking

BA Booking

2
  • BA Booking overview
  • BA Booking Installation
amwalpay woocommerce

Woocommerce

2
  • Overview
  • Woocommerce Installation
CS-Cart

CS Cart

2
  • CS-Cart Overview
  • CS CART Installation
Shopify

Shopify

2
  • Shopify Overview
  • Shopify Installation
odoo

Odoo

2
  • Odoo Overview
  • Odoo Installation
whmcs

WHMCS

2
  • WHMCS Overview
  • WHMCS Installation
Magento

Magento

2
  • Magento 2 Overview
  • Magento Installation
Opencart

Opencart

2
  • OpenCart Overview
  • Opencart Installtion
ZenCart

ZenCart

2
  • ZenCart Overview
  • Zencart Installation
Drupal

Drupal

2
  • Drupal Overview
  • Drupal Installation
PrestaShop

PrestaShop

2
  • PrestaShop Overview
  • PrestaShop Installation
Contact Form 7

Contact Form 7

2
  • Contact Form 7 Overview
  • Contact Form 7 Installation
Joomla

Joomla

2
  • Joomla Overview
  • Joomla Installation
AMWAL INTEGRATED PAYMENT LINK

Amwal Integrated Payment Link

3
  • Introduction
  • Example Code
  • Response and Hash Generation
Android SDk

Native Android SDK

3
  • Pre Requisites
  • Implementation
  • SecureHash Calculation
ios SDk

Native iOS SDK

3
  • Pre Requisites
  • Implementation
  • SecureHash Calculation
React SDk

React Native SDK

2
  • Installation
  • Configuration

AmwalPay Laravel Package

2
  • Installation
  • Configuration

SMARTBOX

3
  • Pre Requisites
  • Implementation
  • SecureHash Calculation
View Categories
  • Home
  • Developer | Amwalpay
  • AmwalPay Mobile SDKs
  • React Native SDK
  • Installation

Installation

A React Native library for integrating Amwal Pay payment gateway into your React Native applications.

npm install react-amwal-pay

iOS Installation Note #

After pod installation, you need to set “Build Libraries for Distribution” to NO in Xcode:

  1. Open your iOS project in Xcode
  2. Go to Pods project
  3. Select amwalsdk target
  4. In Build Settings, search for “Build Libraries for Distribution”
  5. Set it to NO

Configuring amwalsdk Subspec #

The library uses amwalsdk as a dependency and supports both Release and Debug subspecs. By default, it uses the Debug subspec. To change this, you can set the AMWAL_SUBSPEC environment variable in your Podfile:

# In your Podfile
ENV['AMWAL_SUBSPEC'] = 'Release' # or 'Debug'

Or you can set it when running pod install:

AMWAL_SUBSPEC=Release pod install

Usage #

import {
  AmwalPaySDK,
  Environment,
  Currency,
  TransactionType,
  type AmwalPayConfig,
  type AmwalPayResponse
} from 'react-amwal-pay';

// Configure Amwal Pay
const config: AmwalPayConfig = {
  environment: Environment.SIT, // or Environment.PRODUCTION
  currency: Currency.OMR, // or other supported currencies
  transactionType: TransactionType.CARD_WALLET,
  locale: 'en', // or 'ar'
  merchantId: '84131',
  terminalId: '811018',
  amount: '1',
  secureHash: '8570CEED656C8818E4A7CE04F22206358F272DAD5F0227D322B654675ABF8F83',
  customerId: 'customer-id', // optional
  sessionToken: 'your-session-token', // optional
  onCustomerId(customerId) {
    console.log('Customer ID:', customerId);
  },
  onResponse(response) {
    console.log('Payment Response:', response);
  }
};

// Initialize and start payment
const handlePayment = async () => {
  try {
    // Validate required fields
    if (!isConfigValid(config)) {
      console.error('Please fill in all required fields');
      return;
    }

    const amwalPay = AmwalPaySDK.getInstance();
    await amwalPay.startPayment(config);
  } catch (error) {
    console.error('Error starting payment:', error);
  }
};

// Helper function to validate config
const isConfigValid = (config: Partial<AmwalPayConfig>): boolean => {
  return Boolean(
    config.environment &&
    config.secureHash &&
    config.currency &&
    config.amount &&
    config.merchantId &&
    config.terminalId &&
    config.locale &&
    config.transactionType
  );
};

UUID Generation #

If you need to generate a custom transaction ID, you can use the built-in UUID utility:

import { UuidUtil } from 'react-amwal-pay';

// Generate a UUID for transaction ID
const transactionId = UuidUtil.generateTransactionId();

// Or use the lower-level generator
const uuid = UuidUtil.generateV4();

The UUID utility generates lowercase UUIDs in v4 format, ensuring compatibility with the payment system.

Addition Values Configuration #

The SDK supports additionValues parameter for passing custom key-value pairs that can be used for various SDK functionalities.

Default Addition Values #

The SDK automatically provides default values:

  • merchantIdentifier: “merchant.applepay.amwalpay” (used for Apple Pay configuration)

Usage #

// Using default additionValues (automatically applied)
const config = {
  // ... other configuration
  // additionValues will automatically include merchantIdentifier
};

// Using custom additionValues
const customConfig = {
  // ... other configuration
  additionValues: {
    merchantIdentifier: 'merchant.custom.identifier',
    customKey: 'customValue'
  }
};

Custom additionValues will be merged with defaults, with custom values taking precedence.

Updated on August 26, 2025

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Configuration
Table of Contents
  • iOS Installation Note
    • Configuring amwalsdk Subspec
  • Usage
  • UUID Generation
    • Addition Values Configuration
    • Default Addition Values
    • Usage

Secure. Seamless – Powering Payments for Every Business.

Sign Up
Support

4th Floor, Majan Tower Building
North Al Ghubrah, P.O. Box 233, P.C 118
Muscat, Sultanate of Oman

: support@amwal-pay.com

📞 : +96824121845

Resources
  • Developers
  • Careers
Company
  • About us
  • Contact Us
  • Contact Sales
  • Partners

2025 © AmwalPay. All Rights Reserved.

  • Terms & Conditions
  • Privacy Policy