{"title":"PromptPay Android Component","category":"default","creationDate":1567783140,"content":"<p>This page explains how to add PromptPay to your existing Android Components integration.<\/p>\n<p>Choose the <a href=\"\/pt\/online-payments\/build-your-integration\">server-side flow<\/a> that your integration uses:<\/p>\n\n<div id=\"tabbC5ZL\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;Sessions flow&quot;,&quot;content&quot;:&quot;\\n&lt;h2&gt;Requirements&lt;\\\/h2&gt;\\n&lt;table&gt;\\n&lt;thead&gt;\\n&lt;tr&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Requirement&lt;\\\/th&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Description&lt;\\\/th&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/thead&gt;\\n&lt;tbody&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;strong&gt;Integration type&lt;\\\/strong&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Make sure that you have built a Sessions flow &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/sessions-flow?platform=Android\\&quot;&gt;Android Components integration&lt;\\\/a&gt;. &lt;br&gt; The minimum required version is 5.0.0.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;strong&gt;Setup steps&lt;\\\/strong&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Before you begin, contact our &lt;a href=\\&quot;https:\\\/\\\/ca-test.adyen.com\\\/ca\\\/ca\\\/contactUs\\\/support.shtml?form=other\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Support Team&lt;\\\/a&gt; to add PromptPay in your Customer Area.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/tbody&gt;\\n&lt;\\\/table&gt;\\n&lt;h2&gt;Create a payment session&lt;\\\/h2&gt;\\n&lt;p&gt;This step corresponds to &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/sessions-flow\\\/?platform=Android&amp;amp;integration=Components&amp;amp;version=5.3.0#create-the-checkout-session\\&quot;&gt;Create a payment session&lt;\\\/a&gt; in the Components integration guide.&lt;\\\/p&gt;\\n&lt;p&gt;You do not need to include any additional parameters for PromptPay in the API request.&lt;\\\/p&gt;\\n&lt;h2&gt;Set up Components&lt;\\\/h2&gt;\\n&lt;p&gt;This section corresponds to &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/sessions-flow\\\/?platform=Android&amp;amp;integration=Components#set-up\\&quot;&gt;Set up Components&lt;\\\/a&gt; in the Components integration guide.&lt;\\\/p&gt;\\n&lt;h3&gt;Import the library&lt;\\\/h3&gt;\\n&lt;p&gt;This step corresponds to the &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/sessions-flow\\\/?platform=Android&amp;amp;integration=Components#import\\&quot;&gt;Import the library step&lt;\\\/a&gt; of the Components integration guide.&lt;\\\/p&gt;\\n&lt;p&gt;During this step of integrating, use the following code snippets:&lt;\\\/p&gt;\\n&lt;h4&gt;With Jetpack Compose&lt;\\\/h4&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Import the library with Compose&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;implementation \\\\\\&quot;com.adyen.checkout:instant:YOUR_VERSION\\\\\\&quot;\\\\nimplementation \\\\\\&quot;com.adyen.checkout:components-compose:YOUR_VERSION\\\\\\&quot;\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&lt;h4&gt;Without Jetpack Compose&lt;\\\/h4&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Import the library without Compose&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;implementation \\\\\\&quot;com.adyen.checkout:instant:YOUR_VERSION\\\\\\&quot;\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&lt;h3&gt;Configure the Component&lt;\\\/h3&gt;\\n&lt;p&gt;This step corresponds to &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/sessions-flow\\\/?platform=Android&amp;amp;integration=Components#import\\&quot;&gt;Configure components&lt;\\\/a&gt; of the Components integration guide.&lt;\\\/p&gt;\\n&lt;p&gt;You do not need to add specific configuration for PromptPay.&lt;\\\/p&gt;\\n&lt;h3&gt;Create the checkout session&lt;\\\/h3&gt;\\n&lt;p&gt;This step corresponds to the &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/sessions-flow\\\/?platform=Android&amp;amp;integration=Components&amp;amp;version=5.3.0#create-the-checkout-session\\&quot;&gt;create a payment session step&lt;\\\/a&gt; in the main integration guide.&lt;\\\/p&gt;\\n&lt;h3&gt;Launch and show the Component&lt;\\\/h3&gt;\\n&lt;p&gt;This corresponds to the &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/sessions-flow\\\/?platform=Android&amp;amp;integration=Components#launch-and-show\\&quot;&gt;Launch and show the Component step&lt;\\\/a&gt; in the main integration guide.&lt;\\\/p&gt;\\n&lt;p&gt;During this step of integrating, use the following code snippets:&lt;\\\/p&gt;\\n&lt;h4&gt;With Jetpack Compose&lt;\\\/h4&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Launch the Component with Compose&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;Component\\\\nimport com.adyen.checkout.components.compose.get\\\\n\\\\n\\\\\\\/\\\\\\\/ Get the payment method.\\\\nval paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.PROMPTPAY)\\\\n\\\\n@Composable\\\\nprivate fun ComposableInstantComponent() {\\\\n   \\\\\\\/\\\\\\\/ Keep a reference to this Component in case you need to access it later.\\\\n   val instantPaymentComponent = InstantPaymentComponent.PROVIDER.get(\\\\n       checkoutSession = checkoutSession,\\\\n       paymentMethod = paymentMethod,\\\\n       configuration = configuration,\\\\n       componentCallback = callback,\\\\n       \\\\\\\/\\\\\\\/ This key is required to ensure a new Component gets created for each different screen or payment session.\\\\n       \\\\\\\/\\\\\\\/ Generate a new value for this key every time you need to reset the Component.\\\\n       key = \\\\\\&quot;YOUR_UNIQUE_KEY_FOR_THIS_COMPONENT\\\\\\&quot;,\\\\n   )\\\\n\\\\n   \\\\\\\/\\\\\\\/ This is your composable, a wrapper around our xml view.\\\\n   AdyenComponent(\\\\n      component = instantPaymentComponent,\\\\n      modifier = YOUR_MODIFIER,\\\\n   )\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&lt;h4&gt;Without Jetpack Compose&lt;\\\/h4&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Launch the Component without Compose&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;&amp;lt;com.adyen.checkout.ui.core.AdyenComponentView\\\\n    android:id=\\\\\\&quot;@+id\\\\\\\/YOUR_COMPONENT_VIEW_ID\\\\\\&quot;\\\\n    ...\\\\\\\/&amp;gt;\\\\n\\\\n\\\\\\\/\\\\\\\/ Get the payment method.\\\\nval paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.PROMPTPAY)\\\\n\\\\nval instantPaymentComponent = InstantPaymentComponent.PROVIDER.get(\\\\n    activity, \\\\\\\/\\\\\\\/ Your activity or fragment.\\\\n    checkoutSession,\\\\n    paymentMethod,\\\\n    cardConfiguration,\\\\n    componentCallback,\\\\n)\\\\n\\\\nbinding.componentView.attach(instantPaymentComponent, viewLifecycleOwner)\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;sessions_flow_0_1&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;Advanced flow&quot;,&quot;content&quot;:&quot;\\n&lt;h2&gt;Requirements&lt;\\\/h2&gt;\\n&lt;table&gt;\\n&lt;thead&gt;\\n&lt;tr&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Requirement&lt;\\\/th&gt;\\n&lt;th style=\\&quot;text-align: left;\\&quot;&gt;Description&lt;\\\/th&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/thead&gt;\\n&lt;tbody&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;strong&gt;Integration type&lt;\\\/strong&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Make sure that you have built an Advanced flow &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/advanced-flow?platform=Android\\&quot;&gt;Android Components integration&lt;\\\/a&gt;. &lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;&lt;strong&gt;Setup steps&lt;\\\/strong&gt;&lt;\\\/td&gt;\\n&lt;td style=\\&quot;text-align: left;\\&quot;&gt;Before you begin, contact our &lt;a href=\\&quot;https:\\\/\\\/ca-test.adyen.com\\\/ca\\\/ca\\\/contactUs\\\/support.shtml?form=other\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Support Team&lt;\\\/a&gt; to add PromptPay in your Customer Area.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/tbody&gt;\\n&lt;\\\/table&gt;\\n&lt;h2&gt;Configure Components&lt;\\\/h2&gt;\\n&lt;p&gt;This corresponds to the &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/advanced-flow?platform=Android&amp;amp;integration=Components&amp;amp;version=5.2.0#configure\\&quot;&gt;Configure components step&lt;\\\/a&gt; in the main integration guide.&lt;\\\/p&gt;\\n&lt;p&gt;You do not need to add specific configuration for PromptPay.&lt;\\\/p&gt;\\n&lt;h3&gt;Import the library&lt;\\\/h3&gt;\\n&lt;p&gt;This step corresponds to the &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/sessions-flow\\\/?platform=Android&amp;amp;integration=Components#import\\&quot;&gt;Import the library step&lt;\\\/a&gt; of the Components integration guide.&lt;\\\/p&gt;\\n&lt;p&gt;During this step of integrating, use the following code snippets:&lt;\\\/p&gt;\\n&lt;h4&gt;With Jetpack Compose&lt;\\\/h4&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Import the library with Compose&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;implementation \\\\\\&quot;com.adyen.checkout:instant:YOUR_VERSION\\\\\\&quot;\\\\nimplementation \\\\\\&quot;com.adyen.checkout:components-compose:YOUR_VERSION\\\\\\&quot;\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&lt;h4&gt;Without Jetpack Compose&lt;\\\/h4&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Import the library without Compose&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;implementation \\\\\\&quot;com.adyen.checkout:instant:YOUR_VERSION\\\\\\&quot;\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&lt;h2&gt;Launch and show the Component&lt;\\\/h2&gt;\\n&lt;p&gt;Follow the steps in the the &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/advanced-flow\\\/?tab=compose-launch_1#launch-and-show\\&quot;&gt;Android Components Advanced flow integration guide&lt;\\\/a&gt; to launch and show the Component for PromptPay.&lt;\\\/p&gt;\\n&lt;h2&gt;Make a payment&lt;\\\/h2&gt;\\n&lt;p&gt;Make a payment request with the payment information for the shopper, as described in the &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\\/advanced-flow\\\/?platform=Android&amp;amp;integration=Components&amp;amp;version=5.2.0#make-a-payment\\&quot;&gt;Android Components Advanced flow integration guide&lt;\\\/a&gt;.&lt;\\\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;\\\/payments request&#039;\\&quot; :id=\\&quot;&#039;promptpay-payments&#039;\\&quot; :code-data=\\&quot;[{&amp;quot;language&amp;quot;:&amp;quot;bash&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;curl&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;curl https:\\\\\\\/\\\\\\\/checkout-test.adyen.com\\\\\\\/v72\\\\\\\/payments \\\\\\\\\\\\n-H &#039;x-api-key: ADYEN_API_KEY&#039; \\\\\\\\\\\\n-H &#039;content-type: application\\\\\\\/json&#039; \\\\\\\\\\\\n-d &#039;{\\\\n    \\\\&amp;quot;merchantAccount\\\\&amp;quot;: \\\\&amp;quot;YOUR_MERCHANT_ACCOUNT\\\\&amp;quot;,\\\\n    \\\\&amp;quot;amount\\\\&amp;quot;: {\\\\n        \\\\&amp;quot;currency\\\\&amp;quot;: \\\\&amp;quot;THB\\\\&amp;quot;,\\\\n        \\\\&amp;quot;value\\\\&amp;quot;: 10000\\\\n    },\\\\n    \\\\&amp;quot;paymentMethod\\\\&amp;quot;: {\\\\n        \\\\&amp;quot;type\\\\&amp;quot;: \\\\&amp;quot;promptpay\\\\&amp;quot;\\\\n    },\\\\n    \\\\&amp;quot;reference\\\\&amp;quot;: \\\\&amp;quot;YOUR_ORDER_NUMBER\\\\&amp;quot;\\\\n}&#039;&amp;quot;},{&amp;quot;language&amp;quot;:&amp;quot;java&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;Java&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;\\\\\\\/\\\\\\\/ Adyen Java API Library v39.3.0\\\\nimport com.adyen.Client;\\\\nimport com.adyen.enums.Environment;\\\\nimport com.adyen.model.checkout.*;\\\\nimport java.time.OffsetDateTime;\\\\nimport java.util.*;\\\\nimport com.adyen.model.RequestOptions;\\\\nimport com.adyen.service.checkout.*;\\\\n\\\\n\\\\\\\/\\\\\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\\\nClient client = new Client(\\\\&amp;quot;ADYEN_API_KEY\\\\&amp;quot;, Environment.TEST);\\\\n\\\\n\\\\\\\/\\\\\\\/ Create the request object(s)\\\\n\\\\\\\/\\\\\\\/ Send the request\\\\nPaymentsApi service = new PaymentsApi(client);\\\\nPaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey(\\\\&amp;quot;UUID\\\\&amp;quot;));&amp;quot;},{&amp;quot;language&amp;quot;:&amp;quot;php&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;PHP&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;&amp;lt;?php\\\\n\\\\\\\/\\\\\\\/ Adyen PHP API Library v28.2.0\\\\nuse Adyen\\\\\\\\Client;\\\\nuse Adyen\\\\\\\\Environment;\\\\nuse Adyen\\\\\\\\Service\\\\\\\\Checkout\\\\\\\\PaymentsApi;\\\\n\\\\n$client = new Client();\\\\n$client-&amp;gt;setXApiKey(\\\\&amp;quot;ADYEN_API_KEY\\\\&amp;quot;);\\\\n\\\\\\\/\\\\\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\\\n$client-&amp;gt;setEnvironment(Environment::TEST);\\\\n\\\\n\\\\n\\\\\\\/\\\\\\\/ Create the request object(s)\\\\n$requestOptions[&#039;idempotencyKey&#039;] = &#039;UUID&#039;;\\\\n\\\\n\\\\\\\/\\\\\\\/ Send the request\\\\n$service = new PaymentsApi($client);\\\\n$response = $service-&amp;gt;payments($paymentRequest, $requestOptions);&amp;quot;},{&amp;quot;language&amp;quot;:&amp;quot;cs&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;C#&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;\\\\\\\/\\\\\\\/ Adyen .net API Library v32.1.1\\\\nusing Adyen;\\\\nusing Environment = Adyen.Model.Environment;\\\\nusing Adyen.Model;\\\\nusing Adyen.Model.Checkout;\\\\nusing Adyen.Service.Checkout;\\\\n\\\\n\\\\\\\/\\\\\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\\\nvar config = new Config()\\\\n{\\\\n    XApiKey = \\\\&amp;quot;ADYEN_API_KEY\\\\&amp;quot;,\\\\n    Environment = Environment.Test\\\\n};\\\\nvar client = new Client(config);\\\\n\\\\n\\\\\\\/\\\\\\\/ Create the request object(s)\\\\n\\\\\\\/\\\\\\\/ Send the request\\\\nvar service = new PaymentsService(client);\\\\nvar response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = \\\\&amp;quot;UUID\\\\&amp;quot;});&amp;quot;},{&amp;quot;language&amp;quot;:&amp;quot;js&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;NodeJS (JavaScript)&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;\\\\\\\/\\\\\\\/ Adyen Node API Library v29.0.0\\\\nconst { Client, CheckoutAPI } = require(&#039;@adyen\\\\\\\/api-library&#039;);\\\\n\\\\n\\\\\\\/\\\\\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\\\nconst config = new Config({\\\\n  apiKey: \\\\&amp;quot;ADYEN_API_KEY\\\\&amp;quot;,\\\\n  environment: EnvironmentEnum.TEST\\\\n});\\\\n\\\\nconst client = new Client(config);\\\\n\\\\n\\\\\\\/\\\\\\\/ Create the request object(s)\\\\nconst paymentRequest = {\\\\n  merchantAccount: \\\\&amp;quot;YOUR_MERCHANT_ACCOUNT\\\\&amp;quot;,\\\\n  amount: {\\\\n    currency: \\\\&amp;quot;THB\\\\&amp;quot;,\\\\n    value: 10000\\\\n  },\\\\n  paymentMethod: {\\\\n    type: \\\\&amp;quot;promptpay\\\\&amp;quot;\\\\n  },\\\\n  reference: \\\\&amp;quot;YOUR_ORDER_NUMBER\\\\&amp;quot;\\\\n}\\\\n\\\\n\\\\\\\/\\\\\\\/ Send the request\\\\nconst checkoutAPI = new CheckoutAPI(client);\\\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\\\&amp;quot;UUID\\\\&amp;quot; });&amp;quot;},{&amp;quot;language&amp;quot;:&amp;quot;go&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;Go&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;\\\\\\\/\\\\\\\/ Adyen Go API Library v21.0.0\\\\nimport (\\\\n  \\\\&amp;quot;context\\\\&amp;quot;\\\\n  \\\\&amp;quot;github.com\\\\\\\/adyen\\\\\\\/adyen-go-api-library\\\\\\\/v21\\\\\\\/src\\\\\\\/common\\\\&amp;quot;\\\\n  \\\\&amp;quot;github.com\\\\\\\/adyen\\\\\\\/adyen-go-api-library\\\\\\\/v21\\\\\\\/src\\\\\\\/adyen\\\\&amp;quot;\\\\n  \\\\&amp;quot;github.com\\\\\\\/adyen\\\\\\\/adyen-go-api-library\\\\\\\/v21\\\\\\\/src\\\\\\\/checkout\\\\&amp;quot;\\\\n)\\\\n\\\\\\\/\\\\\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\\\nclient := adyen.NewClient(&amp;amp;common.Config{\\\\n  ApiKey:      \\\\&amp;quot;ADYEN_API_KEY\\\\&amp;quot;,\\\\n  Environment: common.TestEnv,\\\\n})\\\\n\\\\n\\\\\\\/\\\\\\\/ Create the request object(s)\\\\n\\\\\\\/\\\\\\\/ Send the request\\\\nservice := client.Checkout()\\\\nreq := service.PaymentsApi.PaymentsInput().IdempotencyKey(\\\\&amp;quot;UUID\\\\&amp;quot;).PaymentRequest(paymentRequest)\\\\nres, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)&amp;quot;},{&amp;quot;language&amp;quot;:&amp;quot;py&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;Python&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;# Adyen Python API Library v13.6.0\\\\nimport Adyen\\\\n\\\\nadyen = Adyen.Adyen()\\\\nadyen.client.xapikey = \\\\&amp;quot;ADYEN_API_KEY\\\\&amp;quot;\\\\n# For the LIVE environment, also include your liveEndpointUrlPrefix.\\\\nadyen.client.platform = \\\\&amp;quot;test\\\\&amp;quot; # The environment to use library in.\\\\n\\\\n# Create the request object(s)\\\\njson_request = {\\\\n  \\\\&amp;quot;merchantAccount\\\\&amp;quot;: \\\\&amp;quot;YOUR_MERCHANT_ACCOUNT\\\\&amp;quot;,\\\\n  \\\\&amp;quot;amount\\\\&amp;quot;: {\\\\n    \\\\&amp;quot;currency\\\\&amp;quot;: \\\\&amp;quot;THB\\\\&amp;quot;,\\\\n    \\\\&amp;quot;value\\\\&amp;quot;: 10000\\\\n  },\\\\n  \\\\&amp;quot;paymentMethod\\\\&amp;quot;: {\\\\n    \\\\&amp;quot;type\\\\&amp;quot;: \\\\&amp;quot;promptpay\\\\&amp;quot;\\\\n  },\\\\n  \\\\&amp;quot;reference\\\\&amp;quot;: \\\\&amp;quot;YOUR_ORDER_NUMBER\\\\&amp;quot;\\\\n}\\\\n\\\\n# Send the request\\\\nresult = adyen.checkout.payments_api.payments(request=json_request, idempotency_key=\\\\&amp;quot;UUID\\\\&amp;quot;)&amp;quot;},{&amp;quot;language&amp;quot;:&amp;quot;rb&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;Ruby&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;# Adyen Ruby API Library v10.4.0\\\\nrequire \\\\&amp;quot;adyen-ruby-api-library\\\\&amp;quot;\\\\n\\\\nadyen = Adyen::Client.new\\\\nadyen.api_key = &#039;ADYEN_API_KEY&#039;\\\\n# For the LIVE environment, also include your liveEndpointUrlPrefix.\\\\nadyen.env = :test # Set to \\\\&amp;quot;live\\\\&amp;quot; for live environment\\\\n\\\\n# Create the request object(s)\\\\nrequest_body = {\\\\n  :merchantAccount =&amp;gt; &#039;YOUR_MERCHANT_ACCOUNT&#039;,\\\\n  :amount =&amp;gt; {\\\\n    :currency =&amp;gt; &#039;THB&#039;,\\\\n    :value =&amp;gt; 10000\\\\n  },\\\\n  :paymentMethod =&amp;gt; {\\\\n    :type =&amp;gt; &#039;promptpay&#039;\\\\n  },\\\\n  :reference =&amp;gt; &#039;YOUR_ORDER_NUMBER&#039;\\\\n}\\\\n\\\\n# Send the request\\\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { &#039;Idempotency-Key&#039; =&amp;gt; &#039;UUID&#039; })&amp;quot;},{&amp;quot;language&amp;quot;:&amp;quot;ts&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;NodeJS (TypeScript)&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;\\\\\\\/\\\\\\\/ Adyen Node API Library v29.0.0\\\\nimport { Client, CheckoutAPI, Types } from \\\\&amp;quot;@adyen\\\\\\\/api-library\\\\&amp;quot;;\\\\n\\\\n\\\\\\\/\\\\\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\\\nconst config = new Config({\\\\n  apiKey: \\\\&amp;quot;ADYEN_API_KEY\\\\&amp;quot;,\\\\n  environment: EnvironmentEnum.TEST\\\\n});\\\\n\\\\nconst client = new Client(config);\\\\n\\\\n\\\\\\\/\\\\\\\/ Create the request object(s)\\\\n\\\\\\\/\\\\\\\/ Send the request\\\\nconst checkoutAPI = new CheckoutAPI(client);\\\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\\\&amp;quot;UUID\\\\&amp;quot; });&amp;quot;}]\\&quot; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;advanced_flow_1_2&quot;,&quot;relation&quot;:&quot;&quot;}]\"\n            :should-update-when-url-changes='false'>\n        <\/tabs>\n    <\/div>\n<\/div>\n\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>Test PromptPay payments with real payment details and small amounts.<\/p>\n<p>Check the status of your test PromptPay payments in your <strong>Customer Area<\/strong> &gt; <strong>Transactions<\/strong> &gt; <strong>Payments<\/strong>.<\/p>\n<p>To accept live PromptPay payments, you must contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a> to add PromptPay 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\/promptpay\/android-component","articleFields":{"description":"Add PromptPay to an existing Components integration.","parameters":{"integration":"Components","platform":"Android","integration_guide_url":"build-your-integration\/sessions-flow?platform=Android&integration=Components&version=latest","country_code":"SG","currency":"SGD","payment_method_component_type":"promptpay","payment_method":"PromptPay","payment_method_type":"promptpay","payment_method_type_response":"promptpay","component_name":"the Component","return_url":"my-app:\/\/adyen"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/promptpay\/android-component","title":"PromptPay Android Component","content":"This page explains how to add PromptPay to your existing Android Components integration.\nChoose the server-side flow that your integration uses:\n\n\n    \n        \n        \n    \n\n\nTest and go live\nTest PromptPay payments with real payment details and small amounts.\nCheck the status of your test PromptPay payments in your Customer Area &gt; Transactions &gt; Payments.\nTo accept live PromptPay payments, you must contact our Support Team to add PromptPay 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":"PromptPay","lvl3":"PromptPay 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\/promptpay","lvl3":"\/pt\/payment-methods\/promptpay\/android-component"},"levels":4,"category":"Payment method","category_color":"green","tags":["PromptPay","Android","Component"]}}
