React Native

Integrate Hesabe Payment Gateway into your React Native application. Cross-platform mobile development framework with JavaScript and native performance for seamless payment processing.

React Native Integration Steps

You will find the following files in the comprehensive iOS Swift Kit:

Library Installation

You can install the encryption library for React Native using npm:

 npm install --save hesabe-crypt

You can also download the library files directly and use the encrypt and decrypt methods.

Encryption Implementation

Use this function to encrypt payment data before sending to Hesabe API:

export const getEncryptedData = value => {

  let secret_key = 'XXXXX'; // Secret key provided by Hesabe
  let iv_key = 'XXXXX';     // IV provided key by Hesabe
  
  if(value) {
    let secret = secret_key;  // merchant secret key
    let ivCode = iv_key;      // merchant iv code
    
    let key = aesjs.utils.utf8.toBytes(secret);
    let iv = aesjs.utils.utf8.toBytes(ivCode);
    
    let instance = new hesabeCrypt(key, iv);
    
    let text = value;
    let encrypted = instance.encryptAes(JSON.stringify(text));
    let encrypted_data = encrypted;
    
    return encrypted_data;
  }
};

Decryption Implementation

Use this function to decrypt response data received from Hesabe API:

     export const getEncryptedData = value => {

       let secret_key = 'XXXXX'; // Secret key provided by Hesabe
       let iv_key = 'XXXXX';     // IV provided key by Hesabe
       
       if(value) {
         let secret = secret_key;  // merchant secret key
         let ivCode = iv_key;      // merchant iv code
         
         let key = aesjs.utils.utf8.toBytes(secret);
         let iv = aesjs.utils.utf8.toBytes(ivCode);
         
         let instance = new hesabeCrypt(key, iv);
         
         let text = value;
         let encrypted = instance.encryptAes(JSON.stringify(text));
         let encrypted_data = encrypted;
         
         return encrypted_data;
       }
     };

Download Kit

Complete React Native integration kit with examples

Example KitDownload Link
Download React Native KitClick here