The header containing the notification signature has the following format:
X-axepta-Signature: merchantid=[...];serviceid=[...];signature=[...];alg=[...]
To authenticate the source and verify the integrity of the notification message, perform the following steps:
- From the headers of the incoming package delivered to the notification URL, read the
X-Axepta-Signaturevalue, - Then extract the values of
signatureandalg, Depending on the hash algorithm specified in
alg, calculate the appropriate hash:string incoming_signature = x_axepta_signature[signature] string body = notification_body string own_signature = hash(body + private_key, alg)Compare the calculated
own_signaturevalue withincoming_signatureread from the header,If
own_signatureandincoming_signatureare identical, the notification message is correct and comes from a trusted source.
Transaction status changes should be applied only if signature verification succeeds.