The Webhook functionality allows you to receive a
POST from DNA Payments with the details for that transaction enclosed as JSON content. The HTTPS URL you provide in the Start Transaction request must conform to the following criteria:
|Url||HTTPS address as supplied in the Webhook URL|
|Supported Media Types|
|Request Type||Transaction Information|
With the following Request Header Information:
All messages are sent as UTF 8 encoded JSON messages and will not contain any field that is ‘null’.
All header fields conform to the RFC 8941 Structured Values for HTTP standard. Whilst the standard supports various header fields, the key ones that are of interest for the webhook handling are:
|Field||Header Name||RFC 8941 Data Type||Description|
|Content Digest||Content-Digest||Dictionary||This contains a single entry that represents the hash of the message. The key of the field identifies the hash algorithm, and the value is the hash of the message. DNA Payments will support returning the hash as a SHA-256 hash using PKCS#1 padding.|
|Content Length||Content-Length||Long||This is the length of the message content.|
|Content Type||Content-Type||List||This is the content type and any associated parameters.|
|Signature Input||Signature-Input||Dictionary||This provides the details of what fields make up a given signature. The key indicates the signature identifier. The value contains the list of fields and any associated parameters. The signature identifier that is to be processed will be identified as ‘sig1’.|
|Signature||Signature||Dictionary||This provides the signature details. The key indicates the signature identifier. The value contains the signature. The signature identifier that is to be processed will be identified as ‘sig1’.|
Details of how to validate the signature we supply can be found in the Signature Verification section.
Webhook Response Payload
The Webhook Response is a JSON payload, in the same format as a
GET /transaction Response. Please refer to the table in the API Messages > GET transaction section for more information.
Webhook Payload Example
Webhook payloads are only sent when the
transactionStatus field is
Complete. Below are three example payloads, showing a successful, cancelled and declined payment attempt.