Web Drop-in
Use Drop-in to show the donation form on your websiteIntro
With the Sessions flow, Drop-in handles the donation flow automatically. After a successful payment, if the shopper is eligible to donate, Drop-in shows the donation form to the shopper. If the shopper chooses to donate, the donation transaction uses the same payment method that the shopper used for the original payment. You can accept donations for fixed amounts, or allow the shopper to round up their transaction amount as a donation. You do not need to pass any donation-specific parameters in your/sessions request. Drop-in manages the full donation flow, including presenting the campaign and processing the donation.
Requirements
In addition to the general Adyen Giving requirements, take into account the following requirements.How it works
- The shopper goes to the checkout page.
- Your server creates a payment session.
- When you create a global configuration object for
AdyenCheckout, optionally add a configuration object for donations. - Drop-in shows the payment form.
- The shopper uses submits the payment on your checkout page.
- Drop-in handles the payment flow.
- If the payment is successful, Drop-in checks if you have an active donation campaign in your Adyen Customer Area.
- If you have an active donation campaign, Drop-in shows the donation form.
- The shopper chooses to donate or declines.
- Drop-in handles the donation flow.
- Get the donation result from the
donation.onDonationSuccesscallback - Adyen sends a webhook message with the donation outcome.
Show Giving
Add Giving configuration
When you create a global configuration object for Drop-in, you can optionally add configuration for donations. To receive donation results and customize behavior, add adonation object to your checkout configuration. The donation configuration is optional, but if you include it, you must include the event handlers to get donation outcomes on your client website.
Event handlers:
Configuration parameters:
Example Drop-in configuration with donation callbacks
- Showing the donation campaign details (nonprofit name, description, logo, banner).
- Presenting the donation amounts or round-up option, depending on the donation type.
- Processing the donation.
Get Donation Outcome
Get the donation outcome
You can get the outcome of each donation in a webhook message. This enables you to inform shoppers by email or mobile messaging about their donation, provided you have the shopper’s contact details. To receive these webhook messages, enable the Adyen Giving merchant webhook, which includeseventCode: DONATION.
For a successful donation, the event contains:
success: true.originalReference: use this value to associate the donation with the shopper’s original transaction.
Test and go live
Before going live with your integration, use our test cards to test your integration.See also
- Sessions flow integration guide
- Donations with Advanced flow
- Webhooks
- Giving on adyen.com
- Monitor donations
Web Components
Use the Component to show the donation form on your websiteIntro
With the Sessions flow, the Component handles the donation flow automatically. After a successful payment, if the shopper is eligible to donate, the Component shows the donation form to the shopper. If the shopper chooses to donate, the donation transaction uses the same payment method that the shopper used for the original payment. You can accept donations for fixed amounts, or allow the shopper to round up their transaction amount as a donation. You do not need to pass any donation-specific parameters in your/sessions request. the Component manages the full donation flow, including presenting the campaign and processing the donation.
Requirements
In addition to the general Adyen Giving requirements, take into account the following requirements.How it works
- The shopper goes to the checkout page.
- Your server creates a payment session.
- When you create a global configuration object for
AdyenCheckout, optionally add a configuration object for donations. - The Component shows the payment form.
- The shopper submits the payment on your checkout page.
- The Component handles the payment flow.
- If the payment is successful, the Component checks if you have an active donation campaign in your Adyen Customer Area.
- If you have an active donation campaign, the Component shows the donation form.
- The shopper chooses to donate or declines.
- The Component handles the donation flow.
- Get the donation result from the
donation.onDonationSuccesscallback - Adyen sends a webhook message with the donation outcome.
Show Giving
Add Giving configuration
When you create a global configuration object for the Component, you can optionally add configuration for donations. To receive donation results and customize behavior, add adonation object to your checkout configuration. The donation configuration is optional, but if you include it, you must include the event handlers to get donation outcomes on your client website.
Event handlers:
Configuration parameters:
Example Component configuration with donation callbacks
Show the donation form in a separate container
By default, the Component mounts the donation form in the same container as the original Component. To mount it in a different container:- Set
donation.autoMountto false. - Create a new Donation Component in the
onPaymentCompletedcallback, passing the reference to the DOM element that you want to mount the Component into.
Get Donation Outcome
Get the donation outcome
You can get the outcome of each donation in a webhook message. This enables you to inform shoppers by email or mobile messaging about their donation, provided you have the shopper’s contact details. To receive these webhook messages, enable the Adyen Giving merchant webhook, which includeseventCode: DONATION.
For a successful donation, the event contains:
success: true.originalReference: use this value to associate the donation with the shopper’s original transaction.