Skip to main content
This page explains how to add cards to your existing Android Drop-in integration. Our Android Drop-in renders the available cards in your payment form, and securely collects sensitive card information, so it doesn’t touch your server.

Requirements

Show the available cards in your payment form

For information about the supported locations and currencies for each card, refer to Payment methods. To show cards in your payment form, specify in your /paymentMethods request a combination of countryCode and amount.currency. Drop-in uses this information to show the available payment methods to your shopper.

Optional configuration

When creating an instance of Drop-in, you can optionally include a CardConfiguration object to add configuration parameters for cards in your payment form. The following example shows how to configure Drop-in to make the cardholder name required:

Address fields configuration

Configure the postal code field in AddressConfiguration.PostalCode. Include the following parameter: Address field settings

Make a payment

When the shopper proceeds to pay, Drop-in returns the paymentComponentData.paymentMethod.
  1. Pass the paymentComponentData to your server.
  2. From your server, make a /payments request, specifying:
    • paymentMethod: The paymentComponentData.paymentMethod from your client app.
The /payments response contains:
  • pspReference: Our unique identifier for the transaction.
  • resultCode: Use this to present the payment result to your shopper.
  • merchantReference: The reference from the /payments request.
  • additionalData: Additional information about the transaction.
    To specify the fields that you want to receive in additionalData, log in to your Customer Area, and go to Developers > Additional data.
/payments response

Present the payment result

Use the  resultCode from the /payments response to present the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a webhook. For card payments, you can receive the following resultCode values: Additional resultCode values are possible in case of the 3D Secure authentication flow. For more information, refer to Result codes.

Recurring payments

Adyen’s tokenization service allows you to securely store shopper’s card details for recurring payments. To make recurring payments, you first need to create a shopper token, and then use the token to make future payments for the shopper.

Create a token

When a shopper chooses to pay with card, Drop-in renders a switch for saving the card details for future payments. If the shopper selects this option, the actionComponentData from Drop-in will include a paymentComponentData.storePaymentMethod. Pass this to your server. To create a token, include in your /payments request:
  • storePaymentMethod: The paymentComponentData.storePaymentMethod from your client app.
  • shopperReference: Your unique identifier for the shopper.
If you do not want to show the switch for saving card details, set showStoredPaymentMethods to false when creating an instance of Drop-in.

Show a stored card in your payment form

To show a stored card in your payment form, additionally pass in your /paymentMethods request:
  • shopperReference: The unique shopper identifier that you specified when creating the token.

Make a payment with a token

When the shopper proceeds to pay, Drop-in returns the paymentComponentData.paymentMethod.
  1. Pass the paymentComponentData.paymentMethod to your server.
  2. From your server, make a /payments request, specifying:
    • paymentMethod: The paymentComponentData.paymentMethod from your client app.
    Make a payment with a token

    curl

    Java

    PHP

    C#

    Go

    Python

    Ruby

    NodeJS (TypeScript)

You can also use tokens to make shopper-not-present payments for subscriptions or contracts. For more information, refer to Making a payment for a subscription or contract.

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. Configure Drop-in using the client key from your live Customer Area.
  4. 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. For more information, refer to PCI DSS compliance guide.

See also