Accept donations for a nonprofit with the Giving API-only integration that gives you the flexibility to customize the donation flow.
You can build your own donation form to accept donations for a nonprofit and have full control of the style, visual elements, and user interface.
After the shopper submits the payment form and pays for their original transaction, you can show them the option to donate by:
- Showing a donation button on the confirmation page for the shopper's original payment.
- Redirecting the shopper to a page about your donation campaign that includes the donation form.
If the shopper chooses to make a donation, the donation amount is charged to the same payment method they used for the original transaction.
This gives you flexibility to align Giving with your existing checkout process and allows the shopper to contribute to your donation campaign after their transaction.
Before you begin
Adyen Help
Our Giving section answers your questions about donations with Giving.
This page assumes you have already:
Before starting your Giving integration:
- Enable and integrate a supported payment method.
- Enable Giving in your test Customer Area.
- Set up the Adyen Giving merchant webhook in your Customer Area.
How it works
After a shopper completes their payment for the original transaction with a payment method that supports donations:
- From your server, make a
/donationCampaigns
request to get the details of your active donation campaigns. - Show the shopper a donation form.
- From your server, make a /donations request to make a donation.
- Get the outcome from a webhook.
The following diagram shows the Giving Campaign Manager flow after the shopper pays for their original transaction.
Step 1: Get details of your active donation campaigns
Before you get the details of your active donation campaigns, and show the option to donate, the shopper must make a payment with a payment method that supports donations.
If the payment is authorized, and the /payments or /payments/details (for iDeal payments) response includes the donationToken field, make a POST request to /donationCampaigns
to get the details of your active donation campaigns.
In your request, specify:
Field name | Required | Description |
---|---|---|
merchantAccount |
Your merchant account name. | |
currency |
The three-character ISO currency code. |
The response contains the details of your active donation campaign(s). Use the fields from the response to create the donation form that you show to the shopper.
Field name | Description |
---|---|
amounts |
The currency and possible values for the donation. |
id |
The unique campaign ID of the donation campaign. |
campaignName |
The name of the donation campaign. |
causeName |
The cause of the nonprofit. |
logoUrl |
The URL for the logo of the nonprofit. |
bannerUrl |
The URL for the banner of the nonprofit or campaign. |
nonprofitName |
The name of the nonprofit. |
nonprofitDescription |
The description of the nonprofit. |
nonprofitUrl |
The website URL of the nonprofit. |
termsAndConditionsUrl |
The URL of the terms and conditions page of the nonprofit. |
Step 2: Show a donation form
If the shopper's payment is successful, use the values you received in the /donationCampaigns
response to show a donation form.
Show a donation form with one or more buttons for the shopper to select a donation amount. For example, Donate €3, Donate €5, and Donate €10.
The donation form must:
- Show the name and description of the nonprofit.
- Link to the nonprofit's Terms & Conditions.
- Show the campaign banner and logo.
- Have the option for the shopper to decline to donate. For example, a Not now button.
The donation form can optionally include the cause of the nonprofit.
If the shopper paid with iDeal, tell the shopper that the donation transaction will show up in their bank statement a day or more later.
Step 3: Make a donation
After the shopper selects a donation amount from your donation form, make a POST request to /donations, specifying:
Field name | Required | Description |
---|---|---|
amount | The currency and value of the donation. |
|
donationCampaignId |
The unique campaign ID from the /donationCampaigns response id field. |
|
paymentMethod | For cards, type : scheme. For iDeal, type : sepadirectdebit. |
|
donationOriginalPspReference | The PSP reference of the original payment. | |
donationToken | For cards, the donationToken from the /payments response. For iDeal, the donationToken from the /payments/details response. |
|
reference | The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens ("-"). Maximum length: 80 characters. | |
merchantAccount | The merchant account identifier, with which you want to process the transaction. |
Step 4: Get the donation outcome
To get the outcome of each donation asynchronously, enable the Adyen Giving merchant webhook. The webhook includes eventCode
: DONATION.
For a successful donation, the event contains success
: true.
Use the originalReference
to associate the donation to the shopper's original transaction.
Test and go live
Before going live with your integration, use our test cards to test your integration.