Skip to main content

Web Drop-in

Use Drop-in to show the donation form on your website

Intro

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

  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. Drop-in shows the payment form.
  5. The shopper uses submits the payment on your checkout page.
  6. Drop-in handles the payment flow.
  7. If the payment is successful, Drop-in checks if you have an active donation campaign in your Adyen Customer Area.
  8. If you have an active donation campaign, Drop-in shows the donation form.
  9. The shopper chooses to donate or declines.
  10. Drop-in handles the donation flow.
  11. Get the donation result from the donation.onDonationSuccess callback
  12. 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 a donation 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
After a successful payment, if the shopper is eligible to donate, Drop-in shows the donation form. By default, the donation form is mounted in the same container as Drop-in. You do not need to create or configure the Donation component separately. Drop-in handles the full donation flow, including:
  • 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 includes eventCode: DONATION. For a successful donation, the event contains:
  • success: true.
  • originalReference: use this value to associate the donation with the shopper’s original transaction.
Successful donation webhook event

Test and go live

Before going live with your integration, use our test cards to test your integration.

See also

Web Components

Use the Component to show the donation form on your website

Intro

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

  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.

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 a donation 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:
  1. Set donation.autoMount to false.
  2. Create a new Donation Component in the onPaymentCompleted callback, passing the reference to the DOM element that you want to mount the Component into.
Example configuration for showing the donation form in a separate container

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 includes eventCode: DONATION. For a successful donation, the event contains:
  • success: true.
  • originalReference: use this value to associate the donation with the shopper’s original transaction.
Successful donation webhook event

Test and go live

Before going live with your integration, use our test cards to test your integration.

See also