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
Name | Type | Description | Child Attributes |
---|---|---|---|
orgGuid | string | Organization's unique identifier. | |
donorInfo | object | Information about the donor. | |
campaignInfo | array of objects | Information about the campaign. | |
reasonInfo | array of objects | Information about the reason. | |
collectorInfo | object | Information about the collector. | |
locationInfo | object | Information about the location. | |
processedDateTime | string | Date and time of the transaction processed through the gateway, in UTC format. | |
deviceDateTime | string | Date and time of the transaction made on the device, in UTC format. | |
amount | string | The amount of the transaction. | |
token | string | Credit card token returned from the gateway. | |
maskedApiKey | string | An identifier used to map to the correct account (e.g., 1234****5678). | |
gatewayName | string | Name of the payment gateway. | |
last4Digits | string | Last four digits of the credit card number. | |
brand | string | Credit card network. | |
paymentNumber | string | Receipt number. | |
gatewayRefNum | string | Reference number from the payment gateway. | |
paymentMethod | string | Method of payment (e.g., credit card, OJC, other charity brands). | |
currency | string | Currency of the transaction. | |
deviceName | string | Terminal where the payment was made. | |
deviceCreatedDate | string | Time of payment on the device. | |
timezone | string | Time zone. |
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"
}