- How it works
- Before you begin
- Step 1: Advanced checkout flow
- Step 2: Mounting Adyen Giving component
- Step 3: Submit donation
- Additional notes
This guide describes how to integrate Adyen Giving with the checkout flow using the extension module and Adyen Web Components.
Integration steps:
- Step 1: Implement the advanced checkout flow as described in the advanced checkout flow guide.
- Step 2: Mount the Adyen Giving Web Component on the Thank You page when
submitAdditionalPaymentDetailsRequestcontains thedonationTokenanddonationCampaigncustom fields. - Step 3: Create and set the
donationRequestcustom field on the commercetools payment to submit additional payment details and finalize the donation.
Make sure the extension module is set up and running. Follow our How to Run Guide before continuing.
Follow the full instructions in the Advanced Checkout Flow Integration Guide.
This step ensures that your base checkout flow with Adyen is working correctly before extending it with the Giving component.
After a shopper successfully completes a payment using an Adyen payment method and an order is created in Commercetools, the shopper is redirected to the Thank You page.
If Adyen Giving is available for that payment method, the Adyen Giving Web Component should be displayed on this page.
Adyen Giving is available if:
- The merchant has set up an Adyen Giving campaign.
- The shopper has selected a payment method that supports Adyen Giving.
- There is an active donation campaign for the shopper’s currency.
When submitting submitAdditionalPaymentDetails, the extension module checks if the donationToken and donationCampaign custom fields are set.
donationToken– required to submit the payment donation using the Donations API.donationCampaign– required for rendering the Adyen Giving Web Component. These fields are retrieved from the donationCampaigns API.
👉 Follow Adyen’s documentation on mounting the Adyen Giving component to add it to your Thank You page.
When the shopper chooses to donate via the Adyen Giving component, you must send a donationRequest to complete the donation.
The component provides the necessary data in state.data. Forward this data to your merchant server and set it as a custom field on the commercetools payment.
{
"version": "PAYMENT_VERSION",
"actions": [
{
"action": "setCustomField",
"name": "donationRequest",
"value": "{\"details\":{\"redirectResult\":\"Ab02b4c0!...\"}}"
}
]
}{
"amount": {
"currency": "EUR",
"value": 1000
},
"reference": "YOUR_DONATION_REFERENCE",
"paymentMethod": {
"type": "scheme"
},
"donationToken": "YOUR_DONATION_TOKEN",
"donationOriginalPspReference": "991559660454807J",
"donationAccount": "NONPROFIT_ACCOUNT",
"returnUrl": "https://your-company.example.com/...",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"shopperInteraction": "ContAuth"
}