{"title":"DuitNow iOS Component","category":"default","creationDate":1776961628,"content":"<p>Our DuitNow Component renders DuitNow 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=\"tabgSlO2\">\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=%7B%7BgetParameter%28%27platform%27%29%7D%7D&amp;amp;integration=%7B%7BgetParameter%28%27integration%27%29%7D%7D\\&quot;&gt;  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 DuitNow 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=%7B%7BgetParameter%28%27platform%27%29%7D%7D&amp;amp;integration=%7B%7BgetParameter%28%27integration%27%29%7D%7D\\&quot;&gt;  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 DuitNow 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 DuitNow in your payment form<\/h2>\n<p>Include DuitNow 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; MY.<\/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; MYR.<\/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>duitnow<\/strong> and put it into an object. For example, <code>duitnowPaymentMethod<\/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 DuitNow Component:<\/p>\n<pre><code class=\"language-swift\">let duitnowComponent = DuitNowComponent(paymentMethod: duitnowPaymentMethod, apiContext: apiContext)\nduitnowComponent.delegate = self\n\/\/ In this example, the Pay button will show 10 MYR.\n\/\/ The value is in minor units. Change the currencyCode to the currency for the DuitNow Component.\nduitnowComponent.payment = Payment(amount: Amount(value: 1000,\n                                                              currencyCode: \"MYR\"))\npresent(duitnowComponent.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=\"'duitnow-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;MYR\\&quot;,\\n        \\&quot;value\\&quot;: 10000\\n    },\\n    \\&quot;paymentMethod\\&quot;: {\\n        \\&quot;type\\&quot;: \\&quot;duitnow\\&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;MYR\\&quot;,\\n    value: 10000\\n  },\\n  paymentMethod: {\\n    type: \\&quot;duitnow\\&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;MYR\\&quot;,\\n    \\&quot;value\\&quot;: 10000\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;duitnow\\&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; 'MYR',\\n    :value =&gt; 10000\\n  },\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'duitnow'\\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\\\": \\\"duitnow\\\",\\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 DuitNow 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<p>If you are implementing an additional use case, you can <a href=\"\/pt\/online-payments\/build-your-integration\">make a \/payments\/details call to receive an immediate response<\/a>.<\/p>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>Test DuitNow payments with real payment details and small amounts.<\/p>\n<p>Check the status of your test DuitNow payments in your <strong>Customer Area<\/strong> &gt; <strong>Transactions<\/strong> &gt; <strong>Payments<\/strong>.<\/p>\n<p>To accept live DuitNow 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 DuitNow 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\/duitnow\/ios-component","articleFields":{"description":"Add DuitNow to your existing iOS Components integration.","parameters":{"payment_method":"DuitNow","country_code":"MY","currency":"MYR","payment_method_component_type":"DuitNow","payment_method_type":"duitnow","payment_method_type_response":"duitnow","return_url":"my-app:\/\/adyen","channel":"iOS","ios_config_component_type":"InstantPaymentComponent","ios_config_payment_method":"DuitNow","ios_config_component_name":"DuitNow"},"robots":"noindex,nofollow"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/duitnow\/ios-component","title":"DuitNow iOS Component","content":"Our DuitNow Component renders DuitNow 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 DuitNow in your payment form\nInclude DuitNow in the list of available payment methods.\n\n\nSpecify in your  \/paymentMethods request:\n\n countryCode&#58; MY.\n amount.currency&#58; MYR.\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 duitnow and put it into an object. For example, duitnowPaymentMethod.\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 DuitNow Component:\nlet duitnowComponent = DuitNowComponent(paymentMethod: duitnowPaymentMethod, apiContext: apiContext)\nduitnowComponent.delegate = self\n\/\/ In this example, the Pay button will show 10 MYR.\n\/\/ The value is in minor units. Change the currencyCode to the currency for the DuitNow Component.\nduitnowComponent.payment = Payment(amount: Amount(value: 1000,\n                                                              currencyCode: \"MYR\"))\npresent(duitnowComponent.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 DuitNow 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\nIf you are implementing an additional use case, you can make a \/payments\/details call to receive an immediate response.\nTest and go live\nTest DuitNow payments with real payment details and small amounts.\nCheck the status of your test DuitNow payments in your Customer Area &gt; Transactions &gt; Payments.\nTo accept live DuitNow payments, you must contact our Support Team to add DuitNow 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":"DuitNow","lvl3":"DuitNow 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\/duitnow","lvl3":"\/pt\/payment-methods\/duitnow\/ios-component"},"levels":4,"category":"Payment method","category_color":"green","tags":["DuitNow","Component"]}}
