Skip to main content

Web Components

Use the Component to show the donation form on your website

Intro

Our Giving Component shows the Giving donation form to the shopper after finishing their original payment. If the shopper chooses to make a donation, the donation transaction uses the same payment method that the shopper used to make the original payment. You can accept donations for fixed amounts, or allow the shopper to round up their transaction amount as a donation.

Requirements

In addition to the general Adyen Giving requirements, take into account the following requirements.

How it works

  1. The shopper goes to the checkout page.
  2. Your server creates a payment session.
  3. When you create a global configuration object for AdyenCheckout, optionally add a configuration object for donations.
  4. The Component shows the payment form.
  5. The shopper submits the payment on your checkout page.
  6. The Component handles the payment flow.
  7. If the payment is successful, the Component checks if you have an active donation campaign in your Adyen Customer Area.
  8. If you have an active donation campaign, the Component shows the donation form.
  9. The shopper chooses to donate or declines.
  10. The Component handles the donation flow.
  11. Get the donation result from the donation.onDonationSuccess callback
  12. Adyen sends a webhook message with the donation outcome.

Get Campaigns

Get details of your active donation campaigns

If the shopper’s payment is authorized, and the /payments or /payments/details (for iDEAL payments) response includes the donationToken field, get the details of your active donation campaigns. From your server, make a POST /donationCampaigns request, specifying: Example POST /donationCampaigns request
The response contains the details of your active donation campaigns. If there is at least one campaign in the response, show Giving in your payment form. When you make a request to get your active donation campaigns, the response you receive depends on your donation type:
Example POST /donationCampaigns response for a fixed amount donation