{"title":"Amazon Pay Component","category":"default","creationDate":1778842589,"content":"<p>Our Amazon Pay Web Component allows you to offer Amazon Pay in your checkout flow. When clicking the Amazon Pay button, the component redirects the shopper to an Amazon Pay hosted page where they select the details of the purchase before reviewing and confirming the order on your website.<\/p>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that you have built your <a href=\"\/online-payments\/build-your-integration\">Web Components integration<\/a>.  <\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Before you begin, <a href=\"\/payment-methods\/add-payment-methods\">add Amazon Pay in your test Customer Area<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"step-1\">Register for Amazon Pay<\/h2>\n<p>Sign up for a merchant account on the Amazon Pay website. After the registration is complete, return to this page. Select the correct region for your account from the list below.<\/p>\n<ul>\n<li><a href=\"https:\/\/pay.amazon.eu\/signup\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">EU Registration<\/a> \u2014 For merchants with a legal entity in one of the following locations: Austria, Belgium, Cyprus, Denmark, France, Germany, Hungary, Ireland, Italy, Luxembourg, the Netherlands, Portugal, Spain, Sweden, or Switzerland. Select EUR as a currency in the registration page.<\/li>\n<li><a href=\"https:\/\/pay.amazon.co.uk\/signup\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">UK Registration<\/a> \u2014 For merchants with a legal entity in the United Kingdom.<\/li>\n<li><a href=\"https:\/\/pay.amazon.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">US Registration<\/a> - For merchants with a legal entity in the United States.<\/li>\n<\/ul>\n<h2 id=\"step-2\">Create an Amazon Pay Sandbox test buyer account<\/h2>\n<p>Use Sandbox to conduct end-to-end tests of your integration before going live. For details, see <a href=\"https:\/\/developer.amazon.com\/docs\/amazon-pay-checkout\/amazon-pay-sandbox-accounts.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Amazon Pay Sandbox accounts<\/a>. After creating an Amazon Pay Sandbox account, return to this page.<\/p>\n<h2 id=\"step-3\">Get your PublicKeyId and give information to Adyen<\/h2>\n<p>Amazon Pay uses asymmetric encryption to secure communication. Therefore, you need a public\/private key pair.<\/p>\n<p>To set this up, you must have one of the following <a href=\"\/account\/user-roles\">user roles<\/a>.<\/p>\n<ul>\n<li>Merchant admin<\/li>\n<li>Manage API Credentials<\/li>\n<\/ul>\n<ol>\n<li>Log in to your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a> and select the merchant account you want to set up Amazon Pay for.<\/li>\n<li>Select <strong>Developers<\/strong> &gt; <strong>API credentials<\/strong>. Select the <a href=\"\/development-resources\/api-credentials?query=Web%2Bservice%2Buser#new-credential\">web service user<\/a> that you will use for Amazon Pay transactions.<\/li>\n<li>In <strong>Wallet payment methods<\/strong> &gt; <strong>Amazon Pay certificate<\/strong>, select <strong>+ Add<\/strong>.<\/li>\n<li>Select <strong>Generate key pair<\/strong>.<\/li>\n<li>Copy the the public key and send it to your Amazon Pay contact.<\/li>\n<li>Receive the <code>publicKeyId<\/code> from your Amazon Pay contact.<\/li>\n<li>Send the following to 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>:\n<ul>\n<li><code>publicKeyId<\/code><\/li>\n<li><code>amazonMerchantId<\/code>: You can find this in your Amazon Seller Central or ask your Amazon Pay contact for it.<\/li>\n<li><code>amazonStoreId<\/code>: You can find this in your Amazon Seller Central or ask your Amazon Pay contact for it.<br \/>\nWe configure Amazon Pay for you after receiving your information.<\/li>\n<\/ul><\/li>\n<\/ol>\n<div class=\"notices blue\">\n<p>Your Amazon <code>publicKeyId<\/code> is unique to a single web service user. You cannot use the same <code>publicKeyId<\/code> for multiple web service users.<\/p>\n<\/div>\n<h2>Show Amazon Pay in your payment page<\/h2>\n<p>To show Amazon Pay Component on your payment page, proceed with the following steps:<\/p>\n<ol>\n<li>\n<p>Create a DOM element for Amazon Pay, placing it where you want the button to be rendered:<\/p>\n<pre><code class=\"language-html\">&lt;div id=\"amazonpay_button-container\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<\/li>\n<li>\n<p>Create an instance of the Amazon Pay Component, specifying the following parameters:<\/p>\n<\/li>\n<\/ol>\n<table>\n<thead>\n<tr>\n<th><strong>Parameter<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<th><strong>Default<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>buttonColor<\/code><\/td>\n<td>Color of the Amazon Pay button. Supported values: <strong>Gold<\/strong>, <strong>LightGray<\/strong>, and <strong>DarkGray<\/strong>.<\/td>\n<td><strong>Gold<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>deliverySpecifications<\/code><\/td>\n<td>Use the <code>deliverySpecifications<\/code> parameter to specify shipping restrictions for your shop, and prevent buyers from selecting unsupported addresses from their Amazon address book. See <a href=\"https:\/\/developer.amazon.com\/docs\/amazon-pay-checkout\/address-restriction-samples.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">address restriction samples<\/a> for examples of common use cases. Do not set this parameter if you are selling digital goods. In this case, set the <code>productType<\/code> parameter to <strong>PayOnly<\/strong>.<\/td>\n<td><strong>{}<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>environment<\/code><\/td>\n<td><div data-component-wrapper=\"tag\">\n    <tag :variant=&quot;success&quot;>\n        required\n    <\/tag>\n<\/div>\n Set to <strong>test<\/strong>. Change this to <strong>live<\/strong> when you are ready to accept live payments.<\/td>\n<td><strong>test<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>locale<\/code><\/td>\n<td>Language used to render the button and text on Amazon Pay hosted pages. Please note that supported language(s) is dependent on the region that your Amazon Pay account was registered for. Supported values: <strong>en_GB<\/strong>, <strong>de_DE<\/strong>, <strong>fr_FR<\/strong>, <strong>it_IT<\/strong>, <strong>es_ES<\/strong>.<\/td>\n<td><strong>en_GB<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>merchantId<\/code><\/td>\n<td>Amazon Pay merchant account identifier.<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><code>placement<\/code><\/td>\n<td>Placement of the Amazon Pay button on your website. Supported values: <strong>Home<\/strong>, <strong>Product<\/strong>, <strong>Cart<\/strong>, <strong>Checkout<\/strong>, <strong>Other<\/strong>.<\/td>\n<td><strong>Cart<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>productType<\/code><\/td>\n<td>Product type selected for checkout. Supported values:<br> <strong>PayAndShip<\/strong> \u2014 Offer checkout using the shopper's Amazon wallet and address book. Select this product type if you sell physical goods that you ship to the address associated with the shopper's Amazon account.<br><strong>PayOnly<\/strong> \u2014 Offer checkout using only the shopper's Amazon wallet. Select this product type if you do not need the shopper's shipping details, as you are selling digital goods.<\/td>\n<td><strong>PayAndShip<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>publicKeyId<\/code><\/td>\n<td>The <code>publicKeyId<\/code> from <a href=\"#step-3\">Step 3<\/a>.<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><code>returnUrl<\/code><\/td>\n<td><div data-component-wrapper=\"tag\">\n    <tag :variant=&quot;success&quot;>\n        required\n    <\/tag>\n<\/div>\n The URL where the shopper will be redirected back to after they complete the selection of details from the Amazon hosted page.<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><code>storeId<\/code><\/td>\n<td>Retrieve this value from Amazon Pay <a href=\"https:\/\/sellercentral-europe.amazon.com\/external-payments\/amazon-pay\/integration-central\/lwa\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Integration Central<\/a>.<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><code>chargePermissionType<\/code><\/td>\n<td>The type of charge permission requested. Supported values:<br><strong>OneTime<\/strong> \u2014 for a single payment.<br><strong>Recurring<\/strong> \u2014 for recurring payments.<\/td>\n<td><strong>OneTime<\/strong><\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/developer.amazon.com\/docs\/amazon-pay-api-v2\/checkout-session.html#type-recurringmetadata\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>recurringMetadata<\/code>\n<\/a><\/td>\n<td>How often the shopper will be charged using a recurring charge permission, for example monthly or yearly. Required for payments with <code>chargePermissionType<\/code> <strong>Recurring<\/strong>. Specify a frequency even if you expect ad hoc charges. See <a href=\"https:\/\/developer.amazon.com\/docs\/amazon-pay-api-v2\/checkout-session.html#type-recurringmetadatafor\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Amazon Pay documentation<\/a> more information.<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Here's an example of the Amazon Pay component instance:<\/p>\n<pre><code class=\"language-js\">  const amazonPayComponent = checkout\n      .create('amazonpay', {\n          \/\/ Returned in the `\/paymentMethods` response\n          configuration: {\n              merchantId: 'YOUR_MERCHANT_ID',\n              publicKeyId: 'YOUR_PUBLIC_KEY',\n              storeId: '...'\n          },\n          chargePermissionType: 'Recurring', \/\/ For a recurring payment\n          recurringMetadata: { \/\/ For a payment that happens once a month\n            frequency: {\n              unit: 'Month',\n              value: '1'\n            }\n          },\n          currency: 'EUR',\n          environment: 'test',\n          returnUrl: 'https:\/\/example.com\/review_order'\n      })\n      .mount('#amazonpay_button-container');<\/code><\/pre>\n<p>This shows the Amazon Pay button. The button is responsive and inherits the size of the container element. For more information about how to render and resize the Amazon Pay component refer to the <a href=\"https:\/\/developer.amazon.com\/docs\/amazon-pay-checkout\/add-the-amazon-pay-button.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Amazon Pay documentation<\/a>.<\/p>\n<p>When the shopper clicks the Amazon Pay button, they are redirected to the Amazon website to log in and select the shipping and payment details.<\/p>\n<h2 id=\"handle-the-redirect\">Handle the first redirect<\/h2>\n<p>The shopper will be redirected back to the <code>returnUrl<\/code> with the <code>amazonCheckoutSessionId<\/code> attached to the URL. The <code>returnUrl<\/code> should point to the order review page where the shopper can review the details selected from the Amazon account, and finalize the purchase. Use the <code>amazonCheckoutSessionId<\/code> to create a new instance of the Amazon Pay component to retrieve shopper details and create an order.<\/p>\n<ol>\n<li>\n<p>Create a DOM element for the <strong>Confirm purchase<\/strong> button, placing it where you want it to be rendered:<\/p>\n<pre><code class=\"language-html\">&lt;div id=\"amazonpay_order-container\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<\/li>\n<li>\n<p>Create an instance of the Amazon Pay component, and this time pass the <code>amazonCheckoutSessionId<\/code> along with the <code>amount<\/code> object and a <code>returnUrl<\/code>.<\/p>\n<p>The <code>returnUrl<\/code> set at this step should bring the shopper to the page where the logic to execute the payment will take place. This <code>returnUrl<\/code> should be different from the one used at the previous step.<\/p>\n<p>Optionally, you can also show a button to go back and change the selected payment details by setting <code>showChangePaymentDetailsButton<\/code> to <code>true<\/code>.<\/p>\n<pre><code class=\"language-js\">const amazonPayComponent = checkout\n  .create('amazonpay', {\n      amount: {\n          currency: 'EUR',\n          value: 1000\n      },\n      amazonCheckoutSessionId: '...',\n      returnUrl: 'https:\/\/example.com\/process_payment',\n      showChangePaymentDetailsButton: true \/\/ Optional\n  })\n  .mount('#amazonpay_order-container');<\/code><\/pre>\n<\/li>\n<li>\n<p>Get the shopper details by calling the <code>getShopperDetails<\/code> method from the Component. Use shopper details such as email address, name, shipping address and billing address to populate your order review page, as shown in the Amazon Pay documentation for <a href=\"https:\/\/developer.amazon.com\/docs\/amazon-pay-checkout\/display-shipping-payment-info.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">display shipping and payment info<\/a>.<\/p>\n<pre><code class=\"language-js\">amazonPayComponent.getShopperDetails()\n  .then(details =&gt; {\n      \/\/ Show shopper details\n  });<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>When the shopper reviews the order and clicks the <strong>Order<\/strong> button, there is a second redirect to Amazon to update the checkout session state and enable the payment step.<\/p>\n<h2>Handle the second redirect<\/h2>\n<p>The shopper is now redirected back to the <code>returnUrl<\/code> with the <code>amazonCheckoutSessionId<\/code> again attached to the URL. Use the <code>amazonCheckoutSessionId<\/code> once again to create a new instance of the Amazon Pay component to <a href=\"#make-a-payment\">make the payment<\/a>.<\/p>\n<ol>\n<li>\n<p>Create a DOM element for the component, placing it where you want it to be rendered. At this point of the flow, the Component doesn't show anything. This page executes the logic of the payment and handles any additional buyer interaction. The Component uses this node, for example, in case a 3D Secure 2 challenge needs to be displayed.<\/p>\n<pre><code class=\"language-html\">&lt;div id=\"amazonpay_payment-container\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<\/li>\n<li>\n<p>Define a <code>handleOnSubmit<\/code> function to be passed to the Component configuration object as value for the <code>onSubmit<\/code> parameter. The function should accept the <code>state.data<\/code> object from the Component as an input, and trigger the backend function you define which executes 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> API call.<\/p>\n<pre><code class=\"language-js\">onSubmit: (state, component) =&gt; {\n  component.setStatus('loading');\n\n  \/\/ Merchant's function to make a payment\n  return makePayment(state.data)\n      .then(response =&gt; {\n          component.setStatus('ready');\n          if (response.action) {\n              \/\/ Handle additional action (3D Secure \/ redirect \/ other)\n              component.handleAction(response.action);\n          } else {\n              \/\/ The merchant's function to show the final result or redirect to a final status page\n              handleFinalResult(response);\n          }\n      })\n      .catch(error =&gt; {\n          \/\/ Handle error;\n      });\n}<\/code><\/pre>\n<\/li>\n<li>\n<p>Create an instance of the Amazon Pay Component and pass the <code>amazonCheckoutSessionId<\/code>. This time, hide the <strong>Order<\/strong> button. After the Component is mounted, trigger the <code>submit<\/code> function which should be defined in the Adyen Checkout constructor.<\/p>\n<pre><code class=\"language-js\">const amazonPayComponent = checkout\n  .create('amazonpay', {\n      amazonCheckoutSessionId: '...',\n      showOrderButton: false\n  })\n  .mount('#amazonpay_payment-container');\n\namazonPayOrder.submit();<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>This will call the <code>onSubmit<\/code> event, which contains a <code>state.data<\/code> object. Pass the object to the server to <a href=\"#make-a-payment\">make a payment<\/a> and parse the result of the payment.<\/p>\n<h2 id=\"make-a-payment\">Make a payment<\/h2>\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 the following parameters:<\/p>\n<ul>\n<li><code>paymentMethod<\/code>: The <code>state.data.paymentMethod<\/code> from the <code>onSubmit<\/code> event from your front end.<\/li>\n<li><code>returnUrl<\/code>:\u00a0The URL where the shopper will be redirected back to after completing the payment. The URL should include the protocol: <code>http:\/\/<\/code> or <code>https:\/\/<\/code>. For example, <code>https:\/\/your-company.example.com\/checkout\/<\/code>. You can also include your own additional query parameters, for example, shopper ID or order reference number.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"''\" :id=\"'amazonpay-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\\\/v68\\\/payments \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot;: 1000\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;amazonpay\\&quot;\\n  },\\n  \\&quot;returnUrl\\&quot;: \\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;,\\n  \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v27.0.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, additionally include your liveEndpointUrlPrefix.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount()\\n  .currency(\\&quot;EUR\\&quot;)\\n  .value(1000L);\\n\\nAmazonPayDetails amazonPayDetails = new AmazonPayDetails()\\n  .type(AmazonPayDetails.TypeEnum.AMAZONPAY);\\n\\nPaymentRequest paymentRequest = new PaymentRequest()\\n  .reference(\\&quot;YOUR_ORDER_NUMBER\\&quot;)\\n  .amount(amount)\\n  .merchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  .paymentMethod(new CheckoutPaymentMethod(amazonPayDetails))\\n  .returnUrl(\\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;);\\n\\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;\\\/\\\/ Adyen PHP API Library v19.0.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\Checkout\\\\Amount;\\nuse Adyen\\\\Model\\\\Checkout\\\\CheckoutPaymentMethod;\\nuse Adyen\\\\Model\\\\Checkout\\\\PaymentRequest;\\nuse Adyen\\\\Service\\\\Checkout\\\\PaymentsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$amount = new Amount();\\n$amount\\n  -&gt;setCurrency(\\&quot;EUR\\&quot;)\\n  -&gt;setValue(1000);\\n\\n$checkoutPaymentMethod = new CheckoutPaymentMethod();\\n$checkoutPaymentMethod\\n  -&gt;setType(\\&quot;amazonpay\\&quot;);\\n\\n$paymentRequest = new PaymentRequest();\\n$paymentRequest\\n  -&gt;setReference(\\&quot;YOUR_ORDER_NUMBER\\&quot;)\\n  -&gt;setAmount($amount)\\n  -&gt;setMerchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  -&gt;setPaymentMethod($checkoutPaymentMethod)\\n  -&gt;setReturnUrl(\\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;);\\n\\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 v17.0.0\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.Checkout;\\nusing Adyen.Service.Checkout;\\n\\n\\\/\\\/ For the live environment, additionally 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)\\nAmount amount = new Amount\\n{\\n  Currency = \\&quot;EUR\\&quot;,\\n  Value = 1000\\n};\\n\\nAmazonPayDetails amazonPayDetails = new AmazonPayDetails\\n{\\n  Type = AmazonPayDetails.TypeEnum.Amazonpay\\n};\\n\\nPaymentRequest paymentRequest = new PaymentRequest\\n{\\n  Reference = \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount = amount,\\n  MerchantAccount = \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  PaymentMethod = new CheckoutPaymentMethod(amazonPayDetails),\\n  ReturnUrl = \\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;\\n};\\n\\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 v18.0.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst paymentRequest = {\\n  amount: {\\n    currency: \\&quot;EUR\\&quot;,\\n    value: 1000\\n  },\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  paymentMethod: {\\n    type: \\&quot;amazonpay\\&quot;\\n  },\\n  returnUrl: \\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;,\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&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 v10.4.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/checkout\\&quot;\\n)\\n\\\/\\\/ For the live environment, additionally 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)\\namount := checkout.Amount{\\n  Currency: \\&quot;EUR\\&quot;,\\n  Value: 1000,\\n}\\n\\namazonPayDetails := checkout.AmazonPayDetails{\\n  Type: common.PtrString(\\&quot;amazonpay\\&quot;),\\n}\\n\\npaymentRequest := checkout.PaymentRequest{\\n  Reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount: amount,\\n  MerchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  PaymentMethod: checkout.AmazonPayDetailsAsCheckoutPaymentMethod(&amp;amazonPayDetails),\\n  ReturnUrl: \\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;,\\n}\\n\\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 v12.5.1\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\n# For the live environment, additionally 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;amount\\&quot;: {\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot;: 1000\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;amazonpay\\&quot;\\n  },\\n  \\&quot;returnUrl\\&quot;: \\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;,\\n  \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&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 v9.5.1\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :amount =&gt; {\\n    :currency =&gt; 'EUR',\\n    :value =&gt; 1000\\n  },\\n  :reference =&gt; 'YOUR_ORDER_NUMBER',\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'amazonpay'\\n  },\\n  :returnUrl =&gt; 'https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..',\\n  :merchantAccount =&gt; 'ADYEN_MERCHANT_ACCOUNT'\\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 v18.0.0\\n\\\/\\\/ Require the parts of the module you want to use\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst amount: Types.checkout.Amount = {\\n  currency: \\&quot;EUR\\&quot;,\\n  value: 1000\\n};\\n\\nconst amazonPayDetails: Types.checkout.AmazonPayDetails = {\\n  type: Types.checkout.AmazonPayDetails.TypeEnum.Amazonpay\\n};\\n\\nconst paymentRequest: Types.checkout.PaymentRequest = {\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  amount: amount,\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  paymentMethod: amazonPayDetails,\\n  returnUrl: \\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;\\n};\\n\\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  <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 contains:<\/p>\n<ul>\n<li><code>pspReference<\/code>: Adyen's unique reference for the payment.<\/li>\n<li><code>resultCode<\/code>: Authorised<\/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\\\": \\\"Authorised\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h3>Handle the decline flow<\/h3>\n<p>In case of a credit card decline due to card expiration or insufficient funds, redirect the shopper back to the Amazon Pay payment method selection page. You can do this by calling the <code>handleDeclineFlow<\/code> from the Amazon Pay Component.<\/p>\n<p>This flow lets you <a href=\"https:\/\/developer.amazon.com\/docs\/amazon-pay-api-v2\/checkout-session.html?environmentSpecificKeys=true\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">recover from a declined payment<\/a>as described in the Amazon Pay documentation.<\/p>\n<pre><code class=\"language-js\">onSubmit: async (state, component) =&gt; {\n    try {\n        const response = await makePayment(state.data);\n        \/\/ Check the result code\n        if (response.resultCode &amp;&amp; checkPaymentResponse(response.resultCode)) {\n            \/\/ Show successful message\n        } else {\n            \/\/ Handle decline flow\n            amazonPayComponent.handleDeclineFlow();\n        }\n    } catch (error) {\n        \/\/ Fatal error\n    }\n},\nonError: (error) =&gt; {\n    if (error.resultCode) {\n        \/\/ Show payment failed message or start over the flow.\n    } else {\n        \/\/ Fatal error\n    }\n}<\/code><\/pre>\n<h2>Present the payment result<\/h2>\n<p>Use the\u00a0<code>resultCode<\/code> that you received in 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 present the payment result to your shopper.<\/p>\n<p> <\/p>\n<p>The <code>resultCode<\/code> values you can receive for Amazon Pay are:<\/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 has been successful. <br> If you are using <a href=\"\/online-payments\/capture#manual-capture\">manual capture<\/a>, you also need to <a href=\"\/online-payments\/capture\">capture<\/a> the payment.<\/td>\n<\/tr>\n<tr>\n<td><strong>Cancelled<\/strong><\/td>\n<td>The shopper cancelled the payment.<\/td>\n<td>Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.<\/td>\n<\/tr>\n<tr>\n<td><strong>Error<\/strong><\/td>\n<td>There was an error when the payment was being processed. For more information, check the <a href=\"\/development-resources\/refusal-reasons\">\n  <code>refusalReason<\/code>\n<\/a> field.<\/td>\n<td>Inform the shopper that there was an error processing their payment.<\/td>\n<\/tr>\n<tr>\n<td><strong>Refused<\/strong><\/td>\n<td>The payment was refused.  For more information, check the <a href=\"\/development-resources\/refusal-reasons\">\n  <code>refusalReason<\/code>\n<\/a> field.<\/td>\n<td>Redirect the shopper back to the payment page and ask them to try the payment again using a different card. For more information on how to do this, check <a href=\"https:\/\/developer.amazon.com\/docs\/amazon-pay-checkout\/introduction.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Amazon Pay's documentation<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"notices green\">\n<p>Additional <code>resultCode<\/code> values are possible in case of the 3D Secure authentication flow. For more information, refer to <a href=\"\/online-payments\/payment-result-codes\">Result codes<\/a>.<\/p>\n<\/div>\n<p><a id=\"webhooks\"><\/a> If the shopper failed to return to your website or app, wait for webhooks to know the outcome of the payment. The webhooks you can receive for Amazon Pay 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<tr>\n<td><strong>OFFER_CLOSED<\/strong><\/td>\n<td><strong>true<\/strong><\/td>\n<td>The shopper did not complete the payment.<\/td>\n<td>Cancel the order and inform the shopper that the payment timed out.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Optional. Sign out from Amazon<\/h3>\n<p>After the transaction is finished, and the result is shown to the shopper, display a button to let them sign out from the Amazon account.<\/p>\n<ol>\n<li>\n<p>Create a DOM element for the <strong>Sign out<\/strong> button, placing it where you want it to be rendered:<\/p>\n<pre><code class=\"language-html\">&lt;div id=\"amazonpay_signout\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<\/li>\n<li>\n<p>Create an instance of the Amazon Pay Component and pass the <code>amazonCheckoutSessionId<\/code> along with <code>showSignOutButton<\/code> set to <span translate=\"no\"><strong>true<\/strong><\/span>.<\/p>\n<pre><code class=\"language-js\">const amazonPayComponent = checkout\n  .create('amazonpay', {\n      amazonCheckoutSessionId: '...',\n      showSignOutButton: true\n  })\n  .mount('#amazonpay_signout');<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2>Recurring payments<\/h2>\n<p>We support recurring transactions for Amazon Pay. To make recurring payments, you need to:<\/p>\n<ol>\n<li><a href=\"#create-a-token\">Create a shopper token<\/a>.<\/li>\n<li><a href=\"#make-payment-with-token\">Use the token to make future payments for the shopper<\/a>.<\/li>\n<\/ol>\n<h3 id=\"create-a-token\">Create a token<\/h3>\n<p>To create a token, include in your  <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:<\/p>\n<ul>\n<li><code>storePaymentMethod<\/code>: <strong>true<\/strong><\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-shopperReference\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">shopperReference<\/a>&#58; Your unique identifier for the shopper.<\/li>\n<\/ul>\n<p>When the payment has been settled, you receive a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Tokenization-webhooks\/latest\/post\/recurring.token.created\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">recurring.token.created<\/a> <a href=\"\/development-resources\/webhooks\">webhook<\/a> containing:<\/p>\n<ul>\n<li><code>type<\/code>: <strong>recurring.token.created<\/strong><\/li>\n<li><code>shopperReference<\/code>: your unique identifier for the shopper.<\/li>\n<li><code>eventId<\/code>: the <code>pspReference<\/code> of the initial payment.<\/li>\n<li><code>storedPaymentMethodId<\/code>: the token that you need to make recurring payments for this shopper.<\/li>\n<\/ul>\n<div class=\"notices green\">\n<p>Make sure that your server is able to receive the <a href=\"\/development-resources\/webhooks\/webhook-types\/#other-webhooks\">Recurring tokens life cycle events<\/a> webhook. You can <a href=\"\/development-resources\/webhooks\/#set-up-webhooks-in-your-customer-area\">set up this webhook in your Customer Area<\/a>.<\/p>\n<\/div>\n<h3 id=\"make-payment-with-token\">Make a payment with a token<\/h3>\n<p>To make a payment with the token, include in your  <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:<\/p>\n<ul>\n<li>\n<p><code>paymentMethod.storedPaymentMethodId<\/code>: The <code>storedPaymentMethodId<\/code> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Tokenization-webhooks\/latest\/post\/recurring.token.created\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">recurring.token.created<\/a> webhook.<\/p>\n<div class=\"notices green\">\n<p>You can also get this value using the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Recurring\/latest\/post\/listRecurringDetails\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/listRecurringDetails<\/a> endpoint.<\/p>\n<\/div>\n<\/li>\n<li>\n<p><code>shopperReference<\/code>: The unique shopper identifier that you specified when creating the token.<\/p>\n<\/li>\n<li>\n<p><code>shopperInteraction<\/code>:\u00a0<strong>ContAuth<\/strong>.<\/p>\n<\/li>\n<li>\n<p><code>recurringProcessingModel<\/code>: <strong>Subscription<\/strong> or <strong>UnscheduledCardOnFile<\/strong>.<\/p>\n<\/li>\n<\/ul>\n<p>For more information about the <code>shopperInteraction<\/code> and <code>recurringProcessingModel<\/code> fields, refer to <a href=\"\/online-payments\/tokenization\/\">Tokenization<\/a>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"''\" :id=\"'recurring-amazonpay'\" :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;amount\\&quot;:{\\n          \\&quot;value\\&quot;:1000,\\n          \\&quot;currency\\&quot;:\\&quot;EUR\\&quot;\\n       },\\n       \\&quot;paymentMethod\\&quot;:{\\n          \\&quot;type\\&quot;:\\&quot;amazonpay\\&quot;,\\n          \\&quot;storedPaymentMethodId\\&quot;:\\&quot;7219687191761347\\&quot;\\n       },\\n       \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n       \\&quot;merchantAccount\\&quot;:\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n       \\&quot;shopperReference\\&quot;:\\&quot;YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\\&quot;,\\n       \\&quot;shopperInteraction\\&quot;:\\&quot;ContAuth\\&quot;,\\n       \\&quot;recurringProcessingModel\\&quot;: \\&quot;Subscription\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Set ADYEN_API_KEY with the API key from the Customer Area.\\n\\\/\\\/ Change to Environment.LIVE and add the Live URL prefix when you are ready to accept live payments.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\nCheckout checkout = new Checkout(client);\\n\\nPaymentsRequest paymentsRequest = new PaymentsRequest();\\n\\nString merchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;;\\npaymentsRequest.setMerchantAccount(merchantAccount);\\n\\nAmount amount = new Amount();\\namount.setCurrency(\\&quot;EUR\\&quot;);\\namount.setValue(15000L);\\npaymentsRequest.setAmount(amount);\\n\\nDefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails();\\npaymentMethodDetails.setRecurringDetailReference(\\&quot;7219687191761347\\&quot;);\\npaymentMethodDetails.setType(\\&quot;amazonpay\\&quot;);\\npaymentsRequest.setPaymentMethod(paymentMethodDetails);\\n\\npaymentsRequest.setReference(\\&quot;YOUR_ORDER_NUMBER\\&quot;);\\npaymentsRequest.setReturnUrl(\\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;);\\npaymentsRequest.setShopperInteraction(\\&quot;ContAuth\\&quot;);\\npaymentsRequest.setRecurringProcessingModel(\\&quot;Subscription\\&quot;);\\n\\nPaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;\\\/\\\/ Set your X-API-KEY with the API key from the Customer Area.\\n$client = new \\\\Adyen\\\\Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n$service = new \\\\Adyen\\\\Service\\\\Checkout($client);\\n\\n$params = array(\\n  \\&quot;amount\\&quot; =&gt; array(\\n    \\&quot;currency\\&quot; =&gt; \\&quot;EUR\\&quot;,\\n    \\&quot;value\\&quot; =&gt; 1000\\n  ),\\n  \\&quot;reference\\&quot; =&gt; \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;paymentMethod\\&quot; =&gt; array(\\n    \\&quot;type\\&quot; =&gt; \\&quot;amazonpay\\&quot;,\\n    \\&quot;storedPaymentMethodId\\&quot; =&gt; \\&quot;7219687191761347\\&quot;\\n  ),\\n  \\&quot;returnUrl\\&quot; =&gt; \\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;,\\n  \\&quot;shopperReference\\&quot; =&gt; \\&quot;YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\\&quot;,\\n  \\&quot;recurringProcessingModel\\&quot; =&gt; \\&quot;Subscription\\&quot;,\\n  \\&quot;shopperInteraction\\&quot; =&gt; \\&quot;ContAuth\\&quot;,\\n  \\&quot;merchantAccount\\&quot; =&gt; \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;\\n);\\n$result = $service-&gt;payments($params);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Set your X-API-KEY with the API key from the Customer Area.\\nvar client = new Client (\\&quot;ADYEN_API_KEY\\&quot;, Environment.Test);\\nvar checkout = new Checkout(client);\\n\\nvar amount = new Adyen.Model.Checkout.Amount(\\&quot;EUR\\&quot;, 1000);\\nvar details = new Adyen.Model.Checkout.DefaultPaymentMethodDetails{\\n  Type = \\&quot;amazonpay\\&quot;,\\n  StoredPaymentMethodId = \\&quot;7219687191761347\\&quot;\\n};\\nvar paymentsRequest = new Adyen.Model.Checkout.PaymentRequest\\n{\\n  Reference = \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount = amount,\\n  ReturnUrl = @\\&quot;https:\\\/\\\/your-company.example.com\\\/checkout?shopperOrder=12xy..\\&quot;,\\n  MerchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  ShopperReference = \\&quot;YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\\&quot;,\\n  RecurringProcessingModel = Adyen.Model.Checkout.PaymentRequest.RecurringProcessingModelEnum.Subscription,\\n  ShopperInteraction = Adyen.Model.Checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,\\n  PaymentMethod = details\\n};\\n\\nvar paymentResponse = checkout.Payments(paymentsRequest);&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v16.1.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\n\\\/\\\/ Initialize the client object\\nconst client = new Client({apiKey: \\&quot;YOUR_X_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object\\nconst paymentRequest = {\\n  amount: {\\n    value: 1000,\\n    currency: \\&quot;EUR\\&quot;\\n  },\\n  paymentMethod: {\\n    type: \\&quot;amazonpay\\&quot;,\\n    storedPaymentMethodId: \\&quot;7219687191761347\\&quot;\\n  },\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  shopperReference: \\&quot;YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\\&quot;,\\n  shopperInteraction: \\&quot;ContAuth\\&quot;,\\n  recurringProcessingModel: \\&quot;Subscription\\&quot;\\n}\\n\\n\\\/\\\/ Make the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v12.0.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;YOUR_X_API_KEY\\&quot;\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\njson_request = {\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;value\\&quot;: 1000,\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;amazonpay\\&quot;,\\n    \\&quot;storedPaymentMethodId\\&quot;: \\&quot;7219687191761347\\&quot;\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;shopperReference\\&quot;: \\&quot;YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\\&quot;,\\n  \\&quot;shopperInteraction\\&quot;: \\&quot;ContAuth\\&quot;,\\n  \\&quot;recurringProcessingModel\\&quot;: \\&quot;Subscription\\&quot;\\n}\\n\\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 v9.1.0\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'YOUR_X_API_KEY'\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\nrequest_body = {\\n  :amount =&gt; {\\n    :value =&gt; 1000,\\n    :currency =&gt; 'EUR'\\n  },\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'amazonpay',\\n    :storedPaymentMethodId =&gt; '7219687191761347'\\n  },\\n  :reference =&gt; 'YOUR_ORDER_NUMBER',\\n  :merchantAccount =&gt; 'YOUR_MERCHANT_ACCOUNT',\\n  :shopperReference =&gt; 'YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j',\\n  :shopperInteraction =&gt; 'ContAuth',\\n  :recurringProcessingModel =&gt; 'Subscription'\\n}\\n\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>To test Amazon Pay, you must follow the <a href=\"https:\/\/developer.amazon.com\/docs\/amazon-pay-checkout\/test-your-integration.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Amazon Pay testing guidelines<\/a>.<\/p>\n<p>You can check the status of an Amazon Pay test payment in your\u00a0<a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>\u00a0&gt;\u00a0<strong>Transactions<\/strong>\u00a0&gt;\u00a0<strong>Payments<\/strong>.<\/p>\n<p> <\/p>\n<p>Before you can accept live Amazon Pay payments, you need to <a href=\"\/payment-methods\/add-payment-methods\">submit a request for Amazon Pay<\/a> in your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live Customer Area<\/a>.<\/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\/components-web\"\n                        target=\"_self\"\n                        >\n                    Web Components integration guide\n                <\/a><\/li><li><a href=\"\/development-resources\/error-codes#amazon-pay-error-codes\"\n                        target=\"_self\"\n                        >\n                    Amazon Pay error codes\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/payment-methods\/amazon-pay\/web-component","articleFields":{"description":"Add Amazon Pay to an existing Components integration.","feedback_component":true,"parameters":{"payment_method":"Amazon Pay","payment_method_type":"amazonpay","component_class":"AmazonPay","integration":"Components","platform":"Web","currency_code":"EUR"},"last_edit_on":"03-03-2021 15:39"},"algolia":{"url":"https:\/\/docs.adyen.com\/payment-methods\/amazon-pay\/web-component","title":"Amazon Pay Component","content":"Our Amazon Pay Web Component allows you to offer Amazon Pay in your checkout flow. When clicking the Amazon Pay button, the component redirects the shopper to an Amazon Pay hosted page where they select the details of the purchase before reviewing and confirming the order on your website.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have built your Web Components integration.  \n\n\nSetup steps\nBefore you begin, add Amazon Pay in your test Customer Area.\n\n\n\nRegister for Amazon Pay\nSign up for a merchant account on the Amazon Pay website. After the registration is complete, return to this page. Select the correct region for your account from the list below.\n\nEU Registration \u2014 For merchants with a legal entity in one of the following locations: Austria, Belgium, Cyprus, Denmark, France, Germany, Hungary, Ireland, Italy, Luxembourg, the Netherlands, Portugal, Spain, Sweden, or Switzerland. Select EUR as a currency in the registration page.\nUK Registration \u2014 For merchants with a legal entity in the United Kingdom.\nUS Registration - For merchants with a legal entity in the United States.\n\nCreate an Amazon Pay Sandbox test buyer account\nUse Sandbox to conduct end-to-end tests of your integration before going live. For details, see Amazon Pay Sandbox accounts. After creating an Amazon Pay Sandbox account, return to this page.\nGet your PublicKeyId and give information to Adyen\nAmazon Pay uses asymmetric encryption to secure communication. Therefore, you need a public\/private key pair.\nTo set this up, you must have one of the following user roles.\n\nMerchant admin\nManage API Credentials\n\n\nLog in to your Customer Area and select the merchant account you want to set up Amazon Pay for.\nSelect Developers &gt; API credentials. Select the web service user that you will use for Amazon Pay transactions.\nIn Wallet payment methods &gt; Amazon Pay certificate, select + Add.\nSelect Generate key pair.\nCopy the the public key and send it to your Amazon Pay contact.\nReceive the publicKeyId from your Amazon Pay contact.\nSend the following to our Support Team:\n\npublicKeyId\namazonMerchantId: You can find this in your Amazon Seller Central or ask your Amazon Pay contact for it.\namazonStoreId: You can find this in your Amazon Seller Central or ask your Amazon Pay contact for it.\nWe configure Amazon Pay for you after receiving your information.\n\n\n\nYour Amazon publicKeyId is unique to a single web service user. You cannot use the same publicKeyId for multiple web service users.\n\nShow Amazon Pay in your payment page\nTo show Amazon Pay Component on your payment page, proceed with the following steps:\n\n\nCreate a DOM element for Amazon Pay, placing it where you want the button to be rendered:\n&lt;div id=\"amazonpay_button-container\"&gt;&lt;\/div&gt;\n\n\nCreate an instance of the Amazon Pay Component, specifying the following parameters:\n\n\n\n\n\nParameter\nDescription\nDefault\n\n\n\n\nbuttonColor\nColor of the Amazon Pay button. Supported values: Gold, LightGray, and DarkGray.\nGold\n\n\ndeliverySpecifications\nUse the deliverySpecifications parameter to specify shipping restrictions for your shop, and prevent buyers from selecting unsupported addresses from their Amazon address book. See address restriction samples for examples of common use cases. Do not set this parameter if you are selling digital goods. In this case, set the productType parameter to PayOnly.\n{}\n\n\nenvironment\n\n    \n        required\n    \n\n Set to test. Change this to live when you are ready to accept live payments.\ntest\n\n\nlocale\nLanguage used to render the button and text on Amazon Pay hosted pages. Please note that supported language(s) is dependent on the region that your Amazon Pay account was registered for. Supported values: en_GB, de_DE, fr_FR, it_IT, es_ES.\nen_GB\n\n\nmerchantId\nAmazon Pay merchant account identifier.\n\n\n\nplacement\nPlacement of the Amazon Pay button on your website. Supported values: Home, Product, Cart, Checkout, Other.\nCart\n\n\nproductType\nProduct type selected for checkout. Supported values: PayAndShip \u2014 Offer checkout using the shopper's Amazon wallet and address book. Select this product type if you sell physical goods that you ship to the address associated with the shopper's Amazon account.PayOnly \u2014 Offer checkout using only the shopper's Amazon wallet. Select this product type if you do not need the shopper's shipping details, as you are selling digital goods.\nPayAndShip\n\n\npublicKeyId\nThe publicKeyId from Step 3.\n\n\n\nreturnUrl\n\n    \n        required\n    \n\n The URL where the shopper will be redirected back to after they complete the selection of details from the Amazon hosted page.\n\n\n\nstoreId\nRetrieve this value from Amazon Pay Integration Central.\n\n\n\nchargePermissionType\nThe type of charge permission requested. Supported values:OneTime \u2014 for a single payment.Recurring \u2014 for recurring payments.\nOneTime\n\n\n\n  recurringMetadata\n\nHow often the shopper will be charged using a recurring charge permission, for example monthly or yearly. Required for payments with chargePermissionType Recurring. Specify a frequency even if you expect ad hoc charges. See Amazon Pay documentation more information.\n\n\n\n\nHere's an example of the Amazon Pay component instance:\n  const amazonPayComponent = checkout\n      .create('amazonpay', {\n          \/\/ Returned in the `\/paymentMethods` response\n          configuration: {\n              merchantId: 'YOUR_MERCHANT_ID',\n              publicKeyId: 'YOUR_PUBLIC_KEY',\n              storeId: '...'\n          },\n          chargePermissionType: 'Recurring', \/\/ For a recurring payment\n          recurringMetadata: { \/\/ For a payment that happens once a month\n            frequency: {\n              unit: 'Month',\n              value: '1'\n            }\n          },\n          currency: 'EUR',\n          environment: 'test',\n          returnUrl: 'https:\/\/example.com\/review_order'\n      })\n      .mount('#amazonpay_button-container');\nThis shows the Amazon Pay button. The button is responsive and inherits the size of the container element. For more information about how to render and resize the Amazon Pay component refer to the Amazon Pay documentation.\nWhen the shopper clicks the Amazon Pay button, they are redirected to the Amazon website to log in and select the shipping and payment details.\nHandle the first redirect\nThe shopper will be redirected back to the returnUrl with the amazonCheckoutSessionId attached to the URL. The returnUrl should point to the order review page where the shopper can review the details selected from the Amazon account, and finalize the purchase. Use the amazonCheckoutSessionId to create a new instance of the Amazon Pay component to retrieve shopper details and create an order.\n\n\nCreate a DOM element for the Confirm purchase button, placing it where you want it to be rendered:\n&lt;div id=\"amazonpay_order-container\"&gt;&lt;\/div&gt;\n\n\nCreate an instance of the Amazon Pay component, and this time pass the amazonCheckoutSessionId along with the amount object and a returnUrl.\nThe returnUrl set at this step should bring the shopper to the page where the logic to execute the payment will take place. This returnUrl should be different from the one used at the previous step.\nOptionally, you can also show a button to go back and change the selected payment details by setting showChangePaymentDetailsButton to true.\nconst amazonPayComponent = checkout\n  .create('amazonpay', {\n      amount: {\n          currency: 'EUR',\n          value: 1000\n      },\n      amazonCheckoutSessionId: '...',\n      returnUrl: 'https:\/\/example.com\/process_payment',\n      showChangePaymentDetailsButton: true \/\/ Optional\n  })\n  .mount('#amazonpay_order-container');\n\n\nGet the shopper details by calling the getShopperDetails method from the Component. Use shopper details such as email address, name, shipping address and billing address to populate your order review page, as shown in the Amazon Pay documentation for display shipping and payment info.\namazonPayComponent.getShopperDetails()\n  .then(details =&gt; {\n      \/\/ Show shopper details\n  });\n\n\nWhen the shopper reviews the order and clicks the Order button, there is a second redirect to Amazon to update the checkout session state and enable the payment step.\nHandle the second redirect\nThe shopper is now redirected back to the returnUrl with the amazonCheckoutSessionId again attached to the URL. Use the amazonCheckoutSessionId once again to create a new instance of the Amazon Pay component to make the payment.\n\n\nCreate a DOM element for the component, placing it where you want it to be rendered. At this point of the flow, the Component doesn't show anything. This page executes the logic of the payment and handles any additional buyer interaction. The Component uses this node, for example, in case a 3D Secure 2 challenge needs to be displayed.\n&lt;div id=\"amazonpay_payment-container\"&gt;&lt;\/div&gt;\n\n\nDefine a handleOnSubmit function to be passed to the Component configuration object as value for the onSubmit parameter. The function should accept the state.data object from the Component as an input, and trigger the backend function you define which executes the  \/payments API call.\nonSubmit: (state, component) =&gt; {\n  component.setStatus('loading');\n\n  \/\/ Merchant's function to make a payment\n  return makePayment(state.data)\n      .then(response =&gt; {\n          component.setStatus('ready');\n          if (response.action) {\n              \/\/ Handle additional action (3D Secure \/ redirect \/ other)\n              component.handleAction(response.action);\n          } else {\n              \/\/ The merchant's function to show the final result or redirect to a final status page\n              handleFinalResult(response);\n          }\n      })\n      .catch(error =&gt; {\n          \/\/ Handle error;\n      });\n}\n\n\nCreate an instance of the Amazon Pay Component and pass the amazonCheckoutSessionId. This time, hide the Order button. After the Component is mounted, trigger the submit function which should be defined in the Adyen Checkout constructor.\nconst amazonPayComponent = checkout\n  .create('amazonpay', {\n      amazonCheckoutSessionId: '...',\n      showOrderButton: false\n  })\n  .mount('#amazonpay_payment-container');\n\namazonPayOrder.submit();\n\n\nThis will call the onSubmit event, which contains a state.data object. Pass the object to the server to make a payment and parse the result of the payment.\nMake a payment\nFrom your server, make a  \/payments request, specifying the following parameters:\n\npaymentMethod: The state.data.paymentMethod from the onSubmit event from your front end.\nreturnUrl:\u00a0The URL where the shopper will be redirected back to after completing the payment. The URL should include the protocol: http:\/\/ or https:\/\/. For example, https:\/\/your-company.example.com\/checkout\/. You can also include your own additional query parameters, for example, shopper ID or order reference number.\n\n\n    \n\nThe  \/payments response contains:\n\npspReference: Adyen's unique reference for the payment.\nresultCode: Authorised\n\n\n    \n\nHandle the decline flow\nIn case of a credit card decline due to card expiration or insufficient funds, redirect the shopper back to the Amazon Pay payment method selection page. You can do this by calling the handleDeclineFlow from the Amazon Pay Component.\nThis flow lets you recover from a declined paymentas described in the Amazon Pay documentation.\nonSubmit: async (state, component) =&gt; {\n    try {\n        const response = await makePayment(state.data);\n        \/\/ Check the result code\n        if (response.resultCode &amp;&amp; checkPaymentResponse(response.resultCode)) {\n            \/\/ Show successful message\n        } else {\n            \/\/ Handle decline flow\n            amazonPayComponent.handleDeclineFlow();\n        }\n    } catch (error) {\n        \/\/ Fatal error\n    }\n},\nonError: (error) =&gt; {\n    if (error.resultCode) {\n        \/\/ Show payment failed message or start over the flow.\n    } else {\n        \/\/ Fatal error\n    }\n}\nPresent the payment result\nUse the\u00a0resultCode that you received in the  \/payments response to present the payment result to your shopper.\n \nThe resultCode values you can receive for Amazon Pay are:\n\n\n\nresultCode\nDescription\nAction to take\n\n\n\n\nAuthorised\nThe payment was successful.\nInform the shopper that the payment has been successful.  If you are using manual capture, you also need to capture the payment.\n\n\nCancelled\nThe shopper cancelled the payment.\nAsk the shopper whether they want to continue with the order, or ask them to select a different payment method.\n\n\nError\nThere was an error when the payment was being processed. For more information, check the \n  refusalReason\n field.\nInform the shopper that there was an error processing their payment.\n\n\nRefused\nThe payment was refused.  For more information, check the \n  refusalReason\n field.\nRedirect the shopper back to the payment page and ask them to try the payment again using a different card. For more information on how to do this, check Amazon Pay's documentation.\n\n\n\n\nAdditional resultCode values are possible in case of the 3D Secure authentication flow. For more information, refer to Result codes.\n\n If the shopper failed to return to your website or app, wait for webhooks to know the outcome of the payment. The webhooks you can receive for Amazon Pay 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\nOFFER_CLOSED\ntrue\nThe shopper did not complete the payment.\nCancel the order and inform the shopper that the payment timed out.\n\n\n\nOptional. Sign out from Amazon\nAfter the transaction is finished, and the result is shown to the shopper, display a button to let them sign out from the Amazon account.\n\n\nCreate a DOM element for the Sign out button, placing it where you want it to be rendered:\n&lt;div id=\"amazonpay_signout\"&gt;&lt;\/div&gt;\n\n\nCreate an instance of the Amazon Pay Component and pass the amazonCheckoutSessionId along with showSignOutButton set to true.\nconst amazonPayComponent = checkout\n  .create('amazonpay', {\n      amazonCheckoutSessionId: '...',\n      showSignOutButton: true\n  })\n  .mount('#amazonpay_signout');\n\n\nRecurring payments\nWe support recurring transactions for Amazon Pay. To make recurring payments, you need to:\n\nCreate a shopper token.\nUse the token to make future payments for the shopper.\n\nCreate a token\nTo create a token, include in your  \/payments request:\n\nstorePaymentMethod: true\n shopperReference&#58; Your unique identifier for the shopper.\n\nWhen the payment has been settled, you receive a  recurring.token.created webhook containing:\n\ntype: recurring.token.created\nshopperReference: your unique identifier for the shopper.\neventId: the pspReference of the initial payment.\nstoredPaymentMethodId: the token that you need to make recurring payments for this shopper.\n\n\nMake sure that your server is able to receive the Recurring tokens life cycle events webhook. You can set up this webhook in your Customer Area.\n\nMake a payment with a token\nTo make a payment with the token, include in your  \/payments request:\n\n\npaymentMethod.storedPaymentMethodId: The storedPaymentMethodId from the  recurring.token.created webhook.\n\nYou can also get this value using the  \/listRecurringDetails endpoint.\n\n\n\nshopperReference: The unique shopper identifier that you specified when creating the token.\n\n\nshopperInteraction:\u00a0ContAuth.\n\n\nrecurringProcessingModel: Subscription or UnscheduledCardOnFile.\n\n\nFor more information about the shopperInteraction and recurringProcessingModel fields, refer to Tokenization.\n\n    \n\nTest and go live\nTo test Amazon Pay, you must follow the Amazon Pay testing guidelines.\nYou can check the status of an Amazon Pay test payment in your\u00a0Customer Area\u00a0&gt;\u00a0Transactions\u00a0&gt;\u00a0Payments.\n \nBefore you can accept live Amazon Pay payments, you need to submit a request for Amazon Pay in your live Customer Area.\nSee also\n\n\n                    Web Components integration guide\n                \n                    Amazon Pay error codes\n                \n","type":"page","locale":"en","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Amazon Pay","lvl3":"Amazon Pay Component"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/payment-methods\/amazon-pay","lvl3":"\/payment-methods\/amazon-pay\/web-component"},"levels":4,"category":"Payment method","category_color":"green","tags":["Amazon","Component"]},"articleFiles":{"amazonpay-payments.js":"<p alt=\"\">amazonpay-payments.js<\/p>"}}
