Skip to main content
This page explains how to add cards to your existing Android Drop-in integration. This page is for v5.0.0, released in October 2023. If you are using an earlier version, use the guide for earlier versions instead.

Requirements

Select the server-side flow that your integration uses:

API reference

When you make the /sessions request, cards does not require any additional fields.

Drop-in Configuration

When you configure Drop-in, cards does not require any additional configuration.

Optional configuration

You can include the following functions in the configuration object: For example, to add configuration to set the Postal Code field to be optional for Mastercard and JCB: Configure the Component

Address fields configuration

In the AddressConfiguration object, you can configure the following classes:
  • FullAddress: all of the address fields on the payment form. You can include the following:
  • PostalCode: the Postal Code field on the payment form. You can include the following:
  • Lookup: the address lookup functionality that suggests addresses to the shopper when they enter data into address input fields.
After adding configuration to Drop-in, create the checkout session.

Implement address lookup

Drop-in includes optional callbacks that you can use to suggest addresses to the shopper when they enter data into address input fields. The callbacks work with an external application that you choose to get addresses. There are different ways that external APIs work:
  • One request: one API request is required that returns a list of items with full address details. For example, you can use this with Radar.
  • Two requests: two API requests are required. The first returns a list of items with partial address details. After selecting an item from the list, the second request returns the full details of the selected item. For example, you can use this with Google Places.
To use the address lookup functionality, set AddressConfiguration to Lookup. Choose the implementation you require:
To let your shoppers use the address lookup functionality:
  1. In your DropInService , implement the onAddressLookupQueryChanged(query: String) callback to make an API request to the address lookup API you use with the query parameter.
  2. Map the values you receive in the response to an array of LookupAddress objects that include the following:
  3. Pass the lookup result to Drop-in using the AddressLookupDropInServiceResult class.
    For example:
    Your DropInService

Showing debit and credit cards separately

Drop-in can show separate payment forms for debit cards and credit cards. Here are example use cases for this feature:
  • In Brazil, Mexico, and Finland, many shoppers use combo cards that can make both debit or credit transactions. Separate forms for Debit Card and Credit Card lets the shopper choose the type of transaction.
  • To accept card payments in Sweden, local legislation requires you to show the debit card payment options before the credit card ones.
When you make a /sessions request from your server, include:The following example shows how to do this for a shopper in the Netherlands, making a EUR 47.00 payment./sessions request

Combo cards

For debit transactions, we highly recommend using 3D Secure and automatic capture due to some issuers’ restrictions.

Sweden

To comply with local legislation, set countryCode to SE in your request. Drop-in shows the payment form for Debit Card before the one for Credit Card.

Card brand recognition

When the shopper is entering their card details, Drop-in tries to recognize the card brand. When successful, Drop-in renders the brand icon and the corresponding input field for the card security code (CVC, CVV, or CID).

Co-badged cards

Co-badged cards are rendered by Drop-in according to the co-badged card regulations for the applicable regions. This means that Drop-in renders all supported brands, and allows the cardholder to choose their preferred brand.

Recurring payments

Cards support tokenization for one-click, subscription, and unscheduled card-on-file payments. Refer to Create tokens to integrate with our tokenization feature. We strongly recommend that you ask explicit permission from the shopper if you intend to make future recurring payments. Being transparent about the payment schedule and the charged amount reduces the risk of chargebacks. Choose which server-side flow your integration uses:
Supported from Drop-in v5.0.0 and later.

Store card details

Refer to Create tokens to create a card token. You do not need to include any additional parameters for cards.Create a token for one-click payments
When a token is created, you receive a recurring.token.created webhook.

Checkout API v69 or earlier

When creating a token for cards using Checkout API v69 or earlier:
  • Use the enableStoreDetails configuration to show a checkbox for your shopper to choose to store their card details.

Make a one-click payment

Make a one-click payment using standard tokenization parameters. You do not need to include any additional parameters for cards.Make a one-click payment

Make a one-click payment

Make a one-click payment using standard tokenization parameters. You do not need to include any additional parameters for cards. Make a one-click payment with a card token

Make a subscription payment

Make a subscription payment using standard tokenization parameters. You do not need to include any additional parameters for cards. Make a subscription payment with a card token

Make an unscheduled card-on-file payment

Make an unscheduled card-on-file payment using standard tokenization parameters. You do not need to include any additional parameters for cards. Make an unscheduled card-on-file payment with a card token

Accepting installment payments

If you want to accept credit card installments, include in the /sessions request, include the installmentOptions object which includes the following fields:

Test and go live

If your client-side integration isn’t ready, you can test API requests with encrypted card details by adding a test_ prefix to the test card details. Before making live card payments:
  1. Test your integration using our test card numbers. You can check the status of test payments in your Customer Area > Transactions > Payments.
  2. Add the cards that you want to accept in your live Customer Area.
  3. Before you can start accepting card payments in the live environment, you need to assess your PCI DSS compliance and submit the required Self-Assessment Questionnaire A document.

See also