HMAC Signature Verification
This section describes how the hmac signature sent in the callback header can be verified
Obtain the Signing Key
The signing key is an alpha-numeric string generated by our platform during your merchant account creation and it is stored against your account record. This value can be found under you account details in the merchant dashboard. Qwaap uses this value to create the hmac signature and the same will be used when verifying the signature. It is recommended that it is copied and stored safely together with the security keys.
Below is the sample callback data to be used for the demonstration;
COLLECTION
Payout
Next Steps
Obtain the value of the
hmac-signature
header;Form the string payload to be used in signature verification. This is obtained by concatenating values of the callback data in the format; For Collections:
id:invoice_number:payment_status:merchant_reference
and these values are obtained from the callback data. The string payload in this case would therefore be 2061:
QINVNHNU4FMGMHBKA8YQ:
PAID:
1184 For Payouts:id:internal_reference:transaction_status:merchant_reference
and these values are obtained from the callback data. The string payload in this case would therefore be 2839:
QWAAPDQNSRPEJXXUDGVXN:
FAILED:
5547Create the hmac hash of the string payload.
Compare the resulting hash to the value in the hmac-signature header. Equality means the signature is valid.
Last updated