Overview #
HMAC SHA256 hashing ensures data integrity and authenticity between systems.
Prepare Request #
- Order key-value pairs alphabetically.
- Join by
&
, removing the last&
. - Do not include
secureHashValue
in the string. - Convert the resulting string to a byte array.
- Generate a secure random key (at least 64 bits).
- Concatenate the key and the data byte array.
- Generate a SHA256 hash.
- Send the hash with the request as
secureHashValue
.
Example #
{
"merchantId": 22914,
"customerId": "ed520b67-80b2-4e1a-9b86-34208da10e53",
"requestDateTime": "2025-02-16T12:43:51Z",
"secureHashValue": "AFCEA6D0D29909E6ED5900F543739975B17AABA66CF2C89BBCCD9382A0BC6DD7"
}
Best Practices #
- Always use the appropriate environment (SIT/UAT/PROD) for your use case
- Use the correct TransactionType for your payment method
- Implement proper error handling for all possible scenarios
- Store sensitive data securely using Android’s security best practices
- Test thoroughly in the test environment before going to production
- Keep the SDK updated to the latest version
- Follow the security guidelines provided by Amwal Pay
- Check for NFC availability before initiating NFC transactions
- Handle configuration changes and lifecycle events properly