Enable HMAC signatures
You can use any 32bit hexadecimal HMAC key you like. If you subscribe to payment notifications you can reuse the same key. For more information, see Signing notifications with HMAC. If you generate a new HMAC key, your previous notifications will still be signed with your previous HMAC key.Subscribe to notifications
Subscribe to notifications with a HMAC Signature Key to receive HMAC signed notifications to the URL you specify in the/createNotificationConfiguration call. We activate the ACCOUNT_HOLDER_VERIFICATION notification and send it to the endpoint on your server (https://www.merchant-domain.com/notification-handler) using the specified connection credentials (testUserName and testPassword).
Create notification configuration
Verify HMAC signature
To verify the signature, retrieve the values of theHmacSignature and Protocol parameters from the HTTP header of the incoming notification. HmacSignature contains the signature itself and Protocol is the protocol used to create the signature (only SHA256 is supported).
To compute the HMAC signature, apply the algorithm/protocol to the whole HTTP body using the key. If the computed HMAC signature is equal to the one in the header, the verification is successful.
Perform this check before deserializing the request. If you perform deserialization before verifying, a valid signature may fail due to a different order of the JSON elements
HMAC signature examples
To calculate the HMAC signature:HmacSignature matches the value you received in the notification, the notification wasn’t modified during transmission.
The following is an example of a header containing an HMAC signature: