Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Gift cards Android Drop-in integration

Add gift cards to an existing Drop-in integration.

Our Android Drop-in renders gift cards in your payment form, allowing the shopper to pay with their gift card.

Before you begin

This page explains how to add gift cards to your existing Android Drop-in integration. The Android Drop-in integration works the same way for all payment methods. If you haven't done this integration yet, refer to our Drop-in integration guide.

Before starting your gift cards integration:

  1. Make sure you have set up your back end implementation.
  2. Add gift cards in your test Customer Area.

Show gift cards in your payment form

Drop-in uses the countryCode and the amount.currency from your /paymentMethods request to show the available payment methods to your shopper. From your server, make a /paymentMethods request specifying:

  • countryCode: Country where the gift card you are using is supported. For example, NL.
  • amount.currency: Any supported currency. For example, EUR.

Drop-in configuration

Required configuration

You must implement some extra methods in your Drop-in Service class to let the shopper make a partial payment with a gift card and pay the rest with another payment method. Configure drop-in to create an order or cancel an order. After an order is created, make partial payments from your drop-in service.

To configure drop-in to create and cancel orders, implement the following methods in your DropInService:

Event name Description
checkBalance(paymentMethodData: PaymentMethodDetails) Called when the shopper pays with gift card. Make a /paymentMethods/balance request.
createOrder() Called when the gift card balance is less than the transaction amount. Make an /orders request with the amount of the total transaction amount.
cancelOrder(order: OrderRequest, shouldUpdatePaymentMethods: Boolean) Called when the shopper cancels the gift card transaction. Make an orders/cancel request.

The following example shows how to configure Drop-in for gift cards:

Your DropInService
    override fun checkBalance(paymentMethodData: PaymentMethodDetails) {
    // Make a POST /paymentMethods/balance request
            if (isSuccessfulResponse()) {
            val balanceResult = BalanceResult.SERIALIZER.deserialize(jsonResponse)
            val dropInServiceResult = BalanceDropInServiceResult.Balance(balanceResult)
            sendBalanceResult(dropInServiceResult)
        } else {
            val dropInServiceResult = BalanceDropInServiceResult.Error(...)
            sendBalanceResult(dropInServiceResult)
        }
        }

    override fun createOrder() {
        // Make a POST /orders request
        if (isSuccessfulResponse()) {
            val orderResponse = OrderResponse.SERIALIZER.deserialize(jsonResponse)
            val dropInServiceResult = OrderDropInServiceResult.OrderCreated(orderResponse)
            sendOrderResult(dropInServiceResult)
        } else {
            val dropInServiceResult = OrderDropInServiceResult.Error(...)
            sendOrderResult(dropInServiceResult)
        }
    }
        // Create an order for the total transaction amount

    override fun cancelOrder(order: OrderRequest, shouldUpdatePaymentMethods: Boolean) {
        val orderJson = OrderRequest.SERIALIZER.serialize(order)
        // Make a POST /orders/cancel request
        // Call the update function and pass the payment methods response to update the instance of checkout
        if (isSuccessfulResponse()) {

            if (shouldUpdatePaymentMethods) fetchAndUpdatePaymentMethods()
            val dropInServiceResult = DropInServiceResult.Update(paymentMethods, orderOrNull) // Update the payment methods
            sendResult(dropInServiceResult)
            // shouldUpdatePaymentMethods is true when the shopper manually removes their gift cards and cancels the order
            // The total reverts to the original amount and you might need to fetch your payment methods again
            // shouldUpdatePaymentMethods is false when Drop-in is closed while the order is in progress
            // If this happens, cancel the order
            } else {
            val dropInServiceResult = DropInServiceResult.Error(...)
            sendResult(dropInServiceResult)
        }
    }

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 > Transactions > Payments.

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.