{"title":"BLIK Android Component","category":"default","creationDate":1776961628,"content":"<div class=\"sc-notice info\"><div>\n<p><strong>If you are using Android Components v5.0.0 or later:<\/strong><\/p>\n<p>This payment method requires no additional configuration.<\/p>\n<p>Follow the  <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components\">Components integration guide<\/a> and use the following module and Component names:<\/p>\n<ul>\n<li>To <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow\/?platform=Android&amp;integration=Components#import\">import the module<\/a>: <strong>blik<\/strong><\/li>\n<li>To <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components#launch-and-show\">launch and show the Component<\/a>: <strong>BlikComponent<\/strong><\/li>\n<\/ul>\n<\/div><\/div>\n<p>This page explains how to add BLIK to your existing Android Components integration.<\/p>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that you have built your <a href=\"\/pt\/online-payments\/\/\" target=\"_blank\">Components integration<\/a>. <br> <p>BLIK for Android requires at least v3.8.0 of Components. For more information, refer to <a href=\"\/pt\/online-payments\/release-notes\" target=\"_blank\">Release notes<\/a>.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Before you begin, <a href=\"\/pt\/payment-methods\/add-payment-methods\">add BLIK in your test Customer Area<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Set up the BLIK Component<\/h2>\n<ol>\n<li>Import the BLIK Component to your <code>build.gradle<\/code> file:\n<pre><code class=\"language-groovy\">implementation \"com.adyen.checkout:blik:&lt;latest-version&gt;\"<\/code><\/pre>\n<p>For the latest version, refer to our <a href=\"https:\/\/github.com\/Adyen\/adyen-android\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">GitHub<\/a>.<\/p><\/li>\n<li>Build a client-side configuration of the BLIK Component:\n<pre><code class=\"language-kotlin\">val blikConfiguration =\n  BlikConfiguration.Builder(context, \"YOUR_CLIENT_KEY\")\n  \/\/ When you are ready to accept live payments, change the value to one of our live environments.\n  .setEnvironment(Environment.TEST)\n  .build()<\/code><\/pre><\/li>\n<li>Add the Component view to your layout:\n<pre><code class=\"language-ml\">&lt;com.adyen.checkout.blik.BlikView\n  android:id=\"@+id\/YOUR_COMPONENT_VIEW_ID\"\n  ...\/&gt;<\/code><\/pre>\n<p>You will attach the initialized component to this view when <a href=\"#collect-payment-details\">collecting payment details<\/a>.<\/p><\/li>\n<\/ol>\n<h2 id=\"collect-payment-details\">Collect payment details<\/h2>\n<p>Use the client-side Component to collect the phone number from your shopper.<\/p>\n<ol>\n<li>Deserialize <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Android&amp;integration=Components#get-available-payment-methods\">the <code>\/paymentMethods<\/code> response<\/a> with the <code>SERIALIZER<\/code> object:\n<pre><code class=\"language-kotlin\">val paymentMethodsApiResponse = PaymentMethodsApiResponse.SERIALIZER.deserialize(paymentMethodsResponse)<\/code><\/pre><\/li>\n<li>From the result, get the object containing <code>paymentMethods.type<\/code>: <span translate=\"no\"><strong>blik<\/strong><\/span>.<\/li>\n<li>Initialize an instance of the Component. Call <code>PROVIDER.get<\/code> from the BLIK Component and pass the following:\n<ul>\n<li>The context (for example, <code>this@YourActivity<\/code>)<\/li>\n<li>The <code>PaymentMethod<\/code> object (for example, <code>paymentMethod<\/code>)<\/li>\n<li>The <code>BlikConfiguration<\/code> object:\n<pre><code class=\"language-kotlin\">val blikComponent = BlikComponent.PROVIDER.get(this@YourActivity, paymentMethod, blikConfiguration)<\/code><\/pre><\/li>\n<\/ul><\/li>\n<li>Attach the Component to the view to start getting your shopper's payment details. You need to call <code>attach<\/code> from the payment method's Component view and pass in:\n<ul>\n<li>the <code>BlikComponent<\/code><\/li>\n<li>the context (for example, <code>this@YourActivity<\/code>): <code>BlikView.attach(blikComponent, this@YourActivity)<\/code><br \/>\nYou start receiving updates when the shopper enters their phone number.<\/li>\n<\/ul><\/li>\n<li>Check if <code>isValid<\/code> is <span translate=\"no\"><strong>true<\/strong><\/span>, and when the shopper proceeds to pay, pass the <code>paymentComponentState.data.paymentMethod<\/code> to your server:\n<pre><code class=\"language-kotlin\">blikComponent.observe(this@MainActivity) { state -&gt;\n  if (state?.isValid == true) {\n      \/\/serialize data\n      val paymentComponentData = PaymentComponentData.SERIALIZER.serialize(state.data)\n      \/\/ When the shopper pays, pass the serialized `state.data` to your server to send a \/payments request\n  }\n}<\/code><\/pre><\/li>\n<\/ol>\n<h2>Handle the await action<\/h2>\n<h3>Step 1: Deserialize the action object<\/h3>\n<p>In your client-side app, deserialize the <code>action<\/code> object from the <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Android&amp;integration=Components#make-a-payment\"><code>\/payments<\/code> response<\/a>:<\/p>\n<pre><code class=\"language-kotlin\">val action = Action.SERIALIZER.deserialize(paymentResponse.action)<\/code><\/pre>\n<h3>Step 2: Initialize the Component<\/h3>\n<ol>\n<li>\n<p>Before initializing the Component, make sure that you have added the following to your <code>build.gradle<\/code> file:<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Initialize component'\" :id=\"''\" :code-data='[{\"language\":\"groovy\",\"tabTitle\":\"\",\"content\":\"implementation \\\"com.adyen.checkout:await:&lt;latest-version&gt;\\\"\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>Check the <a href=\"https:\/\/github.com\/Adyen\/adyen-android\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">latest version on GitHub<\/a>.<\/p>\n<\/li>\n<li>\n<p>Create a configuration object for the Component, passing your <a href=\"\/pt\/development-resources\/client-side-authentication\/#get-your-client-key\">client key<\/a>:<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Create configuration object'\" :id=\"''\" :code-data='[{\"language\":\"kotlin\",\"tabTitle\":\"\",\"content\":\"val awaitConfiguration = AwaitConfiguration.Builder(context, \\\"YOUR_CLIENT_KEY\\\")\\n   .setEnvironment(Environment.TEST)\\n   .build()\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>To initialize an instance of the Component, call <code>PROVIDER.get<\/code> from the Component and pass in the context (for example, <code>this@YourActivity<\/code>), application class, and the configuration object created in the previous step:<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Initialize instance of component'\" :id=\"''\" :code-data='[{\"language\":\"kotlin\",\"tabTitle\":\"\",\"content\":\"val awaitComponent = AwaitComponent.PROVIDER.get(this@YourActivity, application, awaitConfiguration)\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>From your instance, call <code>handleAction<\/code> and pass:<\/p>\n<ul>\n<li>the context (for example, <code>this@YourActivity<\/code>)<\/li>\n<li>the <code>action<\/code> object from the deserialized <code>\/payments<\/code> response.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Call handleAction'\" :id=\"''\" :code-data='[{\"language\":\"kotlin\",\"tabTitle\":\"\",\"content\":\"awaitComponent.handleAction(this@YourActivity, action)\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h3>Step 3: Check the payment result<\/h3>\n<p>The Component notifies the <code>observer<\/code> with the <code>actionComponentData<\/code> object from the data in <code>intent.data<\/code>. Pass this to your server to make a <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Android&amp;integration=Drop-in#send-additional-payment-details\"><code>\/payments\/details<\/code> request<\/a>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Check payment result'\" :id=\"''\" :code-data='[{\"language\":\"kotlin\",\"tabTitle\":\"\",\"content\":\"awaitcomponent.observe(this) { actionComponentData -&gt;\\n    \\\/\\\/ Send a \\\/payments\\\/details\\\/ call containing the `actionComponentData`\\n    sendPaymentDetails(actionComponentData)\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>To test a BLIK with code payment:<\/p>\n<ul>\n<li>Use BLIK code 777213.<\/li>\n<li>Make sure your implementation satisfies BLIK\u2019s guidelines.<\/li>\n<li>Test your integration end-to-end.<\/li>\n<\/ul>\n<h3>Going live<\/h3>\n<p>Before you can accept live BLIK payments, you need to add BLIK in your live Customer Area.<\/p>\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components\"\n                        target=\"_self\"\n                        >\n                    Android Components integration guide\n                <\/a><\/li><li><a href=\"\/development-resources\/webhooks\"\n                        target=\"_self\"\n                        >\n                    Webhooks\n                <\/a><\/li><li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/overview\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    API Explorer\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/blik\/android-component","articleFields":{"description":"Add BLIK to an existing Android Components integration.","parameters":{"payment_method":"BLIK","country_code":"PL","currency":"PLN","payment_method_type":"blik","return_url":"my-app:\/\/adyen","version":"3.8.0","integration":"Components","platform":"Android","component_js_const":"blik","component_type":"await","component_name_s":"await","component_name":"Await","module_import":"blik","android_component":"BlikComponent"},"feedback_component":true,"page_id":"2facbf3d-8416-4535-a0ad-fcb95cb0a9d1","filters_component":false,"decision_tree":"[]"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/blik\/android-component","title":"BLIK Android Component","content":"\nIf you are using Android Components v5.0.0 or later:\nThis payment method requires no additional configuration.\nFollow the  Components integration guide and use the following module and Component names:\n\nTo import the module: blik\nTo launch and show the Component: BlikComponent\n\n\nThis page explains how to add BLIK to your existing Android Components integration.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have built your Components integration.  BLIK for Android requires at least v3.8.0 of Components. For more information, refer to Release notes.\n\n\n\nSetup steps\nBefore you begin, add BLIK in your test Customer Area.\n\n\n\nSet up the BLIK Component\n\nImport the BLIK Component to your build.gradle file:\nimplementation \"com.adyen.checkout:blik:&lt;latest-version&gt;\"\nFor the latest version, refer to our GitHub.\nBuild a client-side configuration of the BLIK Component:\nval blikConfiguration =\n  BlikConfiguration.Builder(context, \"YOUR_CLIENT_KEY\")\n  \/\/ When you are ready to accept live payments, change the value to one of our live environments.\n  .setEnvironment(Environment.TEST)\n  .build()\nAdd the Component view to your layout:\n&lt;com.adyen.checkout.blik.BlikView\n  android:id=\"@+id\/YOUR_COMPONENT_VIEW_ID\"\n  ...\/&gt;\nYou will attach the initialized component to this view when collecting payment details.\n\nCollect payment details\nUse the client-side Component to collect the phone number from your shopper.\n\nDeserialize the \/paymentMethods response with the SERIALIZER object:\nval paymentMethodsApiResponse = PaymentMethodsApiResponse.SERIALIZER.deserialize(paymentMethodsResponse)\nFrom the result, get the object containing paymentMethods.type: blik.\nInitialize an instance of the Component. Call PROVIDER.get from the BLIK Component and pass the following:\n\nThe context (for example, this@YourActivity)\nThe PaymentMethod object (for example, paymentMethod)\nThe BlikConfiguration object:\nval blikComponent = BlikComponent.PROVIDER.get(this@YourActivity, paymentMethod, blikConfiguration)\n\nAttach 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:\n\nthe BlikComponent\nthe context (for example, this@YourActivity): BlikView.attach(blikComponent, this@YourActivity)\nYou start receiving updates when the shopper enters their phone number.\n\nCheck if isValid is true, and when the shopper proceeds to pay, pass the paymentComponentState.data.paymentMethod to your server:\nblikComponent.observe(this@MainActivity) { state -&gt;\n  if (state?.isValid == true) {\n      \/\/serialize data\n      val paymentComponentData = PaymentComponentData.SERIALIZER.serialize(state.data)\n      \/\/ When the shopper pays, pass the serialized `state.data` to your server to send a \/payments request\n  }\n}\n\nHandle the await action\nStep 1: Deserialize the action object\nIn your client-side app, deserialize the action object from the \/payments response:\nval action = Action.SERIALIZER.deserialize(paymentResponse.action)\nStep 2: Initialize the Component\n\n\nBefore initializing the Component, make sure that you have added the following to your build.gradle file:\n\n\n\nCheck the latest version on GitHub.\n\n\nCreate a configuration object for the Component, passing your client key:\n\n\n\n\n\nTo 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:\n\n\n\n\n\nFrom your instance, call handleAction and pass:\n\nthe context (for example, this@YourActivity)\nthe action object from the deserialized \/payments response.\n\n\n\n\n\n\nStep 3: Check the payment result\nThe 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.\n\n    \n\nTest and go live\nTo test a BLIK with code payment:\n\nUse BLIK code 777213.\nMake sure your implementation satisfies BLIK\u2019s guidelines.\nTest your integration end-to-end.\n\nGoing live\nBefore you can accept live BLIK payments, you need to add BLIK in your live Customer Area.\nSee also\n\n\n                    Android Components integration guide\n                \n                    Webhooks\n                \n                    API Explorer\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"BLIK","lvl3":"BLIK Android Component"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/blik","lvl3":"\/pt\/payment-methods\/blik\/android-component"},"levels":4,"category":"Payment method","category_color":"green","tags":["Android","Component"]}}
