Encryption Library API Secification
@Payon development group
4.1.1 Data
function createSession($termId, $txnId)
Encrypted session creation between client and server
Input Param
1.1 termId: Terminal ID given by PayOn
1.2 txnId: Merchant transaction identification number
function PayOnEncrypt($data)
Data encryption
Input Param
1.1 data: Data to be encrypted
function PayOnDecrypt($data)
Data decryption
Input Param
1.1 data: Data to be decrypted
function PayOnGenerateMAC($data)
Generate MAC value for message verification
Input Param
1.1 data: MAC Data for generation
return: MAC value for message verification.
void createSession(termId, txnId)
Encrypted session creation between client and server
Input Param
1.1 termId: Terminal ID given by PayOn
1.2 txnId: Merchant transaction identification number
String PayOnEncrypt(data, isHexString)
Data encryption
Input Param
1.1 data: Data to be encrypted
1.2 isHexString: False if the data to be encrypted is a general string, true if it is a Hex String.
String PayOnDecrypt(data)
Data decryption
Input Param
1.1 data: Data to be decrypted
String PayOnGenerateMAC(data, isHexString)
Generate MAC value for message verification
Input Param
1.1 data: MAC Data for generation
1.2 isHexString: False if the data to be encrypted is general string, true if it is a Hex String.
return: MAC value for message verification.
4.1.2 Message Encryption Example
$payOnCipher = new PayOnCipher();
$payOnCipher->createSession($termId, $txnId);
$encryptData = $payOnCipher->PayOnEncrypt($data);
PayOnCipher cp = new PayOnCipher();
cp.createSession(termId, txnId);
String encryptData = cp.PayOnEncrypt(data, false);
4.1.3 Message Decryption Example
$payOnCipher = new PayOnCipher();
$payOnCipher->createSession($termId, $txnId);
$decryptData = $payOnCipher->PayOnDecrypt($data);
PayOnCipher cp = new PayOnCipher();
cp.createSession(termId, txnId);
String decryptData = cp.PayOnDecrypt(data);
4.1.3 Message Generate MAC Example
$payOnCipher = new PayOnCipher();
$payOnCipher->createSession($termId, $txnId);
$mac = $payOnCipher->PayOnGenerateMAC($data);
cp = new PayOnCipher();
cp.createSession(termId, txnId);
String mac = cp.PayOnGenerateMAC(data);