{"title":"Headless integration","category":"default","creationDate":1776961628,"content":"<p>This page describes how to build a front end for your headless Shopware 6 integration using either Adyen's pre-built UI solutions or your own UI. Your front end connects to your existing back end that uses Shopware's Store API endpoints.<\/p>\n<h2>Requirements<\/h2>\n<p>Before you start building a Shopware 6 Headless integration, <a href=\"\/pt\/plugins\/shopware-6\">set up the Shopware 6 plugin<\/a>.<\/p>\n<h2 id=\"step-1-get-payment-methods\">Step 1: Get available payment methods<\/h2>\n<p>Get the available payment methods, so you can show them in the checkout form.<\/p>\n<p>Make a <strong>POST<\/strong> <a href=\"https:\/\/shopware.stoplight.io\/docs\/store-api\/storeapi.json\/paths\/~1payment-method\/post\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>store-api\/payment-method<\/code>\n<\/a> request to get the available payment methods. Specify:<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>page<\/code><\/td>\n<td>Search result page.<\/td>\n<\/tr>\n<tr>\n<td><code>limit<\/code><\/td>\n<td>Number of items per result page.<\/td>\n<\/tr>\n<tr>\n<td><code>filter<\/code><\/td>\n<td>List of filters to restrict the search result.<\/td>\n<\/tr>\n<tr>\n<td><code>sort<\/code><\/td>\n<td>Sorting in the search result.<\/td>\n<\/tr>\n<tr>\n<td><code>post_filter<\/code><\/td>\n<td>Filters that applied without affecting aggregations.<\/td>\n<\/tr>\n<tr>\n<td><code>associations<\/code><\/td>\n<td>Used to fetch associations that are not fetched by default.<\/td>\n<\/tr>\n<tr>\n<td><code>aggregations<\/code><\/td>\n<td>Used to perform aggregations on the search result.<\/td>\n<\/tr>\n<tr>\n<td><code>grouping<\/code><\/td>\n<td>Perform groupings over certain fields.<\/td>\n<\/tr>\n<tr>\n<td><code>onlyAvailable<\/code><\/td>\n<td>List only available.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The response contains an <code>adyenData<\/code> object for each available payment method.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Example response for POST \/store-api\/payment-method'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"[\\n    {\\n        \\\"name\\\": \\\"SEPA direct debit\\\",\\n        \\\"description\\\": \\\"Direct debit payments\\\",\\n        \\\"active\\\": true,\\n        ...\\n        \\\"extensions\\\": {\\n            ...\\n            \\\"adyenData\\\": {\\n                \\\"type\\\": \\\"sepadirectdebit\\\",\\n                \\\"paymentMethodConfig\\\": {\\n                    \\\"name\\\": \\\"SEPA Direct Debit\\\",\\n                    \\\"type\\\": \\\"sepadirectdebit\\\"\\n                },\\n                \\\"apiAlias\\\": \\\"adyen_shopware_struct_adyen_payment_method_data_struct\\\"\\n            }\\n        },\\n        \\\"apiAlias\\\": \\\"payment_method\\\"\\n    },\\n    {\\n        \\\"name\\\": \\\"PayPal\\\",\\n        \\\"description\\\": \\\"eWallet\\\",\\n        \\\"active\\\": true,\\n        ...\\n        \\\"extensions\\\": {\\n            ...\\n            \\\"adyenData\\\": {\\n                \\\"type\\\": \\\"paypal\\\",\\n                \\\"paymentMethodConfig\\\": {\\n                    \\\"configuration\\\": {\\n                        \\\"merchantId\\\": \\\"MERCHANT_ACCOUNT\\\",\\n                        \\\"intent\\\": \\\"capture\\\"\\n                    },\\n                    \\\"name\\\": \\\"PayPal\\\",\\n                    \\\"type\\\": \\\"paypal\\\"\\n                },\\n                \\\"apiAlias\\\": \\\"adyen_shopware_struct_adyen_payment_method_data_struct\\\"\\n            }\\n        },\\n        \\\"apiAlias\\\": \\\"payment_method\\\"\\n    }\\n]\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>In the next step, use information from the <code>adyenData<\/code> objects to show payment methods on your checkout page.<\/p>\n<h2 id=\"show-available-payment-methods\">Step 2: Show available payment methods<\/h2>\n<p>Show the available payment methods on your front end and collect the shopper's payment details by <a href=\"#render-with-dropin-components\">rendering the input fields using our Drop-in or Components<\/a>.<\/p>\n<h3 id=\"render-with-dropin-components\">Render the input fields using our Drop-in or Components<\/h3>\n<p>Use one of our <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Web\">Pre-built UI options<\/a>.<\/p>\n<ol>\n<li>From your server, make a <strong>GET<\/strong> <code>\/store-api\/adyen\/payment-methods<\/code> request. The response you get is the same as an Adyen Checkout API <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\n  <code>\/paymentMethods<\/code>\n<\/a> response.<\/li>\n<\/ol>\n\n<div id=\"tabQb6H0\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;Web Drop-in&quot;,&quot;content&quot;:&quot;\\n&lt;ol start=\\&quot;2\\&quot;&gt;\\n&lt;li&gt;\\n&lt;p&gt;When you &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\&quot;&gt;configure Drop-in&lt;\\\/a&gt; use the full response as the &lt;code&gt;paymentMethodsResponse&lt;\\\/code&gt; in the configuration object:&lt;\\\/p&gt;\\n&lt;pre&gt;&lt;code class=\\&quot;language-js\\&quot;&gt;const configuration = {\\n  \\\/\\\/ ... Other configuration parameters\\n  paymentMethodsResponse: paymentMethodsResponse, \\\/\\\/ The full response from the server.&lt;\\\/code&gt;&lt;\\\/pre&gt;\\n&lt;\\\/li&gt;\\n&lt;li&gt;\\n&lt;p&gt;Configure and create Drop-in:&lt;\\\/p&gt;\\n&lt;pre&gt;&lt;code class=\\&quot;language-js\\&quot;&gt;\\\/\\\/ Configure Drop-in.\\nconst checkout = await AdyenCheckout(configuration);\\n\\\/\\\/ Create Drop-in.\\nconst dropin = checkout.create(&#039;dropin&#039;).mount(&#039;#dropin-container&#039;)&lt;\\\/code&gt;&lt;\\\/pre&gt;\\n&lt;\\\/li&gt;\\n&lt;\\\/ol&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;web_drop-in_0_1&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;Web Component&quot;,&quot;content&quot;:&quot;\\n&lt;ol start=\\&quot;2\\&quot;&gt;\\n&lt;li&gt;\\n&lt;p&gt;When you &lt;a href=\\&quot;\\\/pt\\\/online-payments\\\/build-your-integration\\&quot;&gt;configure Components&lt;\\\/a&gt; use the full response as the &lt;code&gt;paymentMethodsResponse&lt;\\\/code&gt; in the configuration object:&lt;\\\/p&gt;\\n&lt;pre&gt;&lt;code class=\\&quot;language-js\\&quot;&gt;const configuration = {\\n  \\\/\\\/ ... Other configuration parameters\\n  paymentMethodsResponse: paymentMethodsResponse, \\\/\\\/ The full response from the server.\\n\\\/\\\/ Configure Components.\\nconst checkout = await AdyenCheckout(configuration);&lt;\\\/code&gt;&lt;\\\/pre&gt;\\n&lt;\\\/li&gt;\\n&lt;li&gt;\\n&lt;p&gt;You can see available payment methods from &lt;code&gt;extensions.adyenData.type&lt;\\\/code&gt; from the &lt;a href=\\&quot;https:\\\/\\\/shopware.stoplight.io\\\/docs\\\/store-api\\\/storeapi.json\\\/paths\\\/~1payment-method\\\/post\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;\\n  &lt;code&gt;store-api\\\/payment-method&lt;\\\/code&gt;\\n&lt;\\\/a&gt; response. Some payment methods require additional configuration parameters that are shown on the pages for specific &lt;a href=\\&quot;\\\/pt\\\/payment-methods\\&quot;&gt;payment methods&lt;\\\/a&gt;. For each payment method you want to show to the shopper, create a Component:&lt;br \\\/&gt;\\nFor each payment method you want to show to the shopper, create a Component:&lt;\\\/p&gt;\\n&lt;pre&gt;&lt;code class=\\&quot;language-js\\&quot;&gt;\\\/\\\/ Create a Component for SEPA.\\nconst sepa = checkout.create(&#039;sepadirectdebit&#039;).mount(&#039;#sepa-component-container&#039;)\\n\\\/\\\/ Create a Component for Paypal.\\nconst paypal = checkout.create(&#039;paypal&#039;).mount(&#039;#paypal-component-container&#039;)&lt;\\\/code&gt;&lt;\\\/pre&gt;\\n&lt;\\\/li&gt;\\n&lt;\\\/ol&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;web_component_1_2&quot;,&quot;relation&quot;:&quot;&quot;}]\"\n            :should-update-when-url-changes='false'>\n        <\/tabs>\n    <\/div>\n<\/div>\n\n<h4>Saving the shopper's payment details<\/h4>\n<p>The shopper's payment details are collected by the Drop-in and Component in a <code>STATE_DATA<\/code> object that you send in <a href=\"#make-payment\">Step 4 when you make a payment<\/a>.<\/p>\n<h2>Step 3: Create order<\/h2>\n<p>When the shopper submits the order, create the order by making a <a href=\"https:\/\/shopware.stoplight.io\/docs\/store-api\/storeapi.json\/paths\/~1checkout~1order\/post\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>store-api\/checkout\/order<\/code>\n<\/a> endpoint.<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>customerComment<\/code><\/td>\n<td>Adds a comment from the customer to the order.<\/td>\n<\/tr>\n<tr>\n<td><code>affiliateCode<\/code><\/td>\n<td>The affiliate code can be used to track which referrer the customer came through.<\/td>\n<\/tr>\n<tr>\n<td><code>campaignCode<\/code><\/td>\n<td>The campaign code is used to track which action the customer came from.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"make-payment\">Step 4: Make payment<\/h2>\n<p>Make a <strong>POST<\/strong> <a href=\"https:\/\/shopware.stoplight.io\/docs\/store-api\/storeapi.json\/paths\/~1handle-payment\/post\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>store-api\/handle-payment<\/code>\n<\/a> request, including the shopper's payment details in the <code>stateData<\/code> parameter. For example:<\/p>\n<pre><code class=\"language-js\">this.client = new StoreApiClient();\nlet params = {\n            'orderId': 'XXX',\n            'finishUrl': 'https:\/\/example.com\/checkout\/finish?orderId=XXX',\n            'errorUrl': 'https:\/\/example.com\/checkout\/finish?orderId=XXX&amp;paymentFailed=1',\n        };\n\/\/ Add payment state data\nparams['stateData'] = {\n    paymentMethod: {\n     type: \"scheme\",\n     encryptedCardNumber: \"adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..\",\n     encryptedExpiryMonth: \"adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..\",\n     encryptedExpiryYear: \"adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..\",\n     encryptedSecurityCode: \"adyenjs_0_1_18$XUyMJyHebrra\/TpSda9fha978+..\"\n     holderName: \"S. Hopper\"\n   }\n}\nthis.client.post(\n    'https:\/\/example.com\/store-api\/handle-payment',\n    JSON.stringify(params)\n);<\/code><\/pre>\n<h2>Step 5: Handle additional actions<\/h2>\n<p>You can get the status of the payment by making a <strong>POST<\/strong> <code>\/store-api\/adyen\/payment-status<\/code> request with the <code>orderId<\/code> parameter as shown below:<\/p>\n<pre><code class=\"language-js\">this.client.post(\n    'https:\/\/example.com\/store-api\/adyen\/payment-status',\n    JSON.stringify({orderId: 'XXX'})\n);<\/code><\/pre>\n<p>The response will contain the following parameters:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>isFinal<\/code><\/td>\n<td style=\"text-align: left;\">This is a boolean value that indicates whether or not the payment requires additional action for the shopper.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>resultCode<\/code><\/td>\n<td style=\"text-align: left;\">Returns one of the Adyen payment <a href=\"\/pt\/online-payments\/payment-result-codes\">result codes<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>action<\/code><\/td>\n<td style=\"text-align: left;\">This optional response parameter is only returned for payments that require additional action from the user.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Some payment methods require additional action from the shopper, you can determine if this is the case from the response for <code>isFinal<\/code>:<\/p>\n<ul>\n<li>When <code>isFinal<\/code> is <code>true<\/code>, the payment has been completed and no further action is required.<\/li>\n<li>When <code>isFinal<\/code> is <code>false<\/code>, the <code>action<\/code> parameter will contain the payload needed to mount the UI elements for additional actions.<\/li>\n<\/ul>\n<p><strong>Note:<\/strong> Consult the <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow?platform=Web&amp;integration=Components#additional-action\">Web Component<\/a> or <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=Drop-in#additional-action\">Drop-in<\/a> documentation for how to handle additional front end actions.<\/p>\n<p>After your shopper completes the additional action:<\/p>\n<ol>\n<li>Access the additional input from the shopper by implementing the <code>onAdditionalDetails<\/code> event listener of your Drop-in or Web Component.<\/li>\n<li>Submit the additional details by making a <strong>POST<\/strong> <code>\/store-api\/adyen\/payment-details<\/code> request with the <code>orderId<\/code> and <code>stateData<\/code> parameters.<\/li>\n<\/ol>\n<pre><code class=\"language-js\">handleOnAdditionalDetails (state) {\n    this.client.post(\n        'https:\/\/example.com\/store-api\/adyen\/payment-details',\n        JSON.stringify({orderId: 'XXX', stateData: state.data})\n    );\n}<\/code><\/pre>\n<h2>Step 6: Present payment results<\/h2>\n<p>After the shopper completes the payment and no further actions are required on the front end or client app, use the <code>resultCode<\/code> to inform the shopper of the payment status.<\/p>\n<table>\n<thead>\n<tr>\n<th>resultCode<\/th>\n<th>Description<\/th>\n<th>Action to take<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Authorised<\/strong><\/td>\n<td>The payment was successful.<\/td>\n<td>Inform the shopper that the payment was successful.<\/td>\n<\/tr>\n<tr>\n<td><strong>Error<\/strong><\/td>\n<td>Inform the shopper that there was an error processing their payment.<\/td>\n<td>You'll receive a <code>refusalReason<\/code> in the same response, indicating the cause of the error.<\/td>\n<\/tr>\n<tr>\n<td><strong>Pending<\/strong><\/td>\n<td>The shopper has completed the payment but the final result is not yet known.<\/td>\n<td>Inform the shopper that you have received their order, and are waiting for the payment to be completed. <br> You will receive the final result of the payment in an <a href=\"\/pt\/development-resources\/webhooks\/webhook-types\">AUTHORISATION webhook<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><strong>PresentToShopper<\/strong><\/td>\n<td>Present the voucher or the QR code to the shopper.<\/td>\n<td>For a <strong>voucher<\/strong> payment method, inform the shopper that you are waiting for their payment. You will receive the final result of the payment in an <a href=\"\/pt\/development-resources\/webhooks\/webhook-types#event-codes\">AUTHORISATION webhook<\/a>. <br> <br> For a <strong>qrCode<\/strong> payment method, wait for the <a href=\"\/pt\/development-resources\/webhooks\/webhook-types#event-codes\">AUTHORISATION webhook<\/a> before presenting the payment result to the shopper.<\/td>\n<\/tr>\n<tr>\n<td><strong>Refused<\/strong><\/td>\n<td>The payment was refused.<\/td>\n<td>Inform the shopper that the payment was refused. Ask the shopper to try the payment again using a different payment method or card.<\/td>\n<\/tr>\n<tr>\n<td><strong>Received<\/strong><\/td>\n<td>For some payment methods, it can take some time before the final status of the payment is known.<\/td>\n<td>Inform the shopper that you have received their order, and are waiting for the payment to clear. <br> You will receive the final result of the payment in an <a href=\"\/pt\/development-resources\/webhooks\/webhook-types#event-codes\">AUTHORISATION webhook<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For other possible <code>resultCode<\/code> values and recommended messages that you can present to your shopper, see <a href=\"\/pt\/online-payments\/payment-result-codes\">Result codes<\/a>.<\/p>","url":"https:\/\/docs.adyen.com\/pt\/plugins\/shopware-6\/headless-integration","articleFields":{"description":"Use the Adyen plugin with a Shopware 6 Headless integration.","feedback_component":true,"last_edit_on":"18-11-2021 09:53"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/plugins\/shopware-6\/headless-integration","title":"Headless integration","content":"This page describes how to build a front end for your headless Shopware 6 integration using either Adyen's pre-built UI solutions or your own UI. Your front end connects to your existing back end that uses Shopware's Store API endpoints.\nRequirements\nBefore you start building a Shopware 6 Headless integration, set up the Shopware 6 plugin.\nStep 1: Get available payment methods\nGet the available payment methods, so you can show them in the checkout form.\nMake a POST \n  store-api\/payment-method\n request to get the available payment methods. Specify:\n\n\n\nParameter name\nDescription\n\n\n\n\npage\nSearch result page.\n\n\nlimit\nNumber of items per result page.\n\n\nfilter\nList of filters to restrict the search result.\n\n\nsort\nSorting in the search result.\n\n\npost_filter\nFilters that applied without affecting aggregations.\n\n\nassociations\nUsed to fetch associations that are not fetched by default.\n\n\naggregations\nUsed to perform aggregations on the search result.\n\n\ngrouping\nPerform groupings over certain fields.\n\n\nonlyAvailable\nList only available.\n\n\n\nThe response contains an adyenData object for each available payment method.\n\n    \n\nIn the next step, use information from the adyenData objects to show payment methods on your checkout page.\nStep 2: Show available payment methods\nShow the available payment methods on your front end and collect the shopper's payment details by rendering the input fields using our Drop-in or Components.\nRender the input fields using our Drop-in or Components\nUse one of our Pre-built UI options.\n\nFrom your server, make a GET \/store-api\/adyen\/payment-methods request. The response you get is the same as an Adyen Checkout API \n  \/paymentMethods\n response.\n\n\n\n    \n        \n        \n    \n\n\nSaving the shopper's payment details\nThe shopper's payment details are collected by the Drop-in and Component in a STATE_DATA object that you send in Step 4 when you make a payment.\nStep 3: Create order\nWhen the shopper submits the order, create the order by making a \n  store-api\/checkout\/order\n endpoint.\n\n\n\nParameter name\nDescription\n\n\n\n\ncustomerComment\nAdds a comment from the customer to the order.\n\n\naffiliateCode\nThe affiliate code can be used to track which referrer the customer came through.\n\n\ncampaignCode\nThe campaign code is used to track which action the customer came from.\n\n\n\nStep 4: Make payment\nMake a POST \n  store-api\/handle-payment\n request, including the shopper's payment details in the stateData parameter. For example:\nthis.client = new StoreApiClient();\nlet params = {\n            'orderId': 'XXX',\n            'finishUrl': 'https:\/\/example.com\/checkout\/finish?orderId=XXX',\n            'errorUrl': 'https:\/\/example.com\/checkout\/finish?orderId=XXX&amp;paymentFailed=1',\n        };\n\/\/ Add payment state data\nparams['stateData'] = {\n    paymentMethod: {\n     type: \"scheme\",\n     encryptedCardNumber: \"adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..\",\n     encryptedExpiryMonth: \"adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..\",\n     encryptedExpiryYear: \"adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..\",\n     encryptedSecurityCode: \"adyenjs_0_1_18$XUyMJyHebrra\/TpSda9fha978+..\"\n     holderName: \"S. Hopper\"\n   }\n}\nthis.client.post(\n    'https:\/\/example.com\/store-api\/handle-payment',\n    JSON.stringify(params)\n);\nStep 5: Handle additional actions\nYou can get the status of the payment by making a POST \/store-api\/adyen\/payment-status request with the orderId parameter as shown below:\nthis.client.post(\n    'https:\/\/example.com\/store-api\/adyen\/payment-status',\n    JSON.stringify({orderId: 'XXX'})\n);\nThe response will contain the following parameters:\n\n\n\nParameter\nDescription\n\n\n\n\nisFinal\nThis is a boolean value that indicates whether or not the payment requires additional action for the shopper.\n\n\nresultCode\nReturns one of the Adyen payment result codes.\n\n\naction\nThis optional response parameter is only returned for payments that require additional action from the user.\n\n\n\nSome payment methods require additional action from the shopper, you can determine if this is the case from the response for isFinal:\n\nWhen isFinal is true, the payment has been completed and no further action is required.\nWhen isFinal is false, the action parameter will contain the payload needed to mount the UI elements for additional actions.\n\nNote: Consult the Web Component or Drop-in documentation for how to handle additional front end actions.\nAfter your shopper completes the additional action:\n\nAccess the additional input from the shopper by implementing the onAdditionalDetails event listener of your Drop-in or Web Component.\nSubmit the additional details by making a POST \/store-api\/adyen\/payment-details request with the orderId and stateData parameters.\n\nhandleOnAdditionalDetails (state) {\n    this.client.post(\n        'https:\/\/example.com\/store-api\/adyen\/payment-details',\n        JSON.stringify({orderId: 'XXX', stateData: state.data})\n    );\n}\nStep 6: Present payment results\nAfter the shopper completes the payment and no further actions are required on the front end or client app, use the resultCode to inform the shopper of the payment status.\n\n\n\nresultCode\nDescription\nAction to take\n\n\n\n\nAuthorised\nThe payment was successful.\nInform the shopper that the payment was successful.\n\n\nError\nInform the shopper that there was an error processing their payment.\nYou'll receive a refusalReason in the same response, indicating the cause of the error.\n\n\nPending\nThe shopper has completed the payment but the final result is not yet known.\nInform the shopper that you have received their order, and are waiting for the payment to be completed.  You will receive the final result of the payment in an AUTHORISATION webhook.\n\n\nPresentToShopper\nPresent the voucher or the QR code to the shopper.\nFor a voucher payment method, inform the shopper that you are waiting for their payment. You will receive the final result of the payment in an AUTHORISATION webhook.   For a qrCode payment method, wait for the AUTHORISATION webhook before presenting the payment result to the shopper.\n\n\nRefused\nThe payment was refused.\nInform the shopper that the payment was refused. Ask the shopper to try the payment again using a different payment method or card.\n\n\nReceived\nFor some payment methods, it can take some time before the final status of the payment is known.\nInform the shopper that you have received their order, and are waiting for the payment to clear.  You will receive the final result of the payment in an AUTHORISATION webhook.\n\n\n\nFor other possible resultCode values and recommended messages that you can present to your shopper, see Result codes.","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Plugins","lvl2":"Shopware 6","lvl3":"Headless integration"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/plugins","lvl2":"https:\/\/docs.adyen.com\/pt\/plugins\/shopware-6","lvl3":"\/pt\/plugins\/shopware-6\/headless-integration"},"levels":4,"category":"Plugins","category_color":"green","tags":["Headless","integration"]}}
