Skip to main content

React Native

shopify

React Native

Cross-platform mobile development

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

📦 Library Installation​

📦

NPM 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​

🔒

Encryption Function

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 Secret
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​

🔓

Decryption Function

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

export const getDecryptedData = value => {
let secret_key = 'XXXXX' // Secret key provided by Hesabe
let iv_key = 'XXXXX' // IV key provided by Hesabe

if(value) {
let secret = secret_key // merchant secret key Secret
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 decrypted = instance.decryptAes(text);
let decrypted_data = JSON.parse(decrypted);

return decrypted_data;
}
};

📥 Example Kit & Support​

📦

Example Kit

Complete React Native integration kit with examples


🔧

Technical Support

For technical integration assistance with React Native