Payment-method icon

Gift card Drop-in integration

Add gift cards to your Drop-in integration

  Postman collection

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:

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:

  1. 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) resultCode refusalReason
    100 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.

  2. Check the status of test payments in your test Customer Area > Payments > Payment list.

When you are ready to go live:

  1. Onboard with a gift card provider and add the gift card variant to your live Customer Area.
  2. 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:

  1. Your server makes a /sessions request with the full amount of the purchase.
  2. Drop-in sets up the session and shows the payment methods.
  3. 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.

  4. 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.
  5. Drop-in makes the first partial payment with the gift card. We send you a webhook message with eventCode: AUTHORISATION.
  6. Drop-in updates the amount to the remaining amount, and shows the payment methods that the shopper can use to pay it.
  7. 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.
  8. When the authorized payments cover the full amount, we send you a webhook message with eventCode: ORDER_CLOSED and success: true. You can use this to fulfill the order, without waiting for the payments to be captured.
CnNlcXVlbmNlRGlhZ3JhbQogICAgcGFydGljaXBhbnQgU2VydmVyIGFzIFlvdXIgc2VydmVyCiAgICBwYXJ0aWNpcGFudCBEcm9wSW4gYXMgRHJvcC1pbgogICAgcGFydGljaXBhbnQgQWR5ZW4KCiAgICBTZXJ2ZXItPj5BZHllbjogUE9TVCAvc2Vzc2lvbnMgd2l0aCB0aGUgZnVsbCBhbW91bnQKICAgIEFkeWVuLS0+PlNlcnZlcjogU2Vzc2lvbiBpZCBhbmQgc2Vzc2lvbkRhdGEKICAgIFNlcnZlci0+PkRyb3BJbjogQ3JlYXRlIERyb3AtaW4gd2l0aCB0aGUgc2Vzc2lvbgogICAgTm90ZSBvdmVyIERyb3BJbixBZHllbjogRHJvcC1pbiBtYWtlcyBhbGwgb2YgdGhlIGZvbGxvd2luZyByZXF1ZXN0cy4gWW91IGRvIG5vdCBtYWtlIHRoZW0uCiAgICBEcm9wSW4tPj5BZHllbjogL3Nlc3Npb25zL3tpZH0vc2V0dXAKICAgIEFkeWVuLS0+PkRyb3BJbjogUGF5bWVudCBtZXRob2RzCiAgICBEcm9wSW4tPj5BZHllbjogL3Nlc3Npb25zL3tpZH0vcGF5bWVudE1ldGhvZEJhbGFuY2UKICAgIEFkeWVuLS0+PkRyb3BJbjogQmFsYW5jZQogICAgRHJvcEluLT4+QWR5ZW46IC9zZXNzaW9ucy97aWR9L29yZGVycwogICAgQWR5ZW4tLT4+RHJvcEluOiBPcmRlcgogICAgQWR5ZW4tKVNlcnZlcjogT1JERVJfT1BFTkVEIHdlYmhvb2sKICAgIERyb3BJbi0+PkFkeWVuOiAvc2Vzc2lvbnMve2lkfS9wYXltZW50cyBmb3IgdGhlIGZpcnN0IHBhcnRpYWwgcGF5bWVudCwgd2l0aCB0aGUgb3JkZXIKICAgIEFkeWVuLS0+PkRyb3BJbjogUmVtYWluaW5nIGFtb3VudCBhbmQgdXBkYXRlZCBvcmRlcgogICAgQWR5ZW4tKVNlcnZlcjogQVVUSE9SSVNBVElPTiB3ZWJob29rCiAgICBEcm9wSW4tPj5BZHllbjogL3Nlc3Npb25zL3tpZH0vc2V0dXAgd2l0aCB0aGUgb3JkZXIKICAgIEFkeWVuLS0+PkRyb3BJbjogUGF5bWVudCBtZXRob2RzIGZvciB0aGUgcmVtYWluaW5nIGFtb3VudAogICAgRHJvcEluLT4+QWR5ZW46IC9zZXNzaW9ucy97aWR9L3BheW1lbnRzIGZvciB0aGUgcmVtYWluaW5nIGFtb3VudCwgd2l0aCB0aGUgb3JkZXIKICAgIG9wdCBUaGUgcGF5bWVudCBuZWVkcyBhbiBhZGRpdGlvbmFsIGFjdGlvbgogICAgICAgIERyb3BJbi0+PkFkeWVuOiAvc2Vzc2lvbnMve2lkfS9wYXltZW50RGV0YWlscwogICAgZW5kCiAgICBBZHllbi0tPj5Ecm9wSW46IFBheW1lbnQgcmVzdWx0CiAgICBBZHllbi0pU2VydmVyOiBBVVRIT1JJU0FUSU9OIHdlYmhvb2sKICAgIEFkeWVuLSlTZXJ2ZXI6IE9SREVSX0NMT1NFRCB3ZWJob29rLCBzdWNjZXNzIHRydWUK

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.

See also