TypeScript

Integrate Hesabe Payment Gateway into your TypeScript application. Type-safe encryption library with comprehensive AES encryption and decryption capabilities for secure payment processing.

Quick Start

Before you begin, ensure you have the necessary encryption library installed for AES functions:

NPM Installation

You can install the encryption library for TypeScript using npm:

 npm i -S hesabe-crypt-ts

Import HesabeCrypt Class

After installing the library, import the Hesabe Crypt class:

import {`{HesabeCrypt}`} from "hesabe-crypt-ts/lib"

Import AES-JS

import aesjs from "aes-js"

Setup Keys

You need to have a secret and an IV code. Convert your secret and IV to bytes:

const secret = 'XXXXX'        // Secret key provided by Hesabe
const ivCode = 'XXXXX'        // IV key provided by Hesabe

key = aesjs.utils.utf8.toBytes(secret);
iv = aesjs.utils.utf8.toBytes(ivKey);

Initialize Instance

Initialize an instance of the hesabeCrypt class:

let instance = new HesabeCrypt();

Use Encryption/Decryption

Now you can call the methods of hesabeCrypt for encryption and decryption:

let text = 'XXXXX';           // Any data to encrypt
let encrypted = instance.encryptAes(text, key, iv);
let decrypted = instance.decryptAes(encrypted, key, iv);

Download Kit

React Example KitDownload Link
Complete TypeScript integration kit with React examplesClick here