- To import the module: instant
- To launch and show the Component: InstantPaymentComponent
- Show Bancontact in your payment form.
- Handle the redirect result when the shopper returns to your app.
Requirements
- In your Customer Area, go to Developers > Additional data.
- Under 3D Secure select the checkbox for 3DS2 Additional Fields. |
Show Bancontact in your payment form
Include Bancontact in the list of available payment methods. You do not need to collect any information from the shopper in your payment form.-
Specify in your /paymentMethods request:
- countryCode: BE.
- amount.currency: EUR.
paymentMethod.type: bcmc_mobile.
We provide a Bancontact logo which you can use on your payment form. For more information, refer to Downloading logos.
Optional configuration
When you create the Bancontact configuration object, you can optionally add configuration parameters. Bancontact mobile configurationMake a payment
-
When the shopper selects the button to pay, make a /payments request, specifying:
paymentMethod.type: bcmc_mobilereturnURL: The URL to where the shopper should be redirected back to after they complete the payment. Get this URL from the Component in theRedirectComponent.getReturnUrl(context).
curl
Java
PHP
C#
NodeJS (JavaScript)
Go
Python
Ruby
NodeJS (TypeScript)
The /payments response contains:-
action: Object containing information about the redirect. /payments response
-
Pass the
actionobject to your client app. You need this to initialize the Redirect Component.
Handle the redirect
Use theQRCodeComponent to redirect the shopper to the Bancontact app:
Step 1: Initialize the QR Code Component
-
Before initializing the Component, make sure that you have added the following to your
build.gradlefile: Initialize componentCheck the latest version on GitHub. -
Create a configuration object for the Component, passing your client key:
Create configuration object
-
To initialize an instance of the Component, call
PROVIDER.getfrom the Component and pass in the context (for example,this@YourActivity), application class, and the configuration object created in the previous step: Initialize instance of component -
From your instance, call
handleActionand pass:- the context (for example,
this@YourActivity) - the
actionobject from the deserialized/paymentsresponse.
- the context (for example,
Step 2: Handle the redirect
-
Add an
IntentFilterto theActivitythat will handle thereturnUrlspecified in your/paymentsrequest. Intent filterThe${applicationId}will be replaced withyour.package.nameat build time. -
Get the result of the redirect from the
Activity. Pass theintentback to the Component. Depending on your activity’s launchMode, you can get this intent in eitheronCreateoronNewIntent. Get result of redirect -
The Component notifies the
observerwith theactionComponentDataobject from the data inintent.data. Pass this to your server. Notification
Step 3: Check the payment result
After the shopper returns to your app, make a POST /payments/details request from your server, providing:-
details: TheactionComponentData.detailsobject from the from theQRCodeComponent/payments/details requestcurl
Java
PHP
C#
NodeJS (JavaScript)
Go
Python
Ruby
NodeJS (TypeScript)
You receive a response containing: -
resultCode: Use this to present the payment result to your shopper. -
pspReference: Our unique identifier for the transaction. /payments/details response
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 payments, you can receive the followingresultCode values:
Recurring payments
Bancontact supports tokenization for recurring payments. We strongly recommend that you ask explicit permission from the shopper if you intend to make future recurring payments. You can use recurring transactions through the Bancontact Wallet Initiated Program (WIP).Bancontact Wallet Initiated Program
The Bancontact Wallet Initiated Program (WIP) is a service that streamlines checkout and supports subscription-based billing. It offers the following:- Bancontact One-Click Pay to speed up checkout and boost conversion rates
- Bancontact Recurring to support merchant-initiated recurring or subscription payments
Make a recurring payment
To make recurring payments, you need to: To test recurring payments, contact our Support Team to configure your test environment.Create a token
To create a token, include in your /sessions or /payments request:storePaymentMethod: true- shopperReference: Your unique identifier for the shopper (minimum length three characters).
type: recurring.token.createdshopperReference: your unique identifier for the shopper.eventId: ThepspReferenceof the initial payment.storedPaymentMethodId: This is the token that you need to make recurring payments for this shopper.
Make a payment with a token
To make a payment with the token, include in your /payments request:paymentMethod.storedPaymentMethodId: ThestoredPaymentMethodIdfrom the recurring.token.created webhook. You can also get this value by using the /listRecurringDetails endpoint.shopperReference: The unique shopper identifier that you specified when creating the token.shopperInteraction: ContAuth.recurringProcessingModel: Subscription or UnscheduledCardOnFile.
shopperInteraction and recurringProcessingModel fields, refer to Tokenization.
The following example shows a recurring Subscription payment using WIP.