API Documentation
NeoX documents
NeoX documents
  • Introduction
  • NeoX App
    • E-Wallet
    • eKYC
    • Functionality
  • Payment Gateway
    • Payment Methods
    • Integrations
      • Hosted Checkout
        • Plugin/Extenstion
        • iOS SDK
        • Android SDK
        • React Native SDK
        • Web SDK
        • APIs
      • Direct API
        • Tokenization
      • Refund
        • APIs
        • IPN
    • Transaction Management
      • Query DR
      • Cancel
      • IPN
      • Error Codes
      • Refund on portal
    • Reconciliation
    • Settlement
  • Disbursement
    • Integration
      • Introduction
      • How To Register
      • Security Method
      • Generate token API
      • Get merchant profile API
      • Request disbursement API
      • Get disbursement transaction API
      • Get exchange rate API
      • Inquiry bank account API
      • Currency conversion API
      • Event Notification
      • Response Data Structure
      • Error codes
    • Disbursement Account
    • Disbursement request
    • Transaction Management
      • Query Request/Transaction
      • Webhook
      • Error Codes
    • Reconciliation
  • Collections
    • Integration
      • Introduction
      • How To Register
      • Security Method
      • API authenPlatform
      • API upload file
      • APIs for virtual accounts management
        • API create list of virtual accounts
        • API update KYC virtual account information
        • API update Virtual Account transaction data from merchant
        • API set active/inactive Virtual Account
        • API get list virtual accounts
        • API get detail virtual account
      • APIs for transactions management
        • API update transaction documents
        • API get list transactions
        • API get detail transaction
      • APIs for refund requests management
        • API create refund request
        • API get list refund requests
        • API get detail refund request
      • APIs for withdraw requests management
        • API get list withdraw banks
        • API create withdraw request
        • API get list withdraw requests
        • API get detail withdraw request
      • Event Notification
      • SFTP upload document file of collection transaction
      • Error Codes
    • Virtual Account Management
      • Virtual Account
      • Virtual Account Status
      • Webhook
    • Transaction Management
      • Webhook
    • Transaction Status Management
      • Webhook
    • Refund Request Management
      • Webhook
    • Withdraw Request Management
      • Webhook
    • Reconciliation
    • Settlement
  • Merchant Portal
    • Onboarding
    • Payment Gateway
      • Reconciliation
      • Withdraw
    • Disbursement
      • Reports
    • Collections
      • Reports
      • Withdraw
Powered by GitBook
On this page
  • React Native SDK for NeoX Payment Gateway
  • Methods
  • Example
  • Params in initialize function

Was this helpful?

  1. Payment Gateway
  2. Integrations
  3. Hosted Checkout

React Native SDK

React Native SDK for NeoX Payment Gateway

Use

import { NeoXProvider } from '@neox/react-native-sdk'
const App = () => {
  return (
    <NeoXProvider
      options={{
        header: {
          // containerStyle: {
          //   backgroundColor: 'blue',
          // },
          // titleStyle: {
          //   fontSize: 25,
          //   color: 'red',
          //   fontFamily: 'Montserrat-BoldItalic',
          // },
          // screenTitles: {
          //   paymentGatewayTitle: 'Cổng thanh toán NeoX',
          //   cardPaymentTitle: 'Thanh toán thẻ',
          //   transferPaymentTitle: 'Chuyển khoản ngân hàng',
          //   resultTitle: 'Ví NeoX',
          // },
        },
        button: {
          style: {
            backgroundColor: 'blue',
            color: 'white',
            borderRadius: 0,
            // fontSize: 22,
          },
          paymentLabel: 'Thanh toán ngay',
        },
      }}
    >
      <NavigationContainer>
        <RootStack.Navigator
          initialRouteName='ProductScreen'
          screenOptions={{
            animation:
              Platform.OS === 'android' ? 'fade_from_bottom' : 'default',
          }}
        >
          <RootStack.Screen
            component={Products}
            name='ProductScreen'
            options={{ headerShown: false }}
          />
          <RootStack.Screen
            component={ProductDetails}
            name='ProductDetailsScreen'
            options={{ headerTitle: 'Chi tiết sản phẩm' }}
          />
        </RootStack.Navigator>
      </NavigationContainer>
    </NeoXProvider>
  )
}
export default App

Methods

Method
Description

initialize

Initialize the necessary configurations for the SDK and UI

Example

import { initialize, dismiss } from '@neox/react-native-sdk'
 initialize(
        {
          neo_PaymentBaseUrl: 'https://uat-api.neopay.vn/',
          neo_MerchantCode: 'HUYEN1',
          neo_Amount: product.price * count,
          neo_OrderInfo: 'Thanh toan don hang',
          neo_ReturnURL: '',
          neo_MerchantTxnID: 'T' + Math.floor(Math.random() * 100000),
          neo_SecureHash: '123456',
          neo_OrderID: 'DH' + Math.floor(Math.random() * 200000),
          neo_PaymentMethod: paymentMethod || [],
          neo_Currency: 'VND',
          neo_Version: '',
          neo_Command: '',
        },
        {
          onSuccess: (res) => {
            console.log('res=>Success', res)
            // dismiss()
          },
          onFailure: (res) => {
            console.log('res=>Failure', res)
            // dismiss()
          },
          onClose: () => {
          },
        }
      )

Params in initialize function

Parammetter
Data Type
Default Value
Description

neo_MerchantCode

String

Merchant code is provided by NeoX

neo_Currency

String

VND

Transaction currency, VND as default

neo_Locale

String

vi

Language will display on the checkout page. Support: “vi”, “en”.

neo_Version

string

1

Payment gateway version, “1” as default

neo_PaymentMethod

String

["WALLET", "ATM", "CC", "QR"]

Allows to choose to display direct or list payment channels. If this field is not transmitted, all channels will be displayed.

neo_Amount

number

Payment amount

neo_MerchantTxnID

String

Unique - Transaction ID is provided by merchant

neo_OrderID

String

Order ID

neo_PaymentBaseUrl

String

Environment

Callback

Event
Description

onSuccess

The event occurs when payment is successful.

onFailure

The event occurs when payment fails.

Callback data from onSuccess and onFailure

Parameter
Data Type
Description

neo_MerchantCode

string

Merchant code is provided by NeoX

neo_Currency

string

Transaction currency, VND as default

neo_Locale

string

Language will display on the checkout page. Support: “vi”, “en”.

neo_Version

string

Payment gateway version, “1” as default

neo_Command

string

“PAY” as default

neo_Amount

string

Payment amount

neo_MerchantTxnID

string

Unique - Transaction ID is provided by merchant

neo_OrderID

string

Oder ID

neo_OrderInfo

string

Oder Information

neo_TransactionID

string

Unique - Transaction ID is generated by the NeoX system, for reconciling.

neo_ResponseCode

string

The error code is returned by NeoX, indicates the transaction result.

neo_ResponseMsg

string

Error description.

neo_CustomerID

string

The customer ID on the merchant system.

neo_ResponseData

string

The data response of customer's payment.

neo_SecureHash

string

Use SHA256 to hash the above parameters (sort the key by Alphabet order) + Secret Key (will be provided by NeoX after actual integration)

PreviousAndroid SDKNextWeb SDK

Last updated 1 year ago

Was this helpful?