Charge Payment Webhook
After a successful payment on a Donary device, Donary Enterprise will send the data 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. | ||
| 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. For example, 1234****5678. | ||
| gatewayName | string | Name of the payment gateway, for example:
Stripe
Cardknox | ||
| last4Digits | string | Last four digits of the credit card number. | ||
| brand | string | Credit card network, for example:
Visa
Amex | ||
| paymentNumber | string | Receipt number. | ||
| gatewayRefNum | string | Reference number from the payment gateway. | ||
| paymentMethod | string | Method of payment, which will be one of the following:
OJC
Credit_Card
Matbia
Pledger
Donors_Fund
ACH | ||
| currency | string | Currency of the transaction, which will be one of the following:
USD
ILS
EUR
CAD
GBP | ||
| deviceName | string | Terminal where the payment was made. | ||
| deviceCreatedDate | string | Time of payment on the device. | ||
| timezone | string | Time zone, for example:
UTC
EST | ||
| cardHolderName | string | Card holder name. | ||
| isAnonymousDonation | boolean | Indicates if the donation is anonymous. |
Example:
In this example, the client set the payment webhook URL to https://example.yourdomain.com/webhook/charge. A POST request will be sent with the following payload to the client's specified URL.
Payload:
{
"orgGUID": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"donorInfo": {
"donorNumber": "10",
"newDonor": {
"donorID": "10",
"firstName": "Yaakov",
"lastName": "Freedman"
}
},
"campaignInfo": [
{
"campaignNumber": 5,
"campaignName": "Beis Medresh"
}
],
"reasonInfo": [
{
"reasonNumber": 1045,
"reasonName": "Keren Habinyan"
}
],
"collectorInfo": {},
"locationInfo": {},
"processedDateTime": "2024-11-25T21:01:14.44",
"amount": 10,
"maskedAPIKey": "pk_t****I7jx",
"gatewayName": "Stripe",
"brand": "VISA",
"paymentNumber": "1238",
"gatewayRefNum": "ch_3QP9PB2eZvKYlo2C0hHANK5Z",
"paymentMethod": "Credit Card",
"currency": "USD",
"deviceCreatedDate": "2024-11-25T21:01:09.827",
"timezone": "Eastern Standard Time",
"paymentStatus": "Success",
"cardHolderName":"Moshe Hirsh",
"isAnonymousDonation": false
}
cURL:
curl --location --request POST 'https://example.yourdomain.com/webhook/charge' \
--header 'Content-Type: application/json' \
--data-raw '{"orgGUID":"115e9d3d-baf2-4089-b896-9b2621ffcf1b","donorInfo":{"donorNumber":"10","newDonor":{"donorID":"10","firstName":"Yaakov","lastName":"Freedman"}},"campaignInfo":[{"campaignNumber":5,"campaignName":"Beis Medresh"}],"reasonInfo":[{"reasonNumber":1045,"reasonName":"Keren Habinyan"}],"collectorInfo":{},"locationInfo":{},"processedDateTime":"2024-11-25T21:01:14.44","amount":10,"maskedAPIKey":"pk_t****I7jx","gatewayName":"Stripe","brand":"VISA","paymentNumber":"1238","gatewayRefNum":"ch_3QP9PB2eZvKYlo2C0hHANK5Z","paymentMethod":"Credit Card","currency":"USD","deviceCreatedDate":"2024-11-25T21:01:09.827","timezone":"Unknown","paymentStatus":"Success","cardHolderName":"Moshe Hirsh","isAnonymousDonation": false}'