Skip to main content
Version: Lastest

How to generate signature

Example of parameters passed to the API

{
"amount": 10000,
"orderId": "5f61cf4f41e2b",
"orderInfo": "test thanh toan",
"bankCode": "VCB",
"paymentMethod": "ATM",
"clientIp": "103.53.171.140",
"extraData": "",
"notifyUrl": "http://yourwebsite.com/ipn",
"redirectUrl": "http://yourwebsite.com/redirect"
}

The order of parameters to create the 'signature' will be sorted alphabetically.
The string generated with the above parameters will be

amount=10000&bankCode=VCB&clientIp=103.53.171.140&extraData=&notifyUrl=http://yourwebsite.com/ipn& orderId=5f61cf4f41e2b&orderInfo=test thanh toan&paymentMethod=ATM&redirectUrl=http://yourwebsite.com/redirect

signature = HMAC_SHA256("amount=10000&bankCode=VCB&clientIp=103.53.171.140& extraData=&notifyUrl=http://yourwebsite.com/ipn& orderId=5f61cf4f41e2b&orderInfo=test thanh toan&paymentMethod=ATM&redirectUrl=http://yourwebsite.com/redirect", YOUR_SECRET_KEY)