{"title":"Drop-in tutorial: Node.js + Express","category":"default","creationDate":1583925000,"content":"<div class=\"additional-info-block output-inline\">\n<div class=\"additional-info-block__body\"><p><img alt=\"\" src=\"\/media\/178050b23d30d01b542e4e6f8996018f4f727a18930384b588d2b7fcdabde69f.png\" \/>&nbsp; See the full project in our <a href=\"https:\/\/github.com\/adyen-examples\/adyen-node-online-payments\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Drop-in and Node.js<\/a> example repository on GitHub.<\/p><\/div><\/div>\n\n<p>Adding new payment methods usually doesn't require more development work.  supports <a href=\"\/payment-methods\/cards\/web-drop-in\">cards<\/a>, <a href=\"\/payment-methods\">wallets<\/a>, and <a href=\"\/payment-methods\">most local payment methods<\/a>.<\/p>\n<h2>How it works<\/h2>\n<p>When your shopper visits your checkout page, your server makes an API call to Adyen to get a list of available payment methods for the shopper. The shopper then selects a payment method from that list, and enters their payment details in the input fields rendered by Drop-in.<\/p>\n<p>When the shopper selects the <strong>Pay<\/strong> button, your server uses the data returned by the client to submit a payment request to Adyen. If the response requires additional action from the shopper, Drop-in can handle these additional actions. In such cases, your server will make another request to Adyen to complete or verify the payment. When no additional actions are required, the payment result can be presented to the shopper.<\/p>\n<h2>Overview of the build process<\/h2>\n<div class=\"additional-info-block output-inline\">\n<h5 class=\"article__heading additional-info-block__title\">Prefer to watch a video tutorial?<\/h5><div class=\"additional-info-block__body\"><p>Watch our <a href=\"https:\/\/youtu.be\/C2hdSa3QJIk\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Drop-in tutorial: Node.js + Express<\/a> on YouTube.<\/p><\/div><\/div>\n\n<p>After following this tutorial, you'll have a complete checkout solution including both server- and client-side implementations.<\/p>\n<h4>Server implementation<\/h4>\n<p>You'll begin by exposing a few endpoints on your server to handle all shopper interactions at checkout. The names of your server endpoints in this tutorial match those in Adyen's <a href=\"https:\/\/github.com\/adyen-examples\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">example integrations<\/a>. You can name these endpoints however you like.<\/p>\n<table>\n<thead>\n<tr>\n<th>HTTP method<\/th>\n<th>Your server endpoint<\/th>\n<th>Role<\/th>\n<th>Related Adyen API endpoint<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>GET<\/code><\/td>\n<td><a href=\"#get-payment-methods\">\n  <code>\/api\/getPaymentMethods<\/code>\n<\/a><\/td>\n<td>Gets the available payment methods.<\/td>\n<td> <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><\/td>\n<\/tr>\n<tr>\n<td><code>POST<\/code><\/td>\n<td><a href=\"#initiate-payment\">\n  <code>\/api\/initiatePayment<\/code>\n<\/a><\/td>\n<td>Sends payment parameters together with the input details collected from the shopper.<\/td>\n<td> <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><\/td>\n<\/tr>\n<tr>\n<td><code>POST<\/code>, <code>GET<\/code><\/td>\n<td><a href=\"#handle-redirect\">\n  <code>\/api\/handleShopperRedirect<\/code>\n<\/a><\/td>\n<td>Sends payment details during a page redirect and determines the outcome for the shopper. <br> <br> Used for all payment methods that require a redirect, for example <a href=\"\/payment-methods\/ideal\/web-drop-in\">iDEAL<\/a> or <a href=\"\/payment-methods\/klarna\/web-drop-in\">Klarna<\/a>.<\/td>\n<td> <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><\/td>\n<\/tr>\n<tr>\n<td><code>POST<\/code><\/td>\n<td><a href=\"#additional-details\">\n  <code>\/api\/submitAdditionalDetails<\/code>\n<\/a><\/td>\n<td>Sends payment details when a shopper is required to perform additional actions without leaving your website. <br> <br> Examples: <a href=\"\/online-payments\/3d-secure\/native-3ds2\">Native 3D Secure 2 authentication<\/a>, native QR (<a href=\"\/payment-methods\/wechat-pay\/wechat-pay-desktop-qr-payments\/web-drop-in\">WeChat Pay<\/a>), and overlays (<a href=\"\/payment-methods\/paypal\/web-drop-in\">PayPal<\/a>)<\/td>\n<td> <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><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>These endpoints are custom routes (URI patterns) that interact with the Adyen API at specific points in the checkout process, and are accessed by your client through <code>fetch()<\/code> requests. With the exception of <code>\/handleShopperRedirect<\/code>, each endpoint returns a JSON response data back to the client.<\/p>\n<h4>Client implementation<\/h4>\n<p>After implementing the back end, you'll implement the front end with a configurable, ready-to-use Drop-in UI component.<\/p>\n<p>You'll first <a href=\"#library\">add the necessary library and styles<\/a> to your checkout page. Then, you'll <a href=\"#connect-to-your-server\">create <code>fetch()<\/code> requests<\/a> and <a href=\"#create-the-event-handler\">event handlers<\/a> to facilitate the app's client-server interactions. Finally, you'll <a href=\"#configure-drop-in\">configure<\/a> and <a href=\"#instantiate-and-mount-drop-in\">instantiate<\/a> Drop-in mounted to your checkout page. You'll then be ready to start testing transactions with hundreds of payment methods from around the world.<\/p>\n<h2>Requirements<\/h2>\n<p>This tutorial shows both server- and client-side integration steps for Drop-in. To be well-prepared, you should have experience working with Node.js, Express, and a template system (such as Handlebars).<\/p>\n<p>Before you begin to integrate, make sure you have followed the <a href=\"\/get-started-with-adyen\">Get started with Adyen guide<\/a> to:<\/p>\n<ul>\n<li>Get an overview of the steps needed to accept live payments.<\/li>\n<li>Create your test account.<\/li>\n<\/ul>\n<p>After you have created your test account:<\/p>\n<ul>\n<li><a href=\"\/development-resources\/api-credentials#generate-api-key\">Get your API key<\/a>.<\/li>\n<li><a href=\"\/development-resources\/client-side-authentication#get-your-client-key\">Get your client key<\/a>.<\/li>\n<li><a href=\"\/development-resources\/webhooks\">Set up webhooks<\/a> to know the payment outcome.<\/li>\n<\/ul>\n<p>We provide server-side API libraries for several programming languages, available through common package managers, like Gradle and npm, for easier installation and version management. Our API libraries will save you development time, because they:<\/p>\n<ul>\n<li>Use an API version that is up to date.<\/li>\n<li>Have generated models to help you construct requests.<\/li>\n<li>Send the request to Adyen using their built-in HTTP client, so you do not have to create your own.<\/li>\n<\/ul>\n\n<div id=\"tabZUrqe\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;additional-info-block output-inline\\&quot;&gt;\\n&lt;h5 class=\\&quot;article__heading additional-info-block__title\\&quot;&gt;Try our example integration&lt;\/h5&gt;&lt;div class=\\&quot;additional-info-block__body\\&quot;&gt;&lt;p&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/java\/gitpod-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-java-spring-online-payments#checkout-example\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Run it in Gitpod&lt;\/a&gt;. &lt;br&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/java\/github-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-java-spring-online-payments\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Clone the repository&lt;\/a&gt;.&lt;\/p&gt;&lt;\/div&gt;&lt;\/div&gt;\\n\\n&lt;h4&gt;Requirements&lt;\/h4&gt;\\n&lt;ul&gt;\\n&lt;li&gt;Java 11 or later.&lt;\/li&gt;\\n&lt;\/ul&gt;\\n&lt;h4&gt;Installation&lt;\/h4&gt;\\n&lt;p&gt;You can use &lt;a href=\\&quot;https:\/\/maven.apache.org\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Maven&lt;\/a&gt;, adding this dependency to your project&#039;s POM.&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Add the API library&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;xml\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;&amp;lt;dependency&amp;gt;\\\\n  &amp;lt;groupId&amp;gt;com.adyen&amp;lt;\\\\\/groupId&amp;gt;\\\\n  &amp;lt;artifactId&amp;gt;adyen-java-api-library&amp;lt;\\\\\/artifactId&amp;gt;\\\\n  &amp;lt;version&amp;gt;LATEST_VERSION&amp;lt;\\\\\/version&amp;gt;\\\\n&amp;lt;\\\\\/dependency&amp;gt;\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;p&gt;You can find the latest version on GitHub. Alternatively, you can download the &lt;a href=\\&quot;https:\/\/github.com\/Adyen\/adyen-java-api-library\/releases\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;release on GitHub&lt;\/a&gt;.&lt;\/p&gt;\\n&lt;h4&gt;Setting up the client&lt;\/h4&gt;\\n&lt;p&gt;Create a singleton resource that you use for the API requests to Adyen:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Set up your client&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;java\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;\\\\\/\\\\\/ Import the required classes.\\\\npackage com.adyen.service;\\\\n\\\\nimport com.adyen.Client;\\\\nimport com.adyen.service.checkout.PaymentsApi;\\\\nimport com.adyen.model.checkout.Amount;\\\\nimport com.adyen.model.checkout.CreateCheckoutSessionRequest;\\\\nimport com.adyen.model.checkout.CreateCheckoutSessionResponse;\\\\nimport com.adyen.enums.Environment;\\\\nimport com.adyen.service.exception.ApiException;\\\\n\\\\nimport java.io.IOException;\\\\n\\\\npublic class Snippet {\\\\n\\\\n    public Snippet() throws IOException, ApiException {\\\\n        \\\\\/\\\\\/ Set up the client and service.\\\\n        Client client = new Client(\\\\\\&quot;ADYEN_API_KEY\\\\\\&quot;, Environment.TEST);\\\\n    }\\\\n}\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;java_0_1&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;additional-info-block output-inline\\&quot;&gt;\\n&lt;h5 class=\\&quot;article__heading additional-info-block__title\\&quot;&gt;Try our example integration&lt;\/h5&gt;&lt;div class=\\&quot;additional-info-block__body\\&quot;&gt;&lt;p&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/php\/gitpod-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-php-online-payments#run-this-integration-in-seconds-using-gitpod\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Run it in Gitpod&lt;\/a&gt;. &lt;br&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/php\/github-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-php-online-payments\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Clone the repository&lt;\/a&gt;.&lt;\/p&gt;&lt;\/div&gt;&lt;\/div&gt;\\n\\n&lt;h4&gt;Requirements&lt;\/h4&gt;\\n&lt;ul&gt;\\n&lt;li&gt;PHP 7.3 or later.&lt;\/li&gt;\\n&lt;li&gt;cURL with SSL support.&lt;\/li&gt;\\n&lt;li&gt;The JSON PHP extension.&lt;\/li&gt;\\n&lt;li&gt;The list of dependencies from the composer require list.&lt;\/li&gt;\\n&lt;\/ul&gt;\\n&lt;h4&gt;Installation&lt;\/h4&gt;\\n&lt;p&gt;You can use &lt;a href=\\&quot;https:\/\/getcomposer.org\/\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Composer&lt;\/a&gt;. Follow the &lt;a href=\\&quot;https:\/\/getcomposer.org\/doc\/00-intro.md\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;installation instructions&lt;\/a&gt; if you do not already have composer installed.&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Install the API library&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;bash\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;composer require adyen\\\\\/php-api-library\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;p&gt;In your PHP script, make sure you include the autoloader:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Include the autoloader&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=\\&quot;[{&amp;quot;language&amp;quot;:&amp;quot;php&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;require __DIR__ . &#039;\\\\\/vendor\\\\\/autoload.php&#039;;&amp;quot;}]\\&quot; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;p&gt;Alternatively, you can download the &lt;a href=\\&quot;https:\/\/github.com\/Adyen\/adyen-php-api-library\/releases\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;release on GitHub&lt;\/a&gt;.&lt;\/p&gt;\\n&lt;h4&gt;Set up the client&lt;\/h4&gt;\\n&lt;p&gt;Create a singleton resource that you use for the API requests to Adyen:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Set up your client&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=\\&quot;[{&amp;quot;language&amp;quot;:&amp;quot;php&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;use Adyen\\\\\\\\Model\\\\\\\\Checkout\\\\\\\\Amount;\\\\nuse Adyen\\\\\\\\Model\\\\\\\\Checkout\\\\\\\\CreateCheckoutSessionRequest;\\\\nuse Adyen\\\\\\\\Service\\\\\\\\Checkout\\\\\\\\PaymentsApi;\\\\n\\\\n\\\\\/\\\\\/ Include your idempotency key when you make an API request.\\\\n$requestOptions[&#039;idempotencyKey&#039;] = \\\\&amp;quot;YOUR_IDEMPOTENCY_KEY\\\\&amp;quot;;\\\\n\\\\n\\\\\/\\\\\/ Set up the client and service.\\\\n$client = new \\\\\\\\Adyen\\\\\\\\Client();\\\\n$client-&amp;gt;setXApiKey(&#039;ADYEN_API_KEY&#039;);\\\\n$client-&amp;gt;setEnvironment(\\\\\\\\Adyen\\\\\\\\Environment::TEST);\\\\n\\\\n$service = new PaymentsApi($client);&amp;quot;}]\\&quot; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;php_1_2&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\n&lt;h4&gt;Requirements&lt;\/h4&gt;\\n&lt;ul&gt;\\n&lt;li&gt;.NET standard 2.0 or later.&lt;\/li&gt;\\n&lt;li&gt;For Terminal API certificate validation, set the application to either of the following:\\n&lt;ul&gt;\\n&lt;li&gt;.NET core 2.1 or later&lt;\/li&gt;\\n&lt;li&gt;.NET framework 4.6.1 or later&lt;\/li&gt;\\n&lt;\/ul&gt;&lt;\/li&gt;\\n&lt;\/ul&gt;\\n&lt;h4&gt;Installation&lt;\/h4&gt;\\n&lt;p&gt;You can use &lt;a href=\\&quot;https:\/\/www.nuget.org\/packages\/Adyen\/\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;NuGet&lt;\/a&gt;:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Install the API library&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;bash\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;PM&amp;gt; Install-Package Adyen -Version LATEST_VERSION\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;p&gt;Alternatively, you can download the\\u00a0&lt;a href=\\&quot;https:\/\/github.com\/Adyen\/adyen-dotnet-api-library\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;release on GitHub&lt;\/a&gt;.&lt;\/p&gt;\\n&lt;h4&gt;Set up the client&lt;\/h4&gt;\\n&lt;p&gt;Create a singleton resource that you use for the API requests to Adyen:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Set up your client&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;cs\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;using Adyen;\\\\nusing Adyen.Model.Checkout;\\\\nusing Adyen.Service.Checkout;\\\\nusing Environment = Adyen.Model.Environment;\\\\n\\\\nclass Program\\\\n{\\\\n    static void Main()\\\\n    {\\\\n        \\\\\/\\\\\/ Set up the client and service.\\\\n        var config = new Config\\\\n        {\\\\n            XApiKey = \\\\\\&quot;ADYEN_API_KEY\\\\\\&quot;,\\\\n            Environment = Environment.Test\\\\n        };\\\\n        var client = new Client(config);\\\\n        var checkout = new PaymentsService(client);\\\\n\\\\n        \\\\\/\\\\\/ Include your idempotency key when you make an API request.\\\\n        var requestOptions = new Adyen.Model.RequestOptions { IdempotencyKey = \\\\\\&quot;YOUR_IDEMPOTENCY_KEY\\\\\\&quot; };\\\\n    }\\\\n}\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;c#_2_3&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;NodeJS&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;additional-info-block output-inline\\&quot;&gt;\\n&lt;h5 class=\\&quot;article__heading additional-info-block__title\\&quot;&gt;Try our example integration&lt;\/h5&gt;&lt;div class=\\&quot;additional-info-block__body\\&quot;&gt;&lt;p&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/node-js\/gitpod-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-node-online-payments#checkout-example\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Run it in Gitpod&lt;\/a&gt;. &lt;br&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/node-js\/github-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-node-online-payments\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Clone the repository&lt;\/a&gt;.&lt;\/p&gt;&lt;\/div&gt;&lt;\/div&gt;\\n\\n&lt;h4&gt;Requirements&lt;\/h4&gt;\\n&lt;ul&gt;\\n&lt;li&gt;Node.js version 18 or later.&lt;\/li&gt;\\n&lt;\/ul&gt;\\n&lt;h4&gt;Installation&lt;\/h4&gt;\\n&lt;p&gt;You can use &lt;a href=\\&quot;https:\/\/www.npmjs.com\/\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;npm&lt;\/a&gt;:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Install the API library&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;bash\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;npm install --save @adyen\\\\\/api-library\\\\nnpm update @adyen\\\\\/api-library\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;p&gt;Alternatively, you can download the &lt;a href=\\&quot;https:\/\/github.com\/Adyen\/adyen-node-api-library\/releases\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;release on GitHub&lt;\/a&gt;.&lt;\/p&gt;\\n&lt;h4&gt;Setting up the client&lt;\/h4&gt;\\n&lt;p&gt;Create a singleton resource that you use for the API requests to Adyen:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Set up your client&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;js\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;\\\\\/\\\\\/ Require the parts of the module you want to use.\\\\nconst { Client, CheckoutAPI, Types} = require(\\\\\\&quot;@adyen\\\\\/api-library\\\\\\&quot;);\\\\n\\\\n\\\\\/\\\\\/ Set up the client and service.\\\\nconst client = new Client({ apiKey: \\\\\\&quot;ADYEN_API_KEY\\\\\\&quot;, environment: \\\\\\&quot;TEST\\\\\\&quot; });\\\\nconst checkoutApi = new CheckoutAPI(client);\\\\n\\\\n\\\\\/\\\\\/ Include your idempotency key when you make an API request.\\\\nconst requestOptions = { idempotencyKey: \\\\\\&quot;YOUR_IDEMPOTENCY_KEY\\\\\\&quot; };\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;nodejs_3_4&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;additional-info-block output-inline\\&quot;&gt;\\n&lt;h5 class=\\&quot;article__heading additional-info-block__title\\&quot;&gt;Try our example integration&lt;\/h5&gt;&lt;div class=\\&quot;additional-info-block__body\\&quot;&gt;&lt;p&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/go\/gitpod-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-golang-online-payments#run-this-integration-in-seconds-using-gitpod\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Run it in Gitpod&lt;\/a&gt;. &lt;br&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/go\/github-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-golang-online-payments\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Clone the repository&lt;\/a&gt;.&lt;\/p&gt;&lt;\/div&gt;&lt;\/div&gt;\\n\\n&lt;h4&gt;Requirements&lt;\/h4&gt;\\n&lt;ul&gt;\\n&lt;li&gt;Go 1.13 or later.&lt;\/li&gt;\\n&lt;\/ul&gt;\\n&lt;h4&gt;Installation&lt;\/h4&gt;\\n&lt;p&gt;You can use\\u00a0&lt;a href=\\&quot;https:\/\/github.com\/golang\/go\/wiki\/Modules\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Go modules&lt;\/a&gt;:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Install the API library&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;shell\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;go get github.com\\\\\/adyen\\\\\/adyen-go-api-library\\\\\/vLATEST_VERSION\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;p&gt;Alternatively, you can download the\\u00a0&lt;a href=\\&quot;https:\/\/github.com\/Adyen\/adyen-go-api-library\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;release on GitHub&lt;\/a&gt;.&lt;\/p&gt;\\n&lt;h4&gt;Set up the client&lt;\/h4&gt;\\n&lt;p&gt;Create a singleton resource that you use for the API requests to Adyen:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Set up your client&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;go\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;package main\\\\n\\\\nimport (\\\\n\\\\t\\\\\\&quot;github.com\\\\\/adyen\\\\\/adyen-go-api-library\\\\\/vLATEST_VERSION\\\\\/src\\\\\/adyen\\\\\\&quot;\\\\n\\\\t\\\\\\&quot;github.com\\\\\/adyen\\\\\/adyen-go-api-library\\\\\/vLATEST_VERSION\\\\\/src\\\\\/checkout\\\\\\&quot;\\\\n\\\\t\\\\\\&quot;github.com\\\\\/adyen\\\\\/adyen-go-api-library\\\\\/vLATEST_VERSION\\\\\/src\\\\\/common\\\\\\&quot;\\\\n)\\\\n\\\\n\\\\\/\\\\\/ Create a payment object.\\\\n\\\\nfunc main () {\\\\n\\\\tclient := adyen.NewClient(&amp;amp;common.Config{\\\\n\\\\t\\\\tApiKey: \\\\\\&quot;ADYEN_API_KEY\\\\\\&quot;,\\\\n\\\\t\\\\tEnvironment: common.TestEnv,\\\\n\\\\t})\\\\n\\\\tservice := client.Checkout()\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;go_4_5&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;additional-info-block output-inline\\&quot;&gt;\\n&lt;h5 class=\\&quot;article__heading additional-info-block__title\\&quot;&gt;Try our example integration&lt;\/h5&gt;&lt;div class=\\&quot;additional-info-block__body\\&quot;&gt;&lt;p&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/python\/gitpod-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-python-online-payments#run-this-integration-in-seconds-using-gitpod\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Run it in Gitpod&lt;\/a&gt;. &lt;br&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/python\/github-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-python-online-payments\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Clone the repository&lt;\/a&gt;.&lt;\/p&gt;&lt;\/div&gt;&lt;\/div&gt;\\n\\n&lt;h4&gt;Requirements&lt;\/h4&gt;\\n&lt;ul&gt;\\n&lt;li&gt;Python 3.6 or later.&lt;\/li&gt;\\n&lt;li&gt;(Optional) Packages: Requests or PycURL&lt;\/li&gt;\\n&lt;\/ul&gt;\\n&lt;h4&gt;Installation&lt;\/h4&gt;\\n&lt;p&gt;You can use\\u00a0&lt;a href=\\&quot;https:\/\/pip.pypa.io\/en\/stable\/\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;pip&lt;\/a&gt;:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Install the API library&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;py\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;pip install Adyen\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;p&gt;Alternatively, you can download the\\u00a0&lt;a href=\\&quot;https:\/\/github.com\/Adyen\/adyen-python-api-library\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;release on GitHub&lt;\/a&gt;.&lt;\/p&gt;\\n&lt;h4&gt;Set up the client&lt;\/h4&gt;\\n&lt;p&gt;Create a singleton resource that you use for the API requests to Adyen:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Set up your client&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;py\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;import Adyen\\\\n\\\\n# Set up the client and service.\\\\nadyen = Adyen.Adyen()\\\\nadyen.client.xapikey = \\\\\\&quot;ADYEN_API_KEY\\\\\\&quot;\\\\nadyen.client.platform = \\\\\\&quot;test\\\\\\&quot; # The environment that the library is used in.\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;python_5_6&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;\\n&lt;div class=\\&quot;additional-info-block output-inline\\&quot;&gt;\\n&lt;h5 class=\\&quot;article__heading additional-info-block__title\\&quot;&gt;Try our example integration&lt;\/h5&gt;&lt;div class=\\&quot;additional-info-block__body\\&quot;&gt;&lt;p&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/ruby\/gitpod-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-rails-online-payments#run-this-integration-in-seconds-using-gitpod\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Run it in Gitpod&lt;\/a&gt;. &lt;br&gt;&lt;img src=\\&quot;\/reuse\/development-resources\/install-api-library\/ruby\/github-icon.png\\&quot; alt=\\&quot;\\&quot; \/&gt;&amp;nbsp;&amp;nbsp;&lt;a href=\\&quot;https:\/\/github.com\/adyen-examples\/adyen-rails-online-payments\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Clone the repository&lt;\/a&gt;.&lt;\/p&gt;&lt;\/div&gt;&lt;\/div&gt;\\n\\n&lt;h4&gt;Requirements&lt;\/h4&gt;\\n&lt;ul&gt;\\n&lt;li&gt;Ruby 2.7 or later.&lt;\/li&gt;\\n&lt;\/ul&gt;\\n&lt;h4&gt;Installation&lt;\/h4&gt;\\n&lt;p&gt;You can use &lt;a href=\\&quot;https:\/\/rubygems.org\/\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;RubyGems&lt;\/a&gt;:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Install the API library&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;bash\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;gem install adyen-ruby-api-library\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;p&gt;Alternatively, you can download the &lt;a href=\\&quot;https:\/\/github.com\/Adyen\/adyen-ruby-api-library\/releases\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;release on GitHub&lt;\/a&gt;.&lt;\/p&gt;\\n&lt;p&gt;Run &lt;code&gt;bundle install&lt;\/code&gt; to install dependencies.&lt;\/p&gt;\\n&lt;h4&gt;Set up the client&lt;\/h4&gt;\\n&lt;p&gt;Create a singleton resource that you use for the API requests to Adyen:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Set up your client&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=\\&quot;[{&amp;quot;language&amp;quot;:&amp;quot;ruby&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;require &#039;adyen-ruby-api-library&#039;\\\\n\\\\n# Set up the client and service.\\\\nadyen = Adyen::Client.new\\\\nadyen.api_key = &#039;ADYEN_API_KEY&#039;\\\\nadyen.env = :test # The environment that the library is used in.&amp;quot;}]\\&quot; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;ruby_6_7&quot;,&quot;relation&quot;:&quot;&quot;}]\"\n            :should-update-when-url-changes='false'>\n        <\/tabs>\n    <\/div>\n<\/div>\n\n<h2>Build the server<\/h2>\n<p>You'll first implement the back end to make sure your server is ready for the checkout process.<\/p>\n<h4>Install dependencies<\/h4>\n<p>The integration on this page uses Node.js and Express, with Handlebars templating. For a smoother integration experience, the examples on this page use the following libraries as well:<\/p>\n<table>\n<thead>\n<tr>\n<th>npm package<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/www.npmjs.com\/package\/express-handlebars\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">express-handlebars<\/a><\/td>\n<td>Handlebars template (view) engine for Express.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/www.npmjs.com\/package\/uuid\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">uuid<\/a><\/td>\n<td>Creates unique identifiers in RFC4122 UUID format.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In the root of your project, install the dependencies:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Install dependencies'\" :id=\"''\" :code-data='[{\"language\":\"bash\",\"tabTitle\":\"\",\"content\":\"npm install --save express @adyen\\\/api-library express-handlebars uuid\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h4>Configure the server<\/h4>\n<p>After installing the dependencies, import the modules and configure the Adyen client in your server file (we use <strong>index.js<\/strong> in this example). Provide your API key as a string in the boilerplate code or fetch it from the environment. You can use a library like <a href=\"https:\/\/www.npmjs.com\/package\/dotenv\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">dotenv<\/a> to load environment variables when the application loads.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'index.js'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;const express = require(\\&quot;express\\&quot;);\\nconst path = require(\\&quot;path\\&quot;);\\nconst hbs = require(\\&quot;express-handlebars\\&quot;);\\nconst { v4: uuidv4 } = require('uuid');\\nconst { Client, Config, CheckoutAPI } = require(\\&quot;@adyen\\\/api-library\\&quot;);\\nconst app = express();\\n\\n\\\/\\\/ Parse JSON bodies\\napp.use(express.json());\\n\\\/\\\/ Parse URL-encoded bodies\\napp.use(express.urlencoded({ extended: true }));\\n\\\/\\\/ Serve client from build folder\\napp.use(express.static(path.join(__dirname, \\&quot;\\\/public\\&quot;)));\\n\\n\\\/\\\/ Adyen Node.js API library boilerplate (configuration, etc.)\\nconst config = new Config();\\nconfig.apiKey = process.env.ADYEN_API_KEY;\\nconst client = new Client({ config });\\nclient.setEnvironment(\\&quot;TEST\\&quot;);\\nconst checkout = new CheckoutAPI(client);\\n\\n\\\/\\\/ Use Handlebars as the view engine\\napp.set(\\&quot;view engine\\&quot;, \\&quot;handlebars\\&quot;);\\n\\n\\\/\\\/ Specify where to find view files\\napp.engine(\\n  \\&quot;handlebars\\&quot;,\\n  hbs({\\n    defaultLayout: \\&quot;main\\&quot;,\\n    layoutsDir: __dirname + \\&quot;\\\/views\\\/layouts\\&quot;\\n  })\\n);\\n\\n\\\/* ################# API ENDPOINTS ###################### *\\\/\\n\\n\\\/* ################# CLIENT SIDE ENDPOINTS ###################### *\\\/\\n\\n\\\/\\\/ Start server\\nconst PORT = process.env.PORT || 8080;\\napp.listen(PORT, () =&gt; console.log(`Server started on port ${PORT}`));&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>Next, you'll expose a few API endpoints on your server to support different points in the checkout process.<\/p>\n<h4 id=\"get-payment-methods\">Get available payment methods<\/h4>\n<p>The first point in the checkout process: the shopper is ready to pay and looks to select a payment method.<\/p>\n<p>To get the available payment methods for the shopper, expose an endpoint on your server by creating a GET route to <code>\/api\/getPaymentMethods<\/code>. When this endpoint is accessed, the instance of checkout will make a call to Adyen's  <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> endpoint.<\/p>\n<p>Pass in your <code>merchantAccount<\/code> and <code>channel<\/code>:<span translate=\"no\"><strong>Web<\/strong><\/span>. You can also specify <code>amount<\/code> and <code>countryCode<\/code> parameters&mdash; we use these to limit the list of available payment methods.<\/p>\n<p>Next, pass the entire JSON response from your server back to your client.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'getPaymentMethods'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"app.post(\\\"\\\/api\\\/getPaymentMethods\\\", async (req, res) =&gt; {\\n  try {\\n    const response = await checkout.paymentMethods({\\n      channel: \\\"Web\\\",\\n      merchantAccount: process.env.MERCHANT_ACCOUNT,\\n    });\\n    res.json(response);\\n  } catch (err) {\\n    console.error(`Error: ${err.message}, error code: ${err.errorCode}`);\\n    res.status(err.statusCode).json(err.message);\\n  }\\n});\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>An array of available payment methods is returned in the response, each with a <code>name<\/code> and <code>type<\/code>. Drop-in uses the response to show the available payment methods to the shopper.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'\/paymentMethods response'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"{\\n  \\\"paymentMethods\\\":[\\n    {\\n      \\\"details\\\":[...],\\n      \\\"name\\\":\\\"Credit Card\\\",\\n      \\\"type\\\":\\\"scheme\\\"\\n      \\\/\\\/ ...\\n    },\\n    \\\/\\\/ ...\\n  ]\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<div class=\"notices green\">\n<p>We'll revisit this response object later on the client side when we <a href=\"#configure-drop-in\">configure Drop-in<\/a>.<\/p>\n<\/div>\n<h4 id=\"initiate-payment\">Initiate a payment<\/h4>\n<p>At this point in the checkout process, the shopper selects a payment method, enters their payment details, and selects the <strong>Pay<\/strong> button.<\/p>\n<p>To initiate the payment, you'll expose an endpoint on your server by creating a POST route to <code>\/api\/initiatePayment<\/code>. When this endpoint is accessed, a call will be made to Adyen's  <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> endpoint.<\/p>\n<p>In our example, the shopper selects to pay with their card. Specify the <code>amount<\/code>, <code>reference<\/code>, <code>merchantAccount<\/code>, <code>paymentMethod<\/code>, <code>channel<\/code>, <code>returnUrl<\/code>, and <code>browserInfo<\/code> in the request body. Note that the values of certain parameters, such as <code>browserInfo<\/code> and <code>paymentMethod<\/code>, represent data passed from the client when performing the <code>fetch()<\/code> request.<\/p>\n<p>A sample request for a credit card payment (with <a href=\"\/online-payments\/3d-secure\">3D Secure redirect authentication<\/a>) of <strong>10<\/strong> EUR:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'initiatePayment'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"\\\/\\\/ A temporary store to keep payment data to be sent in additional payment details and redirects.\\n\\\/\\\/ This is more secure than a cookie. In a real application this should be in a database.\\nconst paymentDataStore = {};\\n\\napp.post(\\\"\\\/api\\\/initiatePayment\\\", async (req, res) =&gt; {\\n  try {\\n    \\\/\\\/ unique ref for the transaction\\n    const orderRef = uuidv4();\\n    \\\/\\\/ Ideally the data passed here should be computed based on business logic\\n    const response = await checkout.payments({\\n      amount: { currency: \\\"EUR\\\", value: 1000 }, \\\/\\\/ value is 10\\u20ac in minor units\\n      reference: orderRef, \\\/\\\/ required\\n      merchantAccount: process.env.MERCHANT_ACCOUNT, \\\/\\\/ required\\n      channel: \\\"Web\\\", \\\/\\\/ required\\n      \\\/\\\/ we pass the orderRef in return URL to get paymentData during redirects\\n      returnUrl: `http:\\\/\\\/localhost:8080\\\/api\\\/handleShopperRedirect?orderRef=${orderRef}`, \\\/\\\/ required for redirect flow\\n      browserInfo: req.body.browserInfo,\\n      paymentMethod: req.body.paymentMethod \\\/\\\/ required\\n    });\\n\\n    const { action } = response;\\n\\n    if (action) {\\n      paymentDataStore[orderRef] = action.paymentData;\\n    }\\n    res.json(response);\\n  } catch (err) {\\n    console.error(`Error: ${err.message}, error code: ${err.errorCode}`);\\n    res.status(err.statusCode).json(err.message);\\n  }\\n});\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>If the response contains an <code>action<\/code> object, this means that additional client-side actions are required to complete the payment. As shown above, you'll pass the response from the server to the client, where it will be handled by Drop-in. You'll also temporarily save <code>paymentData<\/code> (for example, in a database, or in a cache as shown in this example). You'll need to include the <code>paymentData<\/code> in your <a href=\"#handle-redirect\">next API request<\/a> to check the payment result in case of a page redirection.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'\/payments response with an action object'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"resultCode\\\":\\\"RedirectShopper\\\",\\n   \\\"action\\\":{\\n      \\\"data\\\":{\\n         \\\"MD\\\":\\\"OEVudmZVMUlkWjd0MDNwUWs2bmhSdz09...\\\",\\n         \\\"PaReq\\\":\\\"eNpVUttygjAQ\\\/RXbDyAXBYRZ00HpTH3wUosPfe...\\\",\\n         \\\"TermUrl\\\":\\\"https:\\\/\\\/example.com\\\/checkout?shopperOrder=12xy..\\\"\\n      },\\n      \\\"method\\\":\\\"POST\\\",\\n      \\\"paymentData\\\":\\\"Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...\\\",\\n      \\\"paymentMethodType\\\":\\\"scheme\\\",\\n      \\\"type\\\":\\\"redirect\\\",\\n      \\\"url\\\":\\\"https:\\\/\\\/test.adyen.com\\\/checkoutshopper\\\/threeDS\\\/checkoutRedirect\\\/...\\\"\\n   },\\n   \\\"details\\\":[\\n      {\\n         \\\"key\\\":\\\"MD\\\",\\n         \\\"type\\\":\\\"text\\\"\\n      },\\n      {\\n         \\\"key\\\":\\\"PaRes\\\",\\n         \\\"type\\\":\\\"text\\\"\\n      }\\n   ],\\n   \\\/\\\/ ...\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<div class=\"notices green\">\n<p>We'll revisit this <code>action<\/code> object later on the client side when we <a href=\"#create-the-event-handler\">configure Drop-in to handle the action<\/a>.<\/p>\n<\/div>\n<p>If there's no <code>action<\/code> object in the response, no additional actions are needed to complete the payment. This means that the transaction has reached a final status (for example, in a 3D Secure scenario, the transaction was either exempted or out-of-scope for 3D Secure authentication). Pass the response to your client &mdash; you'll use this to present the payment result to your shopper.<\/p>\n<h4 id=\"handle-redirect\">Handle the redirect<\/h4>\n<p>At this point in the checkout process, the shopper has been redirected to another site to complete the payment, and back to your <code>returnUrl<\/code> using either an HTTP <code>POST<\/code> or <code>GET<\/code>. This redirection is a result of Drop-in performing the <code>action.type<\/code>: <span translate=\"no\"><strong>redirect<\/strong><\/span> specified 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.<\/p>\n<p>After the shopper is redirected back, you need to verify or complete the payment using data from the redirected page. You'll do that by exposing two more endpoints on your server, representing a <code>GET<\/code> and <code>POST<\/code> route to <code>\/api\/handleShopperRedirect<\/code>.<\/p>\n<p>When either endpoint is accessed, a call will be made to Adyen's  <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> endpoint. In the request, specify:<\/p>\n<ul>\n<li><code>paymentData<\/code>: the value from 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.<\/li>\n<li><code>details<\/code>: data returned from redirected page.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'handleShopperRedirect'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"\\\/\\\/ handle both POST &amp; GET requests\\napp.all(\\\"\\\/api\\\/handleShopperRedirect\\\", async (req, res) =&gt; {\\n  \\\/\\\/ Create the payload for submitting payment details\\n  const orderRef = req.query.orderRef;\\n  const redirect = req.method === \\\"GET\\\" ? req.query : req.body;\\n  const details = {};\\n  if (redirect.redirectResult) {\\n    details.redirectResult = redirect.redirectResult;\\n  } else {\\n    details.MD = redirect.MD;\\n    details.PaRes = redirect.PaRes;\\n  }\\n\\n  const payload = {\\n    details,\\n    paymentData: paymentDataStore[orderRef],\\n  };\\n\\n  try {\\n    const response = await checkout.paymentsDetails(payload);\\n    \\\/\\\/ Conditionally handle different result codes for the shopper\\n    switch (response.resultCode) {\\n      case \\\"Authorised\\\":\\n        res.redirect(\\\"\\\/result\\\/success\\\");\\n        break;\\n      case \\\"Pending\\\":\\n      case \\\"Received\\\":\\n        res.redirect(\\\"\\\/result\\\/pending\\\");\\n        break;\\n      case \\\"Refused\\\":\\n        res.redirect(\\\"\\\/result\\\/failed\\\");\\n        break;\\n      default:\\n        res.redirect(\\\"\\\/result\\\/error\\\");\\n        break;\\n    }\\n  } catch (err) {\\n    console.error(`Error: ${err.message}, error code: ${err.errorCode}`);\\n    res.redirect(\\\"\\\/result\\\/error\\\");\\n  }\\n});\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>You'll receive a response with a <code>pspReference<\/code> and a <code>resultCode<\/code>, the latter of which can be used to <a href=\"#handle-result-codes\">present the payment result<\/a> to the shopper.<\/p>\n<p><strong>Successful response<\/strong><\/p>\n<pre><code class=\"language-js\">{\n \"pspReference\": \"NC6HT9CRT65ZGN82\",\n \"resultCode\": \"Authorised\"\n}<\/code><\/pre>\n<p>If you receive another <code>action<\/code> object in the response, pass this back to the client again.<\/p>\n<div class=\"notices green\">\n<p>We'll configure the Drop-in to <a href=\"#create-the-event-handler\">handle additional actions<\/a> in case you receive more action objects in the response.<\/p>\n<\/div>\n<h4 id=\"additional-details\">Handle other additional details<\/h4>\n<p>For some payment flows, the shopper needs to perform additional steps without leaving your website. For example, this can mean scanning a QR code, or completing a challenge in case of <a href=\"\/online-payments\/3d-secure#authentication-flows\">native 3D Secure 2 authentication<\/a>.<\/p>\n<p>To handle submitting these additional details, you'll expose another endpoint on your server by creating a <code>POST<\/code> route to <code>\/api\/submitAdditionalDetails<\/code>. Similar to <code>\/api\/handleShopperRedirect<\/code> above, specify <code>details<\/code> and <code>paymentData<\/code> parameters in the call to Adyen's  <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> endpoint. Note that this time, the shopper stays in your website so there is no view redirect logic in the server. Instead, any additional <code>action<\/code> objects are passed back to the client. The result code is also passed to the client, and this will be used to present the payment result to the shopper.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'submitAdditionalDetails'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"app.post(\\\"\\\/api\\\/submitAdditionalDetails\\\", async (req, res) =&gt; {\\n  \\\/\\\/ Create the payload for submitting payment details\\n  const payload = {\\n    details: req.body.details,\\n    paymentData: req.body.paymentData,\\n  };\\n\\n  try {\\n    \\\/\\\/ Return the response back to client (for further action handling or presenting result to shopper)\\n    const response = await checkout.paymentsDetails(payload);\\n    res.json(response);\\n  } catch (err) {\\n    console.error(`Error: ${err.message}, error code: ${err.errorCode}`);\\n    res.status(err.statusCode).json(err.message);\\n  }\\n});\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<div class=\"notices green\">\n<p>We'll configure the Drop-in to <a href=\"#create-the-event-handler\">handle additional actions<\/a> in case you receive more action objects in the response.<\/p>\n<\/div>\n<h4>Handle result codes<\/h4>\n<p>When working with payment methods involving a page redirect, we handled the redirect logic <a href=\"#handle-redirect\">in the server<\/a>. In all other cases, however, result codes will be handled in the client, where you can present the payment outcome for your shopper. We'll take a look at the logic for handling result codes next when we build the client.<\/p>\n<h2>Build the client<\/h2>\n<p>After implementing the server-side code, we'll now implement an interactive UI component on the front end of your application.<\/p>\n<h4 id=\"library\">Add the Drop-in script and styles<\/h4>\n<p>To add Drop-in to your checkout page, install the Adyen Web Node package or use a <code>&lt;script&gt;<\/code> tag:<\/p>\n\n<div id=\"tabxndZ1\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;npm (recommended)&quot;,&quot;content&quot;:&quot;\\n&lt;ol&gt;\\n&lt;li&gt;\\n&lt;p&gt;Install the &lt;a href=\\&quot;https:\/\/www.npmjs.com\/package\/@adyen\/adyen-web\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Adyen Web Node package&lt;\/a&gt;:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n&lt;code-sample :title=\\&quot;&#039;&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;bash\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;npm install @adyen\\\\\/adyen-web --save\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;\/li&gt;\\n&lt;li&gt;\\n&lt;p&gt;Import Adyen Web into your application:&lt;\/p&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n&lt;code-sample :title=\\&quot;&#039;&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=\\&quot;[{&amp;quot;language&amp;quot;:&amp;quot;js&amp;quot;,&amp;quot;tabTitle&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;content&amp;quot;:&amp;quot;import { AdyenCheckout } from &#039;@adyen\\\\\/adyen-web&#039;;\\\\nimport &#039;@adyen\\\\\/adyen-web\\\\\/styles\\\\\/adyen.css&#039;;&amp;quot;}]\\&quot; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\/code-sample&gt;\\n&lt;\/div&gt;\\n&lt;\/li&gt;\\n&lt;\/ol&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;npm_(recommended)_0_1&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;Embed script and stylesheet&quot;,&quot;content&quot;:&quot;\\n&lt;ol&gt;\\n&lt;li&gt;\\n&lt;p&gt;Include the following script in the\\u00a0&lt;code&gt;&amp;lt;body&amp;gt;&lt;\/code&gt;\\u00a0above any other JavaScript in your checkout page:&lt;\/p&gt;\\n&lt;p&gt;We recommend that you also validate the &lt;a href=\\&quot;\/online-payments\/web-best-practices#implement-subresource-integrity-hashes\\&quot;&gt;Subresource Integrity (SRI) hash&lt;\/a&gt;, which we provide for each version of our JavaScript and CSS files. You can find the SRI hashes in our &lt;a href=\\&quot;\/online-payments\/release-notes\\&quot;&gt;release notes&lt;\/a&gt;, under &lt;strong&gt;Updating to this version&lt;\/strong&gt;.&lt;\/p&gt;\\n&lt;pre&gt;&lt;code class=\\&quot;language-html\\&quot;&gt;&amp;lt;script src=\\&quot;https:\/\/checkoutshopper-test.cdn.adyen.com\/checkoutshopper\/sdk\/{VERSION}\/adyen.js\\&quot;\\nintegrity=\\&quot;sha384-KF6Y8NQXGnIuzqJn5rcqCe6dMy7gBWobcIKr1BmIaz6pOeBAV0hrHBBMbHC\/inHu\\&quot;\\ncrossorigin=\\&quot;anonymous\\&quot;&amp;gt;&amp;lt;\/script&amp;gt;\\n&amp;lt;!-- Adyen provides the SRI hash that you include as the integrity attribute.--&amp;gt;\\n&amp;lt;!-- Refer to our release notes to get the SRI hash for the specific version: https:\/\/docs.adyen.com\/online-payments\/release-notes --&amp;gt;&lt;\/code&gt;&lt;\/pre&gt;\\n&lt;\/li&gt;\\n&lt;li&gt;\\n&lt;p&gt;Use the following CSS file:&lt;\/p&gt;\\n&lt;pre&gt;&lt;code class=\\&quot;language-html\\&quot;&gt;&amp;lt;link rel=\\&quot;stylesheet\\&quot; href=\\&quot;https:\/\/checkoutshopper-test.adyen.com\/checkoutshopper\/sdk\/{VERSION}\/adyen.css\\&quot;\\nintegrity=\\&quot;sha384-uwMmo3xJR0e9jI+Oi5kzu43ShY0pXrb3auIlCjLjMNtl0X8Nat55eXNqwj8xU6H9\\&quot;\\ncrossorigin=\\&quot;anonymous\\&quot;&amp;gt;\\n&amp;lt;!-- Adyen provides the SRI hash that you include as the integrity attribute. --&amp;gt;\\n&amp;lt;!-- Refer to our release notes to get the SRI hash for the specific version: https:\/\/docs.adyen.com\/online-payments\/release-notes --&amp;gt;&lt;\/code&gt;&lt;\/pre&gt;\\n&lt;p&gt;You can &lt;a href=\\&quot;\/online-payments\/build-your-integration\/sessions-flow\/?platform=Web&amp;amp;integration=Drop-in#optional-configuration\\&quot;&gt;add your own styling&lt;\/a&gt; by overriding the rules in this CSS file.&lt;\/p&gt;\\n&lt;\/li&gt;\\n&lt;\/ol&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;embed_script_and_stylesheet_1_2&quot;,&quot;relation&quot;:&quot;&quot;}]\"\n            :should-update-when-url-changes='false'>\n        <\/tabs>\n    <\/div>\n<\/div>\n\n<h4>Create the container element<\/h4>\n<p>Next, create a DOM element on your checkout page with a descriptive <code>id<\/code> value. Place this element where you want Drop-in to be rendered on the page.<\/p>\n<pre><code class=\"language-html\">&lt;!-- payment.handlebars --&gt;\n\n&lt;div id=\"dropin-container\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<p>Later on, we'll mount Drop-in to this container.<\/p>\n<h4>Connect to your server<\/h4>\n<p>At this point, your server is already built to make the necessary API calls to Adyen corresponding to all shopper interactions at checkout. You'll handle this on the front end by building functions for any client-server interactions.<\/p>\n<p>First, define a function that calls your server endpoints and passes JSON-stringified data from the client. We'll call this function <code>callServer<\/code>. The function uses a JavaScript <code>fetch()<\/code> request to communicate with the server. We'll later pass the <code>url<\/code> parameter based on which endpoint is requested, for example <code>\/api\/initiatePayment<\/code> or <code>\/api\/submitAdditionalDetails<\/code>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'callServer'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"async function callServer(url, data) {\\n  const res = await fetch(url, {\\n    method: \\\"POST\\\",\\n    body: data ? JSON.stringify(data) : \\\"\\\",\\n    headers: {\\n      \\\"Content-Type\\\": \\\"application\\\/json\\\",\\n    },\\n  });\\n\\n  return await res.json();\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>Next, we need a function that determines how to handle the responses sent from the server to the client. We'll call this function <code>handleServerResponse<\/code>. The function first checks for an <code>action<\/code> object in the API response, which Drop-in will handle. If there is no <code>action<\/code> object in the API response, use the <code>resultCode<\/code> to present the payment result to your shopper. For a full list of result codes, refer to <a href=\"\/online-payments\/payment-result-codes\">Result codes<\/a>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'handleServerResponse'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"function handleServerResponse(res, component) {\\n  if (res.action) {\\n    component.handleAction(res.action);\\n  } else {\\n    switch (res.resultCode) {\\n      case \\\"Authorised\\\":\\n        window.location.href = \\\"\\\/result\\\/success\\\";\\n        break;\\n      case \\\"Pending\\\":\\n      case \\\"Received\\\":\\n        window.location.href = \\\"\\\/result\\\/pending\\\";\\n        break;\\n      case \\\"Refused\\\":\\n        window.location.href = \\\"\\\/result\\\/failed\\\";\\n        break;\\n      default:\\n        window.location.href = \\\"\\\/result\\\/error\\\";\\n        break;\\n    }\\n  }\\n}\\n\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>We'll use these functions to create a flexible event handler on the page.<\/p>\n<h4>Create the event handler<\/h4>\n<p>During the checkout process, we need to handle certain events such as when the shopper clicks the <strong>Pay<\/strong> button, or when additional information is required to complete the payment.<\/p>\n<p>We can wrap the above client-server functions nicely in a single, reusable function. We'll call this function <code>handleSubmission<\/code>. The function calls the server at the provided endpoint and passes the payment data.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'handleSubmission'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"async function handleSubmission(state, component, url) {\\n  try {\\n    const res = await callServer(url, state.data);\\n    handleServerResponse(res, component);\\n  } catch (error) {\\n    console.error(error);\\n  }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>After the request is resolved, Drop-in handles the data returned in the Adyen API response.<\/p>\n<h4>Configure Drop-in<\/h4>\n<p>After building the client-server interaction, we'll now configure and instantiate Drop-in.<\/p>\n<p>Create a <code>configuration<\/code> object 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>paymentMethodsResponse<\/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>The response from your <code>\/api\/getPaymentMethods<\/code> request.<\/td>\n<\/tr>\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>Public key used to authenticate requests from your web environment. <br> For more information, refer to <a href=\"\/development-resources\/client-side-authentication\">client side authentication<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><code>locale<\/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>The shopper's locale. This is used to set the language rendered in the UI. For a list of supported locales, see\u00a0<a href=\"\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=Drop-in#optional-configuration\">Localization<\/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 <span translate=\"no\"><strong>test<\/strong><\/span>. When you are ready to accept live payments, change the value to one of our <a href=\"\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=Drop-in&amp;version=latest#testing-your-integration\">live environments<\/a>.\u00a0<\/td>\n<\/tr>\n<tr>\n<td><code>onSubmit<\/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>Assign the reusable event handler <code>handleSubmission<\/code> with your <code>\/api\/initiatePayment<\/code> endpoint. The <code>onSubmit<\/code> event is called when the shopper selects the <strong>Pay<\/strong> button.<\/td>\n<\/tr>\n<tr>\n<td><code>onAdditionalDetails<\/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>Assign the reusable event handler <code>handleSubmission<\/code> with your <code>\/api\/submitAdditionalDetails<\/code> endpoint. The <code>onAdditionalDetails<\/code> event is called if no final state was reached, or additional details are required.<\/td>\n<\/tr>\n<tr>\n<td><code>paymentMethodsConfiguration<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td>Required or optional configuration for specific payment methods. For more information about payment method-specific configurations, refer to our <a href=\"\/payment-methods\">payment method guides<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For our cards example, we'll include optional configuration - such as <code>showPayButton<\/code>, <code>hasHolderName<\/code>, <code>holderNameRequired<\/code>, <code>name<\/code>, and <code>amount<\/code>. For a full list of configurable fields, refer to <a href=\"\/payment-methods\/cards\/web-drop-in#configuration\">optional Card configuration<\/a>.<\/p>\n<p>Let us create this inside an <code>async<\/code> function so that we can call other <code>async<\/code> functions with the <code>await<\/code> syntax.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Drop-in configuration'\" :id=\"''\" :code-data='[{\"language\":\"js\",\"tabTitle\":\"\",\"content\":\"async function initCheckout() {\\n  try {\\n    const paymentMethodsResponse = await callServer(\\\"\\\/api\\\/getPaymentMethods\\\");\\n    const configuration = {\\n      paymentMethodsResponse: paymentMethodsResponse,\\n      clientKey: \\\"YOUR_CLIENT_KEY\\\",\\n      locale: \\\"en_US\\\",\\n      environment: \\\"test\\\",\\n      paymentMethodsConfiguration: {\\n        card: {\\n          showPayButton: true,\\n          hasHolderName: true,\\n          holderNameRequired: true,\\n          name: \\\"Credit or debit card\\\",\\n          amount: {\\n            value: 1000,\\n            currency: \\\"EUR\\\"\\n          }\\n        }\\n      },\\n      onSubmit: (state, component) =&gt; {\\n        if (state.isValid) {\\n          handleSubmission(state, component, \\\"\\\/api\\\/initiatePayment\\\");\\n        }\\n      },\\n      onAdditionalDetails: (state, component) =&gt; {\\n        handleSubmission(state, component, \\\"\\\/api\\\/submitAdditionalDetails\\\");\\n      },\\n    };\\n  } catch (error) {\\n    console.error(error);\\n  }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h4>Instantiate and mount Drop-in<\/h4>\n<p>After all the configuration are set, you are ready to instantiate your Drop-in. Create an instance of <code>AdyenCheckout<\/code> with your newly-created configuration object. You'll use the returned value to create and mount the instance of your UI Drop-in. Finally invoke the <code>initCheckout<\/code> function and we are done.<\/p>\n<pre><code class=\"language-js\">async function initCheckout() {\n  try {\n    \/\/ ...\n    const configuration = \/\/ ...\n\n    const checkout = new AdyenCheckout(configuration);\n    checkout.create(\"dropin\").mount(document.getElementById(\"#dropin-container\"));\n  } catch (error) {\n    \/\/ ...\n  }\n}\n\ninitCheckout();<\/code><\/pre>\n<p>You can checkout the full <a href=\"https:\/\/github.com\/adyen-examples\/adyen-node-online-payments\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Node.js<\/a> example integration on our GitHub examples repository.<\/p>","url":"https:\/\/docs.adyen.com\/online-payments\/build-your-integration\/advanced-flow\/web-drop-in-tutorial","articleFields":{"description":"Build a complete integration for accepting payments on your website.","next_steps_description":"If you followed this tutorial, you now have an integration built to support all payment flows. \r\n\r\nAdding more payment methods to Drop-in does _not_ require building an entirely new integration. Your existing Drop-in code can be quickly extended to support your shoppers' preferred payment methods.","next_steps":[{"title":"Test your integration","description":"Make test payments with our test card numbers and credentials. ","url":"\/development-resources\/testing\/","required":false},{"title":"Add payment methods","description":"Add payment methods in your Customer Area.","url":"\/payment-methods\/add-payment-methods","required":false},{"title":"Check specific configuration","description":"Some payment methods require additional configuration or a modified payments request.","url":"\/payment-methods","required":false}]},"algolia":{"url":"https:\/\/docs.adyen.com\/online-payments\/build-your-integration\/advanced-flow\/web-drop-in-tutorial","title":"Drop-in tutorial: Node.js + Express","content":"\n&nbsp; See the full project in our Drop-in and Node.js example repository on GitHub.\n\nAdding new payment methods usually doesn't require more development work.  supports cards, wallets, and most local payment methods.\nHow it works\nWhen your shopper visits your checkout page, your server makes an API call to Adyen to get a list of available payment methods for the shopper. The shopper then selects a payment method from that list, and enters their payment details in the input fields rendered by Drop-in.\nWhen the shopper selects the Pay button, your server uses the data returned by the client to submit a payment request to Adyen. If the response requires additional action from the shopper, Drop-in can handle these additional actions. In such cases, your server will make another request to Adyen to complete or verify the payment. When no additional actions are required, the payment result can be presented to the shopper.\nOverview of the build process\n\nPrefer to watch a video tutorial?Watch our Drop-in tutorial: Node.js + Express on YouTube.\n\nAfter following this tutorial, you'll have a complete checkout solution including both server- and client-side implementations.\nServer implementation\nYou'll begin by exposing a few endpoints on your server to handle all shopper interactions at checkout. The names of your server endpoints in this tutorial match those in Adyen's example integrations. You can name these endpoints however you like.\n\n\n\nHTTP method\nYour server endpoint\nRole\nRelated Adyen API endpoint\n\n\n\n\nGET\n\n  \/api\/getPaymentMethods\n\nGets the available payment methods.\n \/paymentMethods\n\n\nPOST\n\n  \/api\/initiatePayment\n\nSends payment parameters together with the input details collected from the shopper.\n \/payments\n\n\nPOST, GET\n\n  \/api\/handleShopperRedirect\n\nSends payment details during a page redirect and determines the outcome for the shopper.   Used for all payment methods that require a redirect, for example iDEAL or Klarna.\n \/payments\/details\n\n\nPOST\n\n  \/api\/submitAdditionalDetails\n\nSends payment details when a shopper is required to perform additional actions without leaving your website.   Examples: Native 3D Secure 2 authentication, native QR (WeChat Pay), and overlays (PayPal)\n \/payments\/details\n\n\n\nThese endpoints are custom routes (URI patterns) that interact with the Adyen API at specific points in the checkout process, and are accessed by your client through fetch() requests. With the exception of \/handleShopperRedirect, each endpoint returns a JSON response data back to the client.\nClient implementation\nAfter implementing the back end, you'll implement the front end with a configurable, ready-to-use Drop-in UI component.\nYou'll first add the necessary library and styles to your checkout page. Then, you'll create fetch() requests and event handlers to facilitate the app's client-server interactions. Finally, you'll configure and instantiate Drop-in mounted to your checkout page. You'll then be ready to start testing transactions with hundreds of payment methods from around the world.\nRequirements\nThis tutorial shows both server- and client-side integration steps for Drop-in. To be well-prepared, you should have experience working with Node.js, Express, and a template system (such as Handlebars).\nBefore you begin to integrate, make sure you have followed the Get started with Adyen guide to:\n\nGet an overview of the steps needed to accept live payments.\nCreate your test account.\n\nAfter you have created your test account:\n\nGet your API key.\nGet your client key.\nSet up webhooks to know the payment outcome.\n\nWe provide server-side API libraries for several programming languages, available through common package managers, like Gradle and npm, for easier installation and version management. Our API libraries will save you development time, because they:\n\nUse an API version that is up to date.\nHave generated models to help you construct requests.\nSend the request to Adyen using their built-in HTTP client, so you do not have to create your own.\n\n\n\n    \n        \n        \n    \n\n\nBuild the server\nYou'll first implement the back end to make sure your server is ready for the checkout process.\nInstall dependencies\nThe integration on this page uses Node.js and Express, with Handlebars templating. For a smoother integration experience, the examples on this page use the following libraries as well:\n\n\n\nnpm package\nDescription\n\n\n\n\nexpress-handlebars\nHandlebars template (view) engine for Express.\n\n\nuuid\nCreates unique identifiers in RFC4122 UUID format.\n\n\n\nIn the root of your project, install the dependencies:\n\n    \n\nConfigure the server\nAfter installing the dependencies, import the modules and configure the Adyen client in your server file (we use index.js in this example). Provide your API key as a string in the boilerplate code or fetch it from the environment. You can use a library like dotenv to load environment variables when the application loads.\n\n    \n\nNext, you'll expose a few API endpoints on your server to support different points in the checkout process.\nGet available payment methods\nThe first point in the checkout process: the shopper is ready to pay and looks to select a payment method.\nTo get the available payment methods for the shopper, expose an endpoint on your server by creating a GET route to \/api\/getPaymentMethods. When this endpoint is accessed, the instance of checkout will make a call to Adyen's  \/paymentMethods endpoint.\nPass in your merchantAccount and channel:Web. You can also specify amount and countryCode parameters&mdash; we use these to limit the list of available payment methods.\nNext, pass the entire JSON response from your server back to your client.\n\n    \n\nAn array of available payment methods is returned in the response, each with a name and type. Drop-in uses the response to show the available payment methods to the shopper.\n\n    \n\n\nWe'll revisit this response object later on the client side when we configure Drop-in.\n\nInitiate a payment\nAt this point in the checkout process, the shopper selects a payment method, enters their payment details, and selects the Pay button.\nTo initiate the payment, you'll expose an endpoint on your server by creating a POST route to \/api\/initiatePayment. When this endpoint is accessed, a call will be made to Adyen's  \/payments endpoint.\nIn our example, the shopper selects to pay with their card. Specify the amount, reference, merchantAccount, paymentMethod, channel, returnUrl, and browserInfo in the request body. Note that the values of certain parameters, such as browserInfo and paymentMethod, represent data passed from the client when performing the fetch() request.\nA sample request for a credit card payment (with 3D Secure redirect authentication) of 10 EUR:\n\n    \n\nIf the response contains an action object, this means that additional client-side actions are required to complete the payment. As shown above, you'll pass the response from the server to the client, where it will be handled by Drop-in. You'll also temporarily save paymentData (for example, in a database, or in a cache as shown in this example). You'll need to include the paymentData in your next API request to check the payment result in case of a page redirection.\n\n    \n\n\nWe'll revisit this action object later on the client side when we configure Drop-in to handle the action.\n\nIf there's no action object in the response, no additional actions are needed to complete the payment. This means that the transaction has reached a final status (for example, in a 3D Secure scenario, the transaction was either exempted or out-of-scope for 3D Secure authentication). Pass the response to your client &mdash; you'll use this to present the payment result to your shopper.\nHandle the redirect\nAt this point in the checkout process, the shopper has been redirected to another site to complete the payment, and back to your returnUrl using either an HTTP POST or GET. This redirection is a result of Drop-in performing the action.type: redirect specified in the   \/payments response.\nAfter the shopper is redirected back, you need to verify or complete the payment using data from the redirected page. You'll do that by exposing two more endpoints on your server, representing a GET and POST route to \/api\/handleShopperRedirect.\nWhen either endpoint is accessed, a call will be made to Adyen's  \/payments\/details endpoint. In the request, specify:\n\npaymentData: the value from the  \/payments response.\ndetails: data returned from redirected page.\n\n\n    \n\nYou'll receive a response with a pspReference and a resultCode, the latter of which can be used to present the payment result to the shopper.\nSuccessful response\n{\n \"pspReference\": \"NC6HT9CRT65ZGN82\",\n \"resultCode\": \"Authorised\"\n}\nIf you receive another action object in the response, pass this back to the client again.\n\nWe'll configure the Drop-in to handle additional actions in case you receive more action objects in the response.\n\nHandle other additional details\nFor some payment flows, the shopper needs to perform additional steps without leaving your website. For example, this can mean scanning a QR code, or completing a challenge in case of native 3D Secure 2 authentication.\nTo handle submitting these additional details, you'll expose another endpoint on your server by creating a POST route to \/api\/submitAdditionalDetails. Similar to \/api\/handleShopperRedirect above, specify details and paymentData parameters in the call to Adyen's  \/payments\/details endpoint. Note that this time, the shopper stays in your website so there is no view redirect logic in the server. Instead, any additional action objects are passed back to the client. The result code is also passed to the client, and this will be used to present the payment result to the shopper.\n\n    \n\n\nWe'll configure the Drop-in to handle additional actions in case you receive more action objects in the response.\n\nHandle result codes\nWhen working with payment methods involving a page redirect, we handled the redirect logic in the server. In all other cases, however, result codes will be handled in the client, where you can present the payment outcome for your shopper. We'll take a look at the logic for handling result codes next when we build the client.\nBuild the client\nAfter implementing the server-side code, we'll now implement an interactive UI component on the front end of your application.\nAdd the Drop-in script and styles\nTo add Drop-in to your checkout page, install the Adyen Web Node package or use a &lt;script&gt; tag:\n\n\n    \n        \n        \n    \n\n\nCreate the container element\nNext, create a DOM element on your checkout page with a descriptive id value. Place this element where you want Drop-in to be rendered on the page.\n&lt;!-- payment.handlebars --&gt;\n\n&lt;div id=\"dropin-container\"&gt;&lt;\/div&gt;\nLater on, we'll mount Drop-in to this container.\nConnect to your server\nAt this point, your server is already built to make the necessary API calls to Adyen corresponding to all shopper interactions at checkout. You'll handle this on the front end by building functions for any client-server interactions.\nFirst, define a function that calls your server endpoints and passes JSON-stringified data from the client. We'll call this function callServer. The function uses a JavaScript fetch() request to communicate with the server. We'll later pass the url parameter based on which endpoint is requested, for example \/api\/initiatePayment or \/api\/submitAdditionalDetails.\n\n    \n\nNext, we need a function that determines how to handle the responses sent from the server to the client. We'll call this function handleServerResponse. The function first checks for an action object in the API response, which Drop-in will handle. If there is no action object in the API response, use the resultCode to present the payment result to your shopper. For a full list of result codes, refer to Result codes.\n\n    \n\nWe'll use these functions to create a flexible event handler on the page.\nCreate the event handler\nDuring the checkout process, we need to handle certain events such as when the shopper clicks the Pay button, or when additional information is required to complete the payment.\nWe can wrap the above client-server functions nicely in a single, reusable function. We'll call this function handleSubmission. The function calls the server at the provided endpoint and passes the payment data.\n\n    \n\nAfter the request is resolved, Drop-in handles the data returned in the Adyen API response.\nConfigure Drop-in\nAfter building the client-server interaction, we'll now configure and instantiate Drop-in.\nCreate a configuration object with the following parameters:\n\n\n\nParameter name\nRequired\nDescription\n\n\n\n\npaymentMethodsResponse\n\nThe response from your \/api\/getPaymentMethods request.\n\n\nclientKey\n\nPublic key used to authenticate requests from your web environment.  For more information, refer to client side authentication.\n\n\nlocale\n\nThe shopper's locale. This is used to set the language rendered in the UI. For a list of supported locales, see\u00a0Localization.\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\nonSubmit\n\nAssign the reusable event handler handleSubmission with your \/api\/initiatePayment endpoint. The onSubmit event is called when the shopper selects the Pay button.\n\n\nonAdditionalDetails\n\nAssign the reusable event handler handleSubmission with your \/api\/submitAdditionalDetails endpoint. The onAdditionalDetails event is called if no final state was reached, or additional details are required.\n\n\npaymentMethodsConfiguration\n\nRequired or optional configuration for specific payment methods. For more information about payment method-specific configurations, refer to our payment method guides.\n\n\n\nFor our cards example, we'll include optional configuration - such as showPayButton, hasHolderName, holderNameRequired, name, and amount. For a full list of configurable fields, refer to optional Card configuration.\nLet us create this inside an async function so that we can call other async functions with the await syntax.\n\n    \n\nInstantiate and mount Drop-in\nAfter all the configuration are set, you are ready to instantiate your Drop-in. Create an instance of AdyenCheckout with your newly-created configuration object. You'll use the returned value to create and mount the instance of your UI Drop-in. Finally invoke the initCheckout function and we are done.\nasync function initCheckout() {\n  try {\n    \/\/ ...\n    const configuration = \/\/ ...\n\n    const checkout = new AdyenCheckout(configuration);\n    checkout.create(\"dropin\").mount(document.getElementById(\"#dropin-container\"));\n  } catch (error) {\n    \/\/ ...\n  }\n}\n\ninitCheckout();\nYou can checkout the full Node.js example integration on our GitHub examples repository.","type":"page","locale":"en","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Online payments","lvl2":"Build your integration","lvl3":"Advanced flow integration guide","lvl4":"Drop-in tutorial: Node.js + Express"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/online-payments","lvl2":"https:\/\/docs.adyen.com\/online-payments\/build-your-integration","lvl3":"https:\/\/docs.adyen.com\/online-payments\/build-your-integration\/advanced-flow","lvl4":"\/online-payments\/build-your-integration\/advanced-flow\/web-drop-in-tutorial"},"levels":5,"category":"Online Payments","category_color":"green","tags":["Drop-in","tutorial:","Node.js","Express"]},"articleFiles":{"github-icon.png":"<img alt=\"\" src=\"https:\/\/docs.adyen.com\/media\/178050b23d30d01b542e4e6f8996018f4f727a18930384b588d2b7fcdabde69f.png\" \/>"}}
