{"title":"PromptPay iOS Component","category":"default","creationDate":1776961628,"content":"<p>Our PromptPay Component renders PromptPay in your payment form and collects your shopper's selected bank.<\/p>\n<h2>Requirements<\/h2>\n<p>Select the <a href=\"\/pt\/online-payments\/build-your-integration\">server-side flow<\/a> that your integration uses:<\/p>\n\n<div id=\"tab7qda5\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;Sessions flow&quot;,&quot;content&quot;:&quot;\\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=iOS&amp;amp;integration=Components\\&quot;&gt;iOS 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&quot;,&quot;altTitle&quot;:&quot;sessions&quot;,&quot;oldTabId&quot;:&quot;sessions-requirements_1&quot;,&quot;relation&quot;:&quot;sessions&quot;},{&quot;title&quot;:&quot;Advanced flow&quot;,&quot;content&quot;:&quot;\\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=iOS&amp;amp;integration=Components\\&quot;&gt;iOS 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&quot;,&quot;altTitle&quot;:&quot;advanced&quot;,&quot;oldTabId&quot;:&quot;advanced-requirements_2&quot;,&quot;relation&quot;:&quot;advanced&quot;}]\"\n            :should-update-when-url-changes='true'>\n        <\/tabs>\n    <\/div>\n<\/div>\n\n<h2>Show PromptPay in your payment form<\/h2>\n<p>Include PromptPay in the list of available payment methods.<\/p>\n<ol>\n<li>\n<p>Specify in your  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> request:<\/p>\n<ul>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-countryCode\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">countryCode<\/a>&#58; <strong>TH<\/strong>.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-amount-currency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.currency<\/a>&#58; <strong>THB<\/strong>.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-channel\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">channel<\/a>&#58; Specify <strong>iOS<\/strong>.<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Decode the <code>\/paymentMethods<\/code> response with the <code>PaymentMethods<\/code> structure.<\/p>\n<pre><code class=\"language-swift\">let paymentMethods = try JSONDecoder().decode(PaymentMethods.self, from: paymentMethodsResponse)<\/code><\/pre>\n<p>Find <code>paymentMethods.type<\/code> <strong><strong>promptpay<\/strong><\/strong> and put it into an object. For example, <code>promptpayPaymentMethod<\/code>.<\/p>\n<\/li>\n<li>\n<p>Create an instance of <code>APIContext<\/code> with the following parameters:<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter name<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>clientKey<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>Your <a href=\"\/pt\/development-resources\/client-side-authentication\">client key<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><code>environment<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>Use <strong>test<\/strong>. When you are ready to accept live payments, change the value to one of our <a href=\"https:\/\/adyen.github.io\/adyen-ios\/5.0.0\/documentation\/adyen\/environment\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live environments<\/a>.\u00a0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'APIContext initialization'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"\\\/\\\/ When you are ready to go live, change environment to Environment.live\\n\\\/\\\/ You can also use other environment values described in https:\\\/\\\/adyen.github.io\\\/adyen-ios\\\/Docs\\\/Structs\\\/Environment.html\\nlet apiContext = APIContext(environment: Environment.test, clientKey: clientKey)\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Initialize the PromptPay Component:<\/p>\n<pre><code class=\"language-swift\">let promptpayComponent = PromptPayComponent(paymentMethod: promptpayPaymentMethod, apiContext: apiContext)\npromptpayComponent.delegate = self\n\/\/ In this example, the Pay button will show 10 &lt;strong&gt;THB&lt;\/strong&gt;.\n\/\/ The value is in minor units. Change the currencyCode to the currency for the PromptPay Component.\npromptpayComponent.payment = Payment(amount: Amount(value: 1000,\n                                                              currencyCode: \"&lt;strong&gt;THB&lt;\/strong&gt;\"))\npresent(promptpayComponent.viewController, animated: true)<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2>Make a payment<\/h2>\n<p>When the shopper proceeds to pay, the Component invokes the <code>didSubmit<\/code> method containing the <code>data.paymentMethod<\/code> from the <code>PaymentComponentDelegate<\/code>.<\/p>\n<ol>\n<li>Pass the <code>data.paymentMethod<\/code> to your server.<\/li>\n<li>\n<p>From your server, make a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request, specifying:<\/p>\n<ul>\n<li><code>paymentMethod.type<\/code>: The <code>data.paymentMethod<\/code> from your client app.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"''\" :id=\"'promptpay-payments'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/payments \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n    \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n    \\&quot;amount\\&quot;: {\\n        \\&quot;currency\\&quot;: \\&quot;THB\\&quot;,\\n        \\&quot;value\\&quot;: 10000\\n    },\\n    \\&quot;paymentMethod\\&quot;: {\\n        \\&quot;type\\&quot;: \\&quot;promptpay\\&quot;\\n    },\\n    \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&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(\\&quot;ADYEN_API_KEY\\&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(\\&quot;UUID\\&quot;));&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;&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-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Send the request\\n$service = new PaymentsApi($client);\\n$response = $service-&gt;payments($paymentRequest, $requestOptions);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&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 = \\&quot;ADYEN_API_KEY\\&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 = \\&quot;UUID\\&quot;});&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v29.0.0\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nconst paymentRequest = {\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  amount: {\\n    currency: \\&quot;THB\\&quot;,\\n    value: 10000\\n  },\\n  paymentMethod: {\\n    type: \\&quot;promptpay\\&quot;\\n  },\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;\\n}\\n\\n\\\/\\\/ Send the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v21.0.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/checkout\\&quot;\\n)\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_API_KEY\\&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(\\&quot;UUID\\&quot;).PaymentRequest(paymentRequest)\\nres, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v13.6.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\n# For the LIVE environment, also include your liveEndpointUrlPrefix.\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Create the request object(s)\\njson_request = {\\n  \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;currency\\&quot;: \\&quot;THB\\&quot;,\\n    \\&quot;value\\&quot;: 10000\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;promptpay\\&quot;\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;\\n}\\n\\n# Send the request\\nresult = adyen.checkout.payments_api.payments(request=json_request, idempotency_key=\\&quot;UUID\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v10.4.0\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\n# For the LIVE environment, also include your liveEndpointUrlPrefix.\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :merchantAccount =&gt; 'YOUR_MERCHANT_ACCOUNT',\\n  :amount =&gt; {\\n    :currency =&gt; 'THB',\\n    :value =&gt; 10000\\n  },\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'promptpay'\\n  },\\n  :reference =&gt; 'YOUR_ORDER_NUMBER'\\n}\\n\\n# Send the request\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v29.0.0\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\n\\\/\\\/ For the LIVE environment, also include your liveEndpointUrlPrefix.\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_API_KEY\\&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: \\&quot;UUID\\&quot; });&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>The response contains the following data:<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li><code>resultCode<\/code>: <span translate=\"no\"><strong>Pending<\/strong><\/span><\/li>\n<li><code>action<\/code>: Contains the QR code <code>url<\/code> and <code>qrCodeData<\/code>.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'\/payments response'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"pspReference\\\": \\\"8815658961765250\\\",\\n    \\\"resultCode\\\": \\\"Pending\\\",\\n    \\\"action\\\": {\\n        \\\"paymentData\\\": \\\"Ab02b4c0!BQABAgA...\\\",\\n        \\\"paymentMethodType\\\": \\\"promptpay\\\",\\n        \\\"type\\\": \\\"qrCode\\\",\\n        \\\"url\\\": \\\"https:\\\/\\\/test.adyen.com\\\/hpp\\\/generateQRCodeImage.shtml?url=DMhpN90TFR2e7TzwHYRFkhw4brxm2wHBg\\\",\\n        \\\"qrCodeData\\\": \\\"DMhpN90TFR2e7TzwHYRFkhw4brxm2wHBg\\\"\\n    }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"present-qr-code\">Show the QR code<\/h2>\n<p>Use the information in the <code>action<\/code> object of the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> response to render the QR code.<\/p>\n<ul>\n<li><code>action.url<\/code>: Use this URL to download the QR code.<\/li>\n<li><code>action.qrCodeData<\/code>: Use this to render the QR code on your checkout page.<\/li>\n<\/ul>\n<p>The shopper can either scan the QR code, or take a screenshot of the QR code and upload it to their bank app.<\/p>\n<h2>Show the payment result<\/h2>\n<p>Use the <code>resultCode<\/code> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/details\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/details<\/a> response to show the payment outcome on your frontend.<\/p>\n<p>You will also receive the outcome of the payment asynchronously in a <a href=\"\/pt\/development-resources\/webhooks\">webhook<\/a>.<\/p>\n<p>The <code>resultCode<\/code> values you can receive for PromptPay are:<\/p>\n<table>\n<thead>\n<tr>\n<th>eventCode<\/th>\n<th>success field<\/th>\n<th>Description<\/th>\n<th>Action to take<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>AUTHORISATION<\/strong><\/td>\n<td><strong>false<\/strong><\/td>\n<td>The transaction failed.<\/td>\n<td>Cancel the order and inform the shopper that the payment failed.<\/td>\n<\/tr>\n<tr>\n<td><strong>AUTHORISATION<\/strong><\/td>\n<td><strong>true<\/strong><\/td>\n<td>The shopper successfully completed the payment.<\/td>\n<td>Inform the shopper that the payment has been successful and proceed with the order.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\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=iOS&amp;integration=Components\"\n                        target=\"_self\"\n                        >\n                    iOS 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\/ios-component","articleFields":{"description":"Add PromptPay to your existing iOS Components integration.","parameters":{"payment_method":"PromptPay","country_code":"<strong>TH<\/strong>","currency":"<strong>THB<\/strong>","payment_method_component_type":"PromptPay","payment_method_type":"promptpay","payment_method_type_response":"<strong>promptpay<\/strong>","return_url":"my-app:\/\/adyen","channel":"iOS","integration":"Components","platform":"iOS"},"robots":"noindex,nofollow"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/promptpay\/ios-component","title":"PromptPay iOS Component","content":"Our PromptPay Component renders PromptPay in your payment form and collects your shopper's selected bank.\nRequirements\nSelect the server-side flow that your integration uses:\n\n\n    \n        \n        \n    \n\n\nShow PromptPay in your payment form\nInclude PromptPay in the list of available payment methods.\n\n\nSpecify in your  \/paymentMethods request:\n\n countryCode&#58; TH.\n amount.currency&#58; THB.\n channel&#58; Specify iOS.\n\n\n\nDecode the \/paymentMethods response with the PaymentMethods structure.\nlet paymentMethods = try JSONDecoder().decode(PaymentMethods.self, from: paymentMethodsResponse)\nFind paymentMethods.type promptpay and put it into an object. For example, promptpayPaymentMethod.\n\n\nCreate an instance of APIContext with the following parameters:\n\n\n\nParameter name\nRequired\nDescription\n\n\n\n\nclientKey\n\nYour client key.\n\n\nenvironment\n\nUse test. When you are ready to accept live payments, change the value to one of our live environments.\u00a0\n\n\n\n\n\n\n\n\nInitialize the PromptPay Component:\nlet promptpayComponent = PromptPayComponent(paymentMethod: promptpayPaymentMethod, apiContext: apiContext)\npromptpayComponent.delegate = self\n\/\/ In this example, the Pay button will show 10 &lt;strong&gt;THB&lt;\/strong&gt;.\n\/\/ The value is in minor units. Change the currencyCode to the currency for the PromptPay Component.\npromptpayComponent.payment = Payment(amount: Amount(value: 1000,\n                                                              currencyCode: \"&lt;strong&gt;THB&lt;\/strong&gt;\"))\npresent(promptpayComponent.viewController, animated: true)\n\n\nMake a payment\nWhen the shopper proceeds to pay, the Component invokes the didSubmit method containing the data.paymentMethod from the PaymentComponentDelegate.\n\nPass the data.paymentMethod to your server.\n\nFrom your server, make a  \/payments request, specifying:\n\npaymentMethod.type: The data.paymentMethod from your client app.\n\n\n\n\nThe response contains the following data:\n\n\n\nresultCode: Pending\naction: Contains the QR code url and qrCodeData.\n\n\n    \n\nShow the QR code\nUse the information in the action object of the  \/payments response to render the QR code.\n\naction.url: Use this URL to download the QR code.\naction.qrCodeData: Use this to render the QR code on your checkout page.\n\nThe shopper can either scan the QR code, or take a screenshot of the QR code and upload it to their bank app.\nShow the payment result\nUse the resultCode from the  \/payments\/details response to show the payment outcome on your frontend.\nYou will also receive the outcome of the payment asynchronously in a webhook.\nThe resultCode values you can receive for PromptPay are:\n\n\n\neventCode\nsuccess field\nDescription\nAction to take\n\n\n\n\nAUTHORISATION\nfalse\nThe transaction failed.\nCancel the order and inform the shopper that the payment failed.\n\n\nAUTHORISATION\ntrue\nThe shopper successfully completed the payment.\nInform the shopper that the payment has been successful and proceed with the order.\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                    iOS 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 iOS 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\/ios-component"},"levels":4,"category":"Payment method","category_color":"green","tags":["PromptPay","Component"]}}
