Security
1. How to generate signature for API Create ebill
Example of parameters passed to the API
{
"billCode": "60586f8d6a684",
"billInfo": "Thanh toán hóa đơn",
"serviceCode": "GAME",
"customerName": "NGUYEN VAN A",
"notifyUrl": "https://yourdomain.com/ipn",
"amount": 50000,
"billExpiryTime": 1616818154,
"paymentCondition": "NO",
"bankCode": "WOORIBANK",
"signature": "abc123"
}
The order of parameters to create the signature
will be sorted alphabetically.
The parameters are included into signature: billCode
+ billInfo
+ serviceCode
+ customerName
+ notifyUrl
+ amount
+ billExpiryTime
+ paymentCondition
+ bankCode
The string generated with the above parameters will be:
"amount=50000&bankCode=WOORIBANK&billCode=60586f8d6a684&billExpiryTime=1616818154&billInfo=Thanh toán hóa đơn&customerName=NGUYEN VAN A¬ifyUrl=https://yourdomain.com/ipn&paymentCondition=NO&serviceCode=GAME"
signature = HMAC_SHA256("amount=50000&bankCode=WOORIBANK&billCode=60586f8d6a684&billExpiryTime=1616818154&billInfo=Thanh toán hóa đơn&customerName=NGUYEN VAN A¬ifyUrl=https://yourdomain.com/ipn&paymentCondition=NO&serviceCode=GAME", YOUR_SECRET_KEY)
Example response of the API
{
"errorCode": 0,
"message": "Thành công",
"billCode": "60586f8d6a684",
"payment": {
"bankAccounts": [{
"bankCode": "WOORIBANK",
"bankName": "WOORIBANK",
"bankBranch": "",
"accountNo": "902000225675",
"accountName": "VAP001 PHAM MINH TUAN"
}]
},
"signature": "07a0127c496a24e1a72e5eb123da1e7bc603bbf444babc41fde20 63e5438a89f"
}
The order of parameters to create the signature
will be sorted alphabetically.
The parameters are included into signature: errorCode
+ billCode
+ json_encode(payment)
The string generated with the above parameters will be:
"billCode=60586f8d6a684&errorCode=0&payment={"bankAccounts":[{"bankCode":"WOORIBANK","bankName":"WOORIBANK","bankBranch":"","accountNo":"902000225675","accountName":"VAP001 PHAM MINH TUAN"}]}"
signature = HMAC_SHA256("billCode=60586f8d6a684&errorCode=0&payment={"bankAccounts":[{"bankCode":"WOORIBANK","bankName":"WOORIBANK","bankBranch":"","accountNo":"902000225675","accountName":"VAP001 PHAM MINH TUAN"}]}", YOUR_SECRET_KEY)
2. How to generate signature for API Get detail ebill
Example response of the API
{
"errorCode": 0,
"message": "Thành công",
"billCode":"605823cdc67f4",
"amount":50000,
"paidAmount":0,
"billExpiryTime":1616818154,
"payment": {
"bankAccounts": [{
"bankCode": "WOORIBANK",
"bankName": "WOORIBANK",
"accountNo": "902000225811",
"accountName": "AP NGUYEN VAN A",
"bankBranch": "",
"status": "active"
}]
},
"signature": "73c600b139fcd08eecf811d1c5869504d039f1ed8b320ede614ab0 9469c4a44b"
}
The order of parameters to create the signature
will be sorted alphabetically.
The parameters are included into signature: amount
+ billCode
+ billExpiryTime
+ errorCode
+ paidAmount
+ json_encode(payment)
The string generated with the above parameters will be:
"amount=50000&billCode=605823cdc67f4&billExpiryTime=1616818154&errorCode=0&paidAmount=0&payment={"bankAccounts":[{"bankCode":"WOORIBANK","bankName":"WOORIBANK","bankBranch":"","accountNo":"902000225675","accountName":"VAP001 PHAM MINH TUAN"}]}"
signature = HMAC_SHA256("amount=50000&billCode=605823cdc67f4&billExpiryTime=1616818154&errorCode=0&paidAmount=0&payment={"bankAccounts":[{"bankCode":"WOORIBANK","bankName":"WOORIBANK","bankBranch":"","accountNo":"902000225675","accountName":"VAP001 PHAM MINH TUAN"}]}", YOUR_SECRET_KEY)
3. How to generate signature for API Close virtual account
Example of parameters passed to the API
{
"accountNo": "902000668565",
"billCode": "VA586f8d6a684",
"partnerRefId": "123456",
"signature": "abc123"
}
The order of parameters to create the signature
will be sorted alphabetically.
The parameters are included into signature: accountNo
+ billCode
+ partnerRefId
The string generated with the above parameters will be:
"accountNo=902000668565&billCode=VA586f8d6a684&partnerRefId=123456"
signature = HMAC_SHA256("accountNo=902000668565&billCode=VA586f8d6a684&partnerRefId=123456", YOUR_SECRET_KEY)
4. How to handle signature when receive IPN
Example of parameters
{
"apiKey": "oMhJpkz7K6HDcR6S",
"partnerCode": "TEST",
"billCode": "123456",
"amount": 100000,
"bankAccountNumber": "902098898909",
"bankAccountName": "NGUYEN VAN A",
"bankCode": "WOORIBANK",
"requestTime": 1577811600,
"transactionTime": 1577811600,
"transactionId": "AP1212121212",
"extraData": "test",
"version": "1.0",
"memo": "test chuyen tien",
"signature": "b10294bae53e89919b3efd62a763bf3228e260ef1a329..."
}
The order of parameters to create the signature
will be sorted alphabetically.
The parameters are included into signature: amount
+ apiKey
+ bankAccountName
+ bankAccountNumber
+ bankCode
+ billCode
+ extraData
+ memo
+ partnerCode
+ requestTime
+ transactionId
+ transactionTime
+ version
The string generated with the above parameters will be:
"amount=100000&apiKey=oMhJpkz7K6HDcR6S&bankAccountName=NGUYEN VAN A&bankAccountNumber=902098898909&bankCode=WOORIBANK&billCode=123456&extraData=test&memo=test chuyen tien&partnerCode=TEST&requestTime=1577811600&transactionId=AP1212121212&transactionTime=1577811600&version=1.0"
signature = HMAC_SHA256("amount=100000&apiKey=oMhJpkz7K6HDcR6S&bankAccountName=NGUYEN VAN A&bankAccountNumber=902098898909&bankCode=WOORIBANK&billCode=123456&extraData=test&memo=test chuyen tien&partnerCode=TEST&requestTime=1577811600&transactionId=AP1212121212&transactionTime=1577811600&version=1.0", YOUR_SECRET_KEY)