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:
- To import the module: blik
- To launch and show the Component: BlikComponent
This page explains how to add BLIK to your existing Android Components integration.
Requirements
Requirement | Description |
---|---|
Integration type | Make sure that you have an existing Components integration. BLIK for Android requires at least v3.8.0 of Components. For more information, refer to Release notes. |
Setup steps | Before you begin, add BLIK in your test Customer Area. |
Set up the BLIK Component
- Import the BLIK Component to your
build.gradle
file:implementation "com.adyen.checkout:blik:<latest-version>"
For the latest version, refer to our GitHub.
- Build a client-side configuration of the BLIK Component:
val blikConfiguration = BlikConfiguration.Builder(context, "YOUR_CLIENT_KEY") // When you are ready to accept live payments, change the value to one of our live environments. .setEnvironment(Environment.TEST) .build()
- Add the Component view to your layout:
<com.adyen.checkout.blik.BlikView android:id="@+id/YOUR_COMPONENT_VIEW_ID" .../>
You will attach the initialized component to this view when collecting payment details.
Collect payment details
Use the client-side Component to collect the phone number from your shopper.
- Deserialize the
/paymentMethods
response with theSERIALIZER
object:val paymentMethodsApiResponse = PaymentMethodsApiResponse.SERIALIZER.deserialize(paymentMethodsResponse)
- From the result, get the object containing
paymentMethods.type
: blik. - Initialize an instance of the Component. Call
PROVIDER.get
from the BLIK Component and pass the following:- The context (for example,
this@YourActivity
) - The
PaymentMethod
object (for example,paymentMethod
) - The
BlikConfiguration
object:val blikComponent = BlikComponent.PROVIDER.get(this@YourActivity, paymentMethod, blikConfiguration)
- The context (for example,
- Attach the Component to the view to start getting your shopper's payment details. You need to call
attach
from the payment method's Component view and pass in:- the
BlikComponent
- the context (for example,
this@YourActivity
):BlikView.attach(blikComponent, this@YourActivity)
You start receiving updates when the shopper enters their phone number.
- the
- Check if
isValid
is true, and when the shopper proceeds to pay, pass thepaymentComponentState.data.paymentMethod
to your server:blikComponent.observe(this@MainActivity) { state -> if (state?.isValid == true) { //serialize data val paymentComponentData = PaymentComponentData.SERIALIZER.serialize(state.data) // When the shopper pays, pass the serialized `state.data` to your server to send a /payments request } }
Handle the await action
Step 1: Deserialize the action object
In your client-side app, deserialize the action
object from the /payments
response:
val action = Action.SERIALIZER.deserialize(paymentResponse.action)
Step 2: Initialize the Component
-
Before initializing the Component, make sure that you have added the following to your
build.gradle
file:Check the latest version on GitHub.
-
Create a configuration object for the Component, passing your client key:
-
To initialize an instance of the Component, call
PROVIDER.get
from the Component and pass in the context (for example,this@YourActivity
), application class, and the configuration object created in the previous step: -
From your instance, call
handleAction
and pass:- the context (for example,
this@YourActivity
) - the
action
object from the deserialized/payments
response.
- the context (for example,
Step 3: Check the payment result
The Component notifies the observer
with the actionComponentData
object from the data in intent.data
. Pass this to your server to make a /payments/details
request.
Test and go live
You can test BLIK transactions in the test environment using any 6-digit number that starts with 777 as your blikCode
.
You can test different refused payment result scenarios by using the following amounts in your /payments request:
Refusal reason | Amount |
---|---|
ALIAS_DECLINED | 288.00 |
TAS_DECLINED | 192.00 |
USER_DECLINED | 144.00 |
SEC_DECLINED | 216.00 |
SYSTEM_ERROR | 264.00 |
GENERAL_ERROR | 360.00 |
INSUFFICIENT_FUNDS | 120.00 |
TIMEOUT | 312.00 |
LIMIT_EXCEEDED | 96.00 |
USER_TIMEOUT | 336.00 |
ISSUER_DECLINED | 9.99 |
Check the status of BLIK test payments in your Customer Area > Transactions > Payments.
Before you can accept live BLIK payments, add BLIK in your live Customer Area.