Skip to main content

Charge Payment Webhook


After a successful payment on a Donary device, Donary Enterprise will send the following payload to the URL endpoint configured in the PaymentWebhookEndpoint setting.

Payload

NameTypeDescriptionChild Attributes
orgGuid stringOrganization's unique identifier.Placeholder
processedDateTime stringDate and time of the transaction processed through the gateway, in UTC format.Placeholder
deviceDateTime stringDate and time of the transaction made on the device, in UTC format.Placeholder
amount stringThe amount of the transaction.Placeholder
token stringCredit card token returned from the gateway.Placeholder
maskedApiKey stringAn identifier used to map to the correct account (e.g., 1234****5678).Placeholder
gatewayName stringName of the payment gateway.Placeholder
last4Digits stringLast four digits of the credit card number.Placeholder
brand stringCredit card network.Placeholder
paymentNumber stringReceipt number.Placeholder
gatewayRefNum stringReference number from the payment gateway.Placeholder
paymentMethod stringMethod of payment (e.g., credit card, OJC, other charity brands).Placeholder
currency stringCurrency of the transaction.Placeholder
deviceName stringTerminal where the payment was made.Placeholder
deviceCreatedDate stringTime of payment on the device.Placeholder
timezone stringTime zone.Placeholder

Example:

In the following example, the client set the payment webhook URL to https://example.yourdomain.com/webhook/charge. This POST request will send the data to that specified URL.

cURL:

curl --location --request POST 'https://example.yourdomain.com/webhook/charge' \
--header 'Content-Type: application/json' \
--data '{"orgGuid":"F9878BB3-4BDF-479F-8FCF-B075680A658A","donorInfo":{"donorNumber":"1234567","newDonor":"It will have value if new donor is created in payment request"},"campaignInfo":{"campaignNumber":1007,"campaignName":"Gold Page"},"reasonInfo":{"reasonNumber":1001,"reasonName":"Gold Reason"},"collectorInfo":{"collectorNumber":1234568,"collectorName":"Test Collector"},"locationInfo":{"locationName":"Test Group","longitude":"-73.933259000","latitude":"40.690329000"},"processedDateTime":"2024-06-25 00:00:00","deviceDateTime":"2024-05-25 00:00:00","amount":100,"token":"5346q0666h6674p15g0mqq2n17gq3414","maskedApiKey":"dona****3ae3","gatewayName":"Matbia", "last4Digits":"8042", "brand":"Matbia","paymentNumber":"112233","gatewayRefNum":"ch_3ND1vS2eZvKYlo2C1iteYyGO","paymentMethod":"Matbia","currency":"USD","deviceName":"Testing", "deviceCreatedDate": "2024-08-06 08:00:33.127", "timezone": "Dateline Standard Time"}'

Payload:

{
"orgGuid": "F9878BB3-4BDF-479F-8FCF-B075680A658A",
"donorInfo": {
"donorNumber": "1234567",
"newDonor": {
"DonorID": "0000000",
"FirstName": "Test",
"LastName": "Charity"
}
},
"campaignInfo": {
"campaignNumber": 1007,
"campaignName": "Gold Page"
},
"reasonInfo": {
"reasonNumber": 1001,
"reasonName": "Gold Reason"
},
"collectorInfo": {
"collectorNumber": 1234568,
"collectorName": "Test Collector"
},
"locationInfo": {
"locationName": "Test Group",
"longitude": "-73.933259000",
"latitude": "40.690329000"
},
"processedDateTime": "2024-06-25 00:00:00",
"deviceDateTime": "2024-05-25 00:00:00",
"amount": 100,
"token": "5346q0666h6674p15g0mqq2n17gq3414",
"maskedApiKey": "dona****3ae3",
"gatewayName": "Stripe",
"last4Digits": "8042",
"brand": "Stripe",
"paymentNumber": "112233",
"gatewayRefNum": "ch_3ND1vS2eZvKYlo2C1iteYyGO",
"paymentMethod": "Stipe",
"currency": "USD",
"deviceName": "Testing",
"deviceCreatedDate": "2024-08-06 08:00:33.127",
"timezone": "Dateline Standard Time"
}