Payment-method icon

Bancontact card Android Component

Add Bancontact card to an existing Components integration.

If you are using Android Components v5.0.0 or later:

This payment method requires no additional configuration.

Follow the Components integration guide and use the following module and Component names:

A Bancontact card payment is like a regular card payment, except for the following:

  • There is no CVC. For co-badged cards, the CVC field can still appear.
  • 3D Secure authentication is mandatory.
  • Separate captures are not supported.

Our Component renders the Bancontact card in your payment form, and securely collects sensitive card information, so it doesn't touch your server.

When making a Bancontact card payment, you need to use the Redirect Component to handle the 3D Secure authentication.

Requirements

Requirement Description
Integration type Make sure that you have built an Advanced flow Android Components integration.
Setup steps Before you begin, add Bancontact card in your Customer Area.

Show Bancontact card in your payment form

To show the Bancontact card in your payment form, you need to:

  1. Specify in your /paymentMethods request:

    • countryCode: BE
    • amount.currency: EUR.
  2. Deserialize the /paymentMethods response. Put the object with type: bcmc in a PaymentMethod object.

  3. Add the Bancontact card Component:

    a. Import the Card Component to your build.gradle file.

      implementation "com.adyen.checkout:bcmc:<latest-version>"

    For the latest version, refer to our GitHub.

    b. Create a BcmcConfiguration object, and pass your client key. You can also include optional configuration, for example to make the cardholder name required.

    val bcmcConfiguration = BcmcConfiguration.Builder(context, "YOUR_CLIENT_KEY")
        // Makes the cardholder name required
        .setHolderNameRequired(true)
        // When you are ready to accept live payments, change the value to one of our live environments.
        .setEnvironment(Environment.TEST)
        .build()

    c. Initialize the Bancontact card Component. Pass the following:

    • your context (for example, this@YourActivity)
    • the object from the /paymentMethods response (for example, paymentMethod)
    • the BcmcConfiguration object (for example, bcmcConfiguration)
    val bcmcComponent = BcmcComponent.PROVIDER.get(this@YourActivity, paymentMethod, bcmcConfiguration)

    d. Add the Bancontact card Component view to your layout.

        <com.adyen.checkout.bcmc.BcmcView
               android:id="@+id/bcmcView" />

    e. Attach the Component to the view to start getting your shopper's payment details.

        bcmcView.attach(bcmcComponent, this@YourActivity)

    f. When shoppers enter their payment details, you start receiving updates. If isValid is true, and the shopper proceeds to pay, pass the paymentComponentState.data.paymentMethod to your server and make a payment request.

       bcmcComponent.observe(this) { paymentComponentState ->
           if (paymentComponentState?.isValid == true) {
              // When the shopper proceeds to pay, pass the `paymentComponentState.data` to your server to send a /payments request
              sendPayment(paymentComponentState.data)
           }
       }

Make a payment

When the shopper proceeds to pay, the Component returns the paymentComponentState.data.paymentMethod.

  1. Pass the paymentComponentState.data to your server.
  2. From your server, make a /payments request, specifying:
    • paymentMethod: The paymentComponentState.data.paymentMethod from your client app.
    • channel: Android
    • returnURL: The URL where the shopper will be redirected back to after completing 3D Secure 1 authentication. Get this URL from Drop-in in the RedirectComponent.getReturnUrl(context).

The /payments response contains an action object with type: redirect.

Handle the redirect

Use the Redirect Component to redirect the shopper to complete the 3D Secure authentication.

After the shopper returns to your app, make a POST /payments/details request from your server, providing:

  • details: The actionComponentData.details object from the Redirect Component.

You receive a response containing:

  • resultCode: Use this to present the payment result to your shopper.
  • pspReference: Our unique identifier for the transaction.

Present the payment result

Use the  resultCode from the /payments/details response to present the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a webhook.

For Bancontact card payments, you can receive the following resultCode values:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment was successful.
Cancelled The shopper cancelled the payment. Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.
Error There was an error when the payment was being processed. For more information, check the refusalReason field. Inform the shopper that there was an error processing their payment.
Refused The payment was refused. For more information, check the refusalReason field. Ask the shopper to try the payment again using a different payment method.

Recurring payments

Bancontact recurring payments are not available in the test environment. To test your integration, do a penny test in the live environment instead.

We support recurring transactions for Bancontact through SEPA Direct Debit. To make recurring payments, you need to:

  1. Create a shopper token.
  2. Use the token to make future payments for the shopper.

Create a token

We strongly recommend that you request explicit permission from the shopper if you intend to make recurring SEPA payments. Being transparent about the payment schedule and the charged amount reduces the risk of chargebacks.

To create a token, include in your /sessions or /payments request:

  • storePaymentMethod: true
  • shopperReference: Your unique identifier for the shopper (minimum length three characters).

When the payment has been settled, you receive a webhook containing:

  • eventCode: RECURRING_CONTRACT
  • originalReference: The pspReference of the initial payment.
  • pspReference: This is the token that you need to make recurring payments for this shopper.

Make sure that your server is able to receive RECURRING_CONTRACT as part of your standard webhooks. You can enable the RECURRING_CONTRACT event code in the webhook settings page.

Make a payment with a token

To make a payment with the token, include in your /payments request:

  • paymentMethod.storedPaymentMethodId: The pspReference from the RECURRING_CONTRACT. You can also get this value by using the /listRecurringDetails endpoint.
  • shopperReference: The unique shopper identifier that you specified when creating the token.
  • shopperInteractionContAuth.
  • recurringProcessingModel: Subscription or UnscheduledCardOnFile.

For more information about the shopperInteraction and recurringProcessingModel fields, refer to Tokenization.

Test and go live

Before making live payments, use the following credentials to test your integration:

Card number Card type CVV2/CVC2 Username Password Issuing country/region Expiry date
5127 8809 9999 9990 BCMC / Mastercard Debit BCMC: None
Mastercard: 737
user password BE 03/2030
6703 4444 4444 4449 BCMC / Maestro None user password BE 03/2030
4871 0499 9999 9910 1 BCMC / Visa Debit BCMC: None
Visa: 737
user password BE 03/2030

1 Depending on your payment method setup, transactions with this test card are routed to Bancontact or Visa.

You can force a decline using these credentials with "holderName": "DECLINED".

    "paymentMethod": {
      "type": "bcmc",
      "number": "4871049999999910",
      "holderName": "DECLINED",
      "expiryMonth": "03",
      "expiryYear": "2030"
    }

This gets the following response:

    "refusalReason": "Refused",
    "resultCode": "Refused",

You can check the status of test payments in your Customer Area > Transactions > Payments.

Add Bancontact card in your live Customer Area.

  1. Configure the Component using the Client Encryption Public Key from your live Customer Area.

See also