1.2.0 • Published 2 years ago
@xendit/xenissuing-web v1.2.0
Xenissuing
This SDK comprises of the following modules :
- XenIssuing: this module handles encryption between XenIssuing and your Web application.
SecureSession
SecureSession is a module to help you set up encryption between XenIssuing and your application.
Requirements
To be able to use Xenissuing, you will need to use a private key provided by Xendit.
It includes several methods:
- getKeywill encrypt a session key randomly generated used for asymmetric encryption with Xenissuing.
- encryptwould be used when setting sensitive data.
- decryptCardDatawould be used whenever receiving sensitive card data from Xenissuing.
Usage
import XenIssuing from "@xendit/xenissuing-web";
const pubkey = "-----BEGIN PUBLIC KEY-----${key}-----END PUBLIC KEY-----`";
const secureSession = XenIssuing.createSecureSession(pubkey); // add sessionKey as parameter to test
const sessionId = secureSession.getKey(); // to be used for API calls(eg. get card pan,cvv,etc)
const { secret, iv } = apiResponse.data;
const decryptedData = secureSession.decryptCardData(iv, secret);