Implementation examples Java Spring
.NET
Node.js
This page explains how to add gift cards to your existing Web Drop-in integration.
Requirements
| Requirement | Description |
|---|---|
| Integration type | Make sure that you have built your Drop-in integration. |
| Setup steps | Before you begin, in your Customer Area add each gift card variant that you want to test. |
Import resources for v6
If you are using Web Drop-in v6, import the resources you need for gift cards:
import { AdyenCheckout, Giftcard} from '@adyen/adyen-web'
API reference
You do not need to send additional fields for gift cards. To see optional fields that you can send for all payment methods, choose the endpoint you integrated:
- /sessions: This is the default with Drop-in v5.0.0 or later.
- /payments: If you implemented an additional use case.
Drop-in configuration
Select which endpoint you are integrating:
(Optional) Customize logos
You can specify a custom logo for a gift card brand when creating a configuration object. This example shows a custom icon for Plastix:
Test and go live
Before making live gift card payments, simulate transactions:
-
Test your integration using our test card numbers depending on your gift card provider. When testing, you use a simulator that tries to behave and respond in the same way as an end-to-end connection.
To simulate a scenario, send one of the following amounts in the test payment request:
Amount (last three digits) resultCoderefusalReason100 Authorised 123 Refused Refused 124 Refused Not enough balance 125 Refused Blocked Card 126 Refused Expired Card 130 Error Acquirer Error 134 Refused Invalid Pin 135 Refused Pin tries exceeded For example, send a payment amount with 100 as the last three digits, such as 1.00 or 11.00. This will result in an Authorised transaction.
-
Check the status of test payments in your test Customer Area > Payments > Payment list.
When you are ready to go live:
- Onboard with a gift card provider and add the gift card variant to your live Customer Area.
-
Contact our Support Team to add the gift card to your live Customer Area.
You can test end-to-end scenarios in your live environment using real gift card details and small amounts.
Partial payments
For the Sessions flow:
When the gift card balance or transaction limit is less than the payment amount, the shopper can pay the rest with another payment method. A partial payment with a gift card works as follows:
- Your server makes a /sessions request with the full amount of the purchase.
- Drop-in sets up the session and shows the payment methods.
-
The shopper enters their gift card details, and Drop-in checks the gift card balance.
If the balance and the transaction limit cover the full amount, Drop-in makes the payment with the gift card, and does not create an order.
- If the balance or the transaction limit is less than the amount, Drop-in creates an order for the full amount. We send you a webhook message with
eventCode: ORDER_OPENED. - Drop-in makes the first partial payment with the gift card. We send you a webhook message with
eventCode: AUTHORISATION. - Drop-in updates the amount to the remaining amount, and shows the payment methods that the shopper can use to pay it.
- The shopper pays the remaining amount with another payment method, for example a card. Additional actions, like 3D Secure authentication or a redirect, work the same way as for any other payment. We send you a webhook message with
eventCode: AUTHORISATION. - When the authorized payments cover the full amount, we send you a webhook message with
eventCode: ORDER_CLOSED andsuccess: true. You can use this to fulfill the order, without waiting for the payments to be captured.
If the shopper does not complete the payment:
- If the shopper cancels the gift card payment in Drop-in, Drop-in cancels the order.
- If the shopper does not pay the remaining amount, the order expires.
In both cases, we cancel or refund the partial payments, and send you a webhook message with eventCode: ORDER_CLOSED and success: false.