> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Your Composable Storefront with Adyen

> Install and set up the Adyen Composable Storefront package.

This page guides you through the steps to set up your Salesforce Composable Storefront integration with Adyen.

## Salesforce Composable Storefront package

Use our Composable Storefront package for accepting payments

### Before You Begin

## Requirements

Before you begin, take into account the following requirements, limitations, and preparations.

| Requirement | Description |
| - | - |
| **Integration type** | Use this page to build an integration with our Salesforce Composable Storefront package. |
| **Supported versions** | [Salesforce PWA Kit](https://help.salesforce.com/s/articleView?id=sf.b2c_pwa_kit_release_notes_archive.htm\&type=5) v3.12.0 and later Node v22 or later npm v11 or later |
| **Setup steps** | Before you begin, complete the following steps on the Salesforce side: Set up a Salesforce sandbox connected to your Salesforce Commerce Cloud (SFCC) instance. Set up your environments, [sites](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-managing-sites-for-dev.html), [locales and currencies](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-localization.html), and [product inventories](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-inventory-for-developers.html). Set up your [WebDAV authentication](https://help.salesforce.com/s/articleView?id=cc.b2c_webdav_authentication_and_authorization.htm\&type=5) credentials. Reach out to your Salesforce account team and enable [Managed Runtime (MRT)](https://runtime.commercecloud.com/login) on your SFCC instance. [Set your MRT permissions to **Admin**](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/managed-runtime-administration.html#change-a-users-role). Review the [configuration file](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/configuration-options.html) structure of the Salesforce PWA kit. Enable [Customization with Hooks](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html) in Salesforce. |

### Install-The-Cartridge

## Step 1: Install the cartridge and import the metadata

The npm package for the Composable Storefront integration works together with a cartridge for the Salesforce Commerce Cloud (SFCC) cartridge. The companion cartridge extends your Salesforce Business Manager with additional functionality that lets you use Adyen features that are not supported by the Salesforce B2C Commerce API [(SCAPI)](https://developer.salesforce.com/docs/commerce/commerce-api/guide/get-started.html).

* The metadata files in the cartridge handle the necessary configurations:

  * **[Payment configuration](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/tree/main/metadata/site_import/sites/RefArch)**: Defines the Adyen payment processor, enabling card payments and various alternative payment methods.
  * **[System Object extensions](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/main/metadata/site_import/meta/system-objecttype-extensions.xml)**: Extends standard objects like Basket, OrderPaymentInstrument, and PaymentTransaction to store Adyen-specific payment data.
  * **[Job schedules](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/main/metadata/site_import/jobs.xml)**: Includes the jobs that processes pending webhooks, and the jobs that clean up the processed webhooks.

* The cartridge creates custom SCAPI endpoints in the Business Manager to handle payment flows.

  * **[Notify endpoint](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/main/packages/int_adyen_PWA/cartridge/rest-apis/adyen-notify/schema.yaml)**: Receives the incoming Adyen webhook data and securely stores it in the Business Manager for later processing by the scheduled job.
  * **[Create Order endpoint](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/main/packages/int_adyen_PWA/cartridge/rest-apis/adyen-shopper-order/schema.yaml)**: Creates an order and assigns it an order number, so that the number can be used when making a payment. This is required for gift card payments.
  * **[Get Order endpoint](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/main/packages/int_adyen_PWA/cartridge/rest-apis/adyen-order/schema.yaml)**: Retrieves order details for an order when it is created.

* The cartridge creates a custom SCAPI hook in the Business Manager that automatically generates and manages order numbers to prevent conflicts.

To set up the cartridge:

1. Download the cartridge from our [GitHub repository](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa).

2. In your cartridge's root directory, create a `dw.json` file that includes the information required to establish a server connection and the code version that you want to upload your cartridge to. Read more about [WebDAV authentication](https://help.salesforce.com/s/articleView?id=cc.b2c_webdav_authentication_and_authorization.htm\&type=5) in the Salesforce documentation.

   **Example dw\.json file**

   ```json theme={null}
   {
   "hostname": "YOUR-SANDBOX-HOSTNAME.demandware.net",
   "username": "*@example.com",
   "password": "YOUR_WEBDAV_ACCESS_KEY",
   "code-version": "VERSION_TO_UPLOAD_TO"
   }
   ```

3. From your cartridge's root directory, install Node modules using your command line.

   ```sh theme={null}
   npm install
   ```

4. Run the following to generate output that is compatible with JavaScript ES5.\
   The source files in the **/src** directory use modern Javascript ES6+ syntax and modern tooling that Salesforce Commerce Cloud does not natively support.

   ```sh theme={null}
   npm run build
   ```

5. To add new configuration items, import the predefined metadata:

   1. Open the **adyen-salesforce-headless-commerce-pwa/metadata/site\_import/sites/** folder.
   2. Rename the **yourSiteId** (RefArch) folder to the ID of your site in your Salesforce Business Manager.
   3. Open the **adyen-salesforce-headless-commerce-pwa/metadata/site\_import/jobs.xml** file.
   4. Rename the `site-id` to the ID of your site in your Salesforce Business Manager.
   5. Zip the site\_import folder.
   6. In the Business Manager, go to **Administration** > **Site Development** > **Site Import & Export** and import the zipped file.

6. In the Business Manager, go to **Administration** > **Sites** > **Manage Sites** > **\[yourSite]** > **Settings**.

7. In the Cartridges box, enter **int\_adyen\_PWA**, to set up the cartridge path. Select **Apply**.

### Build Pwa App

## Step 2: Build your local PWA app

To use Adyen as the payment processor for your PWA app, you need to generate a new PWA project.

1. Initiate the [Salesforce PWA Kit](https://github.com/SalesforceCommerceCloud/pwa-kit) starter project with the following command:

   ```js theme={null}
   npx @salesforce/pwa-kit-create-app
   ```

   The command-line interface guides you through the setup. While you set up your project, you are asked to link the generated retail app to a demo sandbox or your own sandbox.

2. Only if you link the retail app to your own sandbox, enter the following details at the command prompt when creating the new app:

   * Sandbox URL
   * [Shopper Login and API Access Service (SLAS)](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas.html) client ID
   * [Site (storefront) ID](https://developer.salesforce.com/docs/commerce/commerce-api/guide/commerce-api-configuration-values.html)
   * [Organization (Org) ID](https://developer.salesforce.com/docs/commerce/commerce-api/guide/commerce-api-configuration-values.html)
   * [Short code](https://developer.salesforce.com/docs/commerce/commerce-api/guide/commerce-api-configuration-values.html)

3. Launch your retail app with the following command:
   ```js theme={null}
   npm run start
   ```

### Install Package

## Step 3: Install the Adyen package in your local PWA app

1. In the root directory of your PWA app, install the [Adyen Salesforce PWA npm package](https://www.npmjs.com/package/@adyen/adyen-salesforce-pwa?activeTab=readme):

   ```js theme={null}
   npm install @adyen/adyen-salesforce-pwa
   ```

2. In your PWA app, adjust the `overrides/app/ssr.js` file to import Adyen routes. You must import routes in the following order:

   1. Adyen routes. Add the following line:

      ```js theme={null}
      import {registerAdyenEndpoints} from '@adyen/adyen-salesforce-pwa/dist/ssr/index.js'
      ```

   2. Default Salesforce routes.

   3. Custom routes. We recommend you integrate and test the package without [customizations](https://adyen-preview.mintlify.site/plugins/salesforce-commerce-cloud/composable-storefront/customization-guide.md) first.

3. In the `overrides/app` folder of your Retail React app:

   1. Override the `checkout/partials/payment.jsx` file to render the `AdyenCheckout` component from the `adyen-salesforce-pwa` package. In the next step, you need to [configure](#configure) some required properties for the component.

      ```jsx theme={null}
      import React, {useEffect, useState} from 'react'
      import {useAccessToken, useCustomerId, useCustomerType} from '@salesforce/commerce-sdk-react'
      import {useCurrentBasket} from '@salesforce/retail-react-app/app/hooks/use-current-basket'
      import useMultiSite from '@salesforce/retail-react-app/app/hooks/use-multi-site'
      import useNavigation from '@salesforce/retail-react-app/app/hooks/use-navigation'
      import {useToast} from '@salesforce/retail-react-app/app/hooks/use-toast'
      import {AdyenCheckout, pageTypes} from '@adyen/adyen-salesforce-pwa'
      import LoadingSpinner from '@salesforce/retail-react-app/app/components/loading-spinner'
      ```

      See the [file in our example package on GitHub](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/main/packages/adyen-retail-react-app/overrides/app/pages/checkout/partials/payment.jsx).

   2. Override the `checkout/confirmation.jsx` file to wrap the Salesforce checkout confirmation page with the `AdyenCheckout` and `AdyenCheckoutProvider` from the `adyen-salesforce-pwa` package. [See how you can render the components in our GitHub](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/main/packages/adyen-retail-react-app/overrides/app/pages/checkout/confirmation.jsx).

   3. Create an error page and register it in `routes.jsx` as `checkout/error`. See the [example error page on GitHub](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/develop/packages/adyen-retail-react-app/overrides/app/pages/checkout/error/index.jsx).

   4. Create a redirect page and register it in `routes.jsx` as `checkout/redirect`. See the [example redirect page on GitHub](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/develop/packages/adyen-retail-react-app/overrides/app/pages/checkout/redirect/index.jsx).

   See the [`routes.jsx`file on GitHub](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/main/packages/adyen-retail-react-app/overrides/app/routes.jsx) to see how you can register pages.

4. In your `package.json` file, add the following scripts:

   ```json theme={null}
   "upload-env": "upload-env",
   "get-env": "get-env",
   "start:env": "include-env -p=npm run start",
   "push:env": "include-env -p=npm run push"
   ```

5. Run the integration:

   ```js theme={null}
   npm run start :env
   ```

### Configure

## Step 4: Configure the checkout component

The `AdyenCheckout` component requires certain properties. You can use optional properties to [customize your integration](https://adyen-preview.mintlify.site/plugins/salesforce-commerce-cloud/composable-storefront/customization-guide.md).

On the `overrides/app/checkout/partials/payment.jsx page`, where you render the AdyenCheckout component, configure the following properties.

| Property | Required | Description |
| - | - | - |
| `authToken` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The shopper authentication token. This is used for server-side API calls, such as fetching the basket and communicating between Adyen and Salesforce. Get this from the `useAccessToken` hook. |
| `site` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The site configuration object from the `useMultiSite` hook. It includes details like site properties and environment variables needed to query endpoints. |
| `locale` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The locale configuration from the `useMultiSite` hook, passed from Salesforce, which provides the locale to the component. |
| `navigate` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The navigation function from the `useNavigation` hook. This function is passed to the component for handling redirection after a payment, for example redirecting to the confirmation page on success, or an error page. |
| `basket` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The current shopper’s basket object from the `useCurrentBasket` hook. The amount of the basket is used to determine the available payment methods. |
| `returnUrl` | | URL to where the shopper should be taken back to after a redirection. The URL can contain a maximum of 1024 characters and should include the protocol: `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value.The URL must not include personally identifiable information (PII), for example name or email address. |
| `customerId` | | The Customer ID for authenticated users. This is used to display saved payment methods. |
| `isCustomerRegistered` | | Whether the shopper is logged-in. When set to **true**, if the shopper has saved payment methods, they will be displayed at checkout. The default is **false**. |
| `page` | | The page of your PWA storefront where you render the available payment methods. Possible values are **checkout**, **confirmation**, or **redirect**. The default is **checkout**. |
| `beforeSubmit` | | A function, or array of functions called before the shopper selects the pay button. Set to **false** to prevent payment submission. |
| `afterSubmit` | | A function, or array of functions called after the payment is completed. successful payment. Receives the payment result. |
| `beforeAdditionalDetails` | | A function, or array of functions called before handling additional actions, when a payment method requires more details. For example, for native 3D secure 2 authentication, or a QR code payment method. |
| `afterAdditionalDetails` | | A function, or array of functions called after handling additional actions. |
| `onError` | | A function, or array of functions called when an error occurs. |
| `onStateChange` | | A function, or array of functions called when the payment component state changes. Receives the state object. |
| `spinner` | | Custom loading spinner component in ReactNode format. It is shown when the component is fetching data, for example when the component makes an API call to get the available payment methods. |
| `dropinConfiguration` | | Includes the additional configuration for Drop-in, and the `paymentMethodsConfiguration`. Find all the optional configuration fields in in our [Weh Drop-in integration guide](https://adyen-preview.mintlify.site/online-payments/build-your-integration/advanced-flow.md#drop-in-configuration). |
| `paymentMethodsConfiguration` | | Payment method specific configuration to customize certain payment methods. [Our payment method guides](https://adyen-preview.mintlify.site/payment-methods) show the available configurations for each method. |
| `translations` | | A map of keys and strings including custom translations. In this object, specify the `locale` you want to customize, and add key-value pairs for the text you want to customize. We include UI localizations for some languages. The fields and text are in the files for the [included locales in Drop-in](https://github.com/Adyen/adyen-web/tree/main/packages/server/translations). |

**Example AdyenCheckout configuration**

```javascript theme={null}
<AdyenCheckout
    authToken={authToken}
    site={site}
    locale={locale}
    navigate={navigate}
    basket={basket}

    returnUrl={${window.location.origin}/checkout/confirmation}

    // Callbacks to add functions that are called when a specific event happens
    beforeSubmit={[validateBillingAddress, validateBasket]}
    afterSubmit={[trackPayment, sendConfirmationEmail]}
    beforeAdditionalDetails={[log3DSStart]}
    afterAdditionalDetails={[log3DSComplete]}
    onError={[logError, showErrorToast]}
    onStateChange={trackPaymentState}

    // Additional configuration for Drop-in
    dropinConfiguration={
        openFirstPaymentMethod: true,
        showStoredPaymentMethods: true,
        instantPaymentTypes: ['applepay', 'googlepay']
    }
    paymentMethodsConfiguration={
        // Configurations for payment methods
        card: {
            hasHolderName: true,
            holderNameRequired: true,
            enableStoreDetails: true
        }
    }
    translations={
        'en-US': {
            'payButton': 'Complete Purchase'
        }
    }
/>
```

### Back Button

## Step 5 (Optional): Handle the browser back button

For a better user experience when shoppers navigate away from a redirect payment page, you can implement the following hooks:

* `useHandleBackNavigation`: This hook handles the cleanup when a shopper uses the browser's back button to navigate from a redirect payment page back to the checkout page, to prevent orphaned orders and ensure proper state management.\
  The flow is as follows: The hook detects the navigation change and automatically calls the backend cleanup endpoint. This fails any pending Salesforce orders and recreates the basket. The shopper can return to the checkout later without conflicts.

* `useCheckoutErrorRecovery`: This hook detects checkout failures, refetches the basket, and forces a clean remount of the AdyenCheckout component.\
  The flow is as follows: When a payment fails, the backend automatically fails the Salesforce order, creates a new basket with the same items, and redirects to `/checkout?newBasketId={newBasketId}`. The hook detects the `newBasketId` and automatically navigates to `/checkout?error=true`, refetches the basket with the newly created basket data, and increments `adyenCheckoutKey` to force a clean remount. The shopper sees a clean checkout state with the recreated basket.

Implementing these hooks is recommended. They work with the standard checkout flow as well as the express checkout flow.

To implement these hooks:

1. Import the hooks.

   ```js theme={null}
   import {
     useHandleBackNavigation,
     useCheckoutErrorRecovery
   } from '@adyen/adyen-salesforce-pwa'
   ```

2. To handle the back navigation cleanup, add `useHandleBackNavigation` to your checkout page component, specifying the following properties for this hook:

   | Property | Type | Required | Description |
   | - | - | - | - |
   | `authToken` | String | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The customer authentication token. |
   | `customerId` | String | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The ID of the customer. |
   | `basketId` | String | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The ID of the current basket. |
   | `site` | Object | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The site configuration object. |
   | `navigate` | Function | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The React Router navigate function. |

   ```js theme={null}
   const CheckoutPage = () => {
     const {data: basket, refetch: refetchBasket} = useCurrentBasket()
     const customerId = useCustomerId()
     const {getTokenWhenReady} = useAccessToken()
     const navigate = useNavigation()
     const {locale, site} = useMultiSite()
     const [authToken, setAuthToken] = useState()

     useEffect(() => {
         const getToken = async () => {
             const token = await getTokenWhenReady()
             setAuthToken(token)
         }
         getToken()
     }, [])

     // Handle browser back navigation cleanup
     useHandleBackNavigation({
         authToken,
         customerId,
         basketId: basket?.basketId,
         site,
         navigate
     })

     // ... rest of component
   }
   ```

3. To handle checkout error recovery, add `useCheckoutErrorRecovery` to your payment component, specifying the following properties for this hook:

   | Property | Type | Required | Description |
   | - | - | - | - |
   | `refetchBasket` | Function | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The function to refetch the current basket. |
   | `navigate` | Function | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The React Router navigate function. |

   ```js theme={null}
   const Payment = () => {
     const {data: basket, refetch: refetchBasket} = useCurrentBasket()
     const navigate = useNavigation()

     const {adyenCheckoutKey, isRefetchingBasket} = useCheckoutErrorRecovery({
         refetchBasket,
         navigate
     })

     return (
         <AdyenCheckout
             key={adyenCheckoutKey}  // Forces remount on error recovery
             // ... other props
         />
     )
   }
   ```

   The `useCheckoutErrorRecovery` hook returns the following:

   | Return value | Type | Description |
   | - | - | - |
   | `adyenCheckoutKey` | Number | A key to force a remount of AdyenCheckout. |
   | `isRefetchingBasket` | Boolean | The loading state while the basket is refetched. |

### Set Up Locales

## Step 6: Set up locales in your PWA app

The `config/default.js` file in the PWA Retail React app contains the locale definitions for your sites. You need to update this file with the locales you want to support in your Salesforce Commerce Cloud site:

1. In the PWA Retail React app package, go to the `config/default.js` file.

2. Set the following fields:

   | Field | Description |
   | - | - |
   | `supportedCurrencies` | The array of all currencies for the locales you have set up. |
   | `defaultCurrency` | The default currency for your site. |
   | `defaultLocale` | The default locale for your site. |
   | `supportedLocales` | The array for all locale objects. Each locale object consists of: `id`: the locale ID, for example **en-US**. `preferredCurrency`: the currency for the locale, for example: **USD**. `alias` (optional): You can use this attribute if you want to use other string instead of the `id`. |

   See the [PWA integration with the Adyen package on GitHub](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/blob/c32b81aedb296896b718cede348740455a3405d0/packages/adyen-retail-react-app/config/sites.js) to see an example locale configuration.

3. In the `config/default.js` file, change the local attribute from **none** to **query\_param** or **path** to display the locale in the URL.

4. Only if you defined the `alias` field for locales, in the `config/default.js` file, remove the comment markers for `siteAliases`, and provide the aliases for your sites.

### Generate Api Key

## Step 7: Generate an Adyen API Key

If you already have an SFCC integration with Adyen using Store Front Reference Architecture (SFRA) or SiteGenesis, you do not have to generate a new API Key and you can skip this step.

To connect your PWA store to the Adyen APIs, you need to generate an API key in your Adyen Customer Area and [add it to the package configuration when you set environment variables](#set-environment-variables) in a later step.

1. Log in to your [Customer Area](https://ca-test.adyen.com/) and select your **Company** account.

2. Go to **Developers** > **API credentials**.

3. Select the **Payments** or **Platforms** tab, depending on your integration type.

4. Select the credential username.

5. Under **Server settings** > **Authentication** select the **API key** tab.

6. Select **Generate API key**.

7. Select the copy icon \*\*and store your API key securely in your system.

   You cannot copy the API key again after you leave the page.

8. Select **Save changes**.

### Webhooks

## Step 8: Set up webhooks

Adyen uses [webhooks](https://adyen-preview.mintlify.site/development-resources/webhooks.md) to inform your Salesforce Commerce Cloud store of payment status changes.

In Salesforce Commerce Cloud, webhooks are stored as custom objects that get processed by scheduled jobs. The jobs and custom objects are set by the `int_adyen_PWA` cartridge that you installed. You first need to [set up webhooks in the Adyen Customer Area](#set-up-webhooks-in-the-customer-area), then you can [configure the jobs](#configure-jobs) to process the webhooks in Salesforce.

### Set up webhooks in the Customer Area

1. In your [Customer Area](https://ca-test.adyen.com/), go to **Developers** >  **Webhooks**. If you want to configure webhooks for a merchant account, switch to that merchant account.

2. Select \*\***Webhook**.

3. From the list of webhooks, next to **Standard webhook**, select **Add**.

4. Under **General**, configure the following:

   | Setting | Description |
   | - | - |
   | **Enabled** | Select the toggle to enable or disable the webhook. |
   | **Version** | The webhook version. |
   | **Description** | Your description of the webhook. |

5. Under **Server configuration**, configure the following:

   | Setting | Description |
   | - | - |
   | **URL** | Your website URL followed by **/api/adyen/webhook?siteId=YOUR\_SITE\_ID**. |
   | **Method** | **JSON** |
   | **Encryption protocol** | **TLSv1.3** |

6. Under **Security**, configure the following:

   | Setting | Description |
   | - | - |
   | **Basic authentication** | Enter your server's username and password. You need to enter these credentials when [setting environment variables](#set-environment-variables) later. |
   | **HMAC Key** | Generate the HMAC Key, copy it, and store it securely in your system. You need to enter the key when [setting environment variables](#set-environment-variables) later. Learn more about [verifying HMAC signatures](https://adyen-preview.mintlify.site/development-resources/webhooks/secure-webhooks/verify-hmac-signatures.md#enable-hmac-signatures). |

7. Under **Events** settings, select the checkbox for the **OFFER\_CLOSED** [event code](https://adyen-preview.mintlify.site/development-resources/webhooks/webhook-types#event-codes).

8. If the **Additional settings** section is available, optionally select the additional information you want to receive in this webhook. Some webhook types do not support more than one event code, so this section does not appear.

9. Select **Save configuration**.

The package implements the [AUTHORISATION](https://docs.adyen.com/api-explorer/Webhooks/1/post/AUTHORISATION) webhook by default. If you want to receive webhooks for [more payment events](https://adyen-preview.mintlify.site/development-resources/webhooks/webhook-types#event-codes), you can [customize](https://adyen-preview.mintlify.site/plugins/salesforce-commerce-cloud/composable-storefront/customization-guide.md) your integration after you have successfully [deployed your application in MRT](#deploy-to-mrt) and [completed testing](#test-your-integration) without any customizations.

You cannot test Adyen webhooks on localhost.

### Configure scheduled jobs in Salesforce

Webhooks are stored in Salesforce Commerce Cloud as custom object instances to be processed by scheduled jobs.

After the metadata import, a scheduled job with ID Process is added to the Salesforce Business Manager > **Administration** > **Operations** > **Jobs**. This scheduled job has two steps that you can check under **Job Steps**.

* **Process** – Processes the webhook and updates the payment status of the order.
* **Clean** – Deletes the custom object instance, once it has been processed.

To optimize the processing of your instances, we recommend that you set the frequency of this scheduled job to 1 minute:

1. Go to the **Schedule and History** tab for the **Process** scheduled job.
2. Set **Trigger** to **Recurring Interval**.
3. In the **Run Time** pane, set **Amount** to **1**, and **Interval** to **Minutes**.

### Deploy In Managed Runtime

## Step 9: Deploy your application in Managed Runtime

[Salesforce's Managed Runtime (MRT)](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/mrt-overview.html) provides the infrastructure to deploy, host, and monitor your PWA Kit application.

Managed Runtime only supports applications created from a PWA Kit template and has a separate [admin dashboard](https://runtime.commercecloud.com/login). Before you can use MRT and Runtime Admin, Salesforce must enable it for your organization. To enable MRT and Runtime Admin for your organization, reach out to your Salesforce account team.

When building your storefront, keep the [constraints of MRT environments](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/mrt-overview.html#constraints) in mind.

### 1. Create a new project in Managed Runtime

Follow the steps to [create a project in Runtime Admin](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/managed-runtime-administration.html#create-a-project). Use the following details for your project:

| Field | Value |
| - | - |
| **Project Name** | **adyen-salesforce-headless-commerce-pwa** |
| **Project ID** | Project IDs must match the package name in the `package.json` file and can not be longer than 20 characters. |
| **Scopes** | The [list of scopes](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html) that are used to fetch baskets and create orders. |

### 2. Set up the MRT environment

Set up an environment to separate your production storefront from other storefronts, such as development or testing storefronts. Refer to [environments in Salesforce docs](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/mrt-overview.html#environments) to learn more about environments.

* Follow the [steps to create an environment in Salesforce Docs](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/managed-runtime-administration.html#environments).\
  **Name**: use your Sandbox Org ID to easily identify an environment that belongs to a sandbox, and to create variables correctly for each environment.\
  **Region**: we recommend to set your MRT region to the same region that your Salesforce sandbox uses.

  Your Composable Storefront integration with Adyen can only have one region connected to one MRT organization, one SFCC site, and one Adyen Customer Area account.

### 3. Set the environment variables

1. In your MRT environment, navigate to your project by selecting your **Organization** and **Project**.

2. Select **Environment Variables**.

3. Specify the values for the following variables:

   When a variable contains **YOUR\_SITE\_ID**, replace it with the same value as your Commerce API site ID.

   | Variable | Required | Description |
   | - | - | - |
   | **YOUR\_SITE\_ID\_ADYEN\_API\_KEY** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your Adyen [API key](#step-4-generate-an-adyen-api-key). |
   | **YOUR\_SITE\_ID\_ADYEN\_MERCHANT\_ACCOUNT** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your Adyen merchant account name. |
   | **YOUR\_SITE\_ID\_ADYEN\_CLIENT\_KEY** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your Adyen [client key](https://adyen-preview.mintlify.site/development-resources/client-side-authentication#get-your-client-key). |
   | **YOUR\_SITE\_ID\_ADYEN\_ENVIRONMENT** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Use **test**. When you are ready to accept live payments, change the value to **live**. |
   | **YOUR\_SITE\_ID\_ADYEN\_WEBHOOK\_USER** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The basic authentication username you entered when you [set up webhooks](#set-up-webhooks). |
   | **YOUR\_SITE\_ID\_ADYEN\_WEBHOOK\_PASSWORD** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The basic authentication password you entered when you [set up webhooks](#set-up-webhooks). |
   | **YOUR\_SITE\_ID\_ADYEN\_HMAC\_KEY** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The HMAC key you generated when you [set up webhooks](#set-up-webhooks). |
   | **YOUR\_SITE\_ID\_ADYEN\_LIVE\_URL\_PREFIX** | Only for Live environment | Your [live URL prefix](https://adyen-preview.mintlify.site/development-resources/live-endpoints.md#live-url-prefix) to process live transactions. |
   | **YOUR\_SITE\_ID\_ADYEN\_APPLE\_DOMAIN\_ASSOCIATION** | | If you want to offer Apple Pay as a payment method in the live environment, set to the [domain association file value](https://adyen-preview.mintlify.site/plugins/salesforce-commerce-cloud/composable-storefront/set-up-payment-methods.md#go-live-apple-pay). |
   | **YOUR\_SITE\_ID\_SYSTEM\_INTEGRATOR\_NAME** | | The name of your system integrator. |
   | **COMMERCE\_API\_CLIENT\_ID** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your MRT Commerce API client ID. |
   | **COMMERCE\_API\_ORG\_ID** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your MRT Commerce API Org ID. |
   | **COMMERCE\_API\_SHORT\_CODE** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your MRT Commerce API short code. |
   | **COMMERCE\_API\_SITE\_ID** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your Salesforce site ID, for example, **RefArch**. |
   | **COMMERCE\_API\_DEFAULT\_SITE** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your default Salesforce site, for example, **RefArch**. |
   | **SCAPI\_URL** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your Salesforce Commerce API URL. Refer to [Salesforce documentation](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html) for more information. |
   | **OCAPI\_URL** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your Open Commerce API Url. Refer to [Salesforce documentation](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-commerce-ocapi/urlschema.html) for more information. |
   | **ENVIRONMENT\_ID** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your MRT environment ID. |
   | **PROJECT\_ID** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your project ID, for example, **adyen-salesforce-pwa**. |
   | **COMMERCE\_API\_CLIENT\_ID\_PRIVATE** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your Salesforce Commerce API client ID. To get your API credentials, [create an API client in Salesforce](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html#create-an-api-client). |
   | **COMMERCE\_API\_CLIENT\_SECRET** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your Commerce API client secret for your [Salesforce API client](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html#create-an-api-client). |
   | **SFCC\_REALM\_ID** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your SFCC realm ID. |
   | **SFCC\_INSTANCE\_ID** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your SFCC instance ID. |
   | **SFCC\_OAUTH\_SCOPES** | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The custom Adyen SCAPI scopes, for example, **c\_order\_rw c\_notify\_rw**, and your SFCC oauth scopes, for example, **sfcc.orders sfcc.orders.rw**. You also need to add this in your Salesforce Account Manager > **API Client** > **OpenID Connect** > **Allowed Scopes**. Refer to [Salesforce documentation](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html) to learn more about authorization scopes. |
   | **YOUR\_SITE\_ID\_GIFT\_CARD\_EXPIRATION\_TIME** | | For partial payments with gift cards, the expiration time after an order is created, in minutes. The default is **30**. |
   | **YOUR\_SITE\_ID\_ADYEN\_NATIVE\_3DS** | | Controls [native 3D Secure 2 authentication](https://adyen-preview.mintlify.site/online-payments/3d-secure/native-3ds2.md) for card payments. Set to **preferred** (default) to attempt native 3DS2, or **disabled** to use the redirect flow. |
   | **YOUR\_SITE\_ID\_ADYEN\_L23\_ENABLED** | | Set to **true** to [send Level 2/3 enhanced scheme data](#level-2-3-data) for card payments. |
   | **YOUR\_SITE\_ID\_ADYEN\_L23\_COMMODITY\_CODE** | | The default [UNSPSC commodity code](https://www.unspsc.org/search-code) for Level 2/3 data. |

When [going live](https://adyen-preview.mintlify.site/plugins/salesforce-commerce-cloud/composable-storefront/go-live-checklist.md), you need to update some variables you have entered with values from your [live Customer Area](https://ca-live.adyen.com/).

### (Optional) Pass configuration through the Adyen options object

Adyen Salesforce PWA v4.3.0 and later support passing the Adyen configuration as a plain JavaScript options object to `registerAdyenEndpoints` in your `ssr.js` override, as an alternative to environment variables. This is useful when:

* Your configuration is loaded from a managed config store rather than `process.env`.
* A single hosting environment serves multiple Salesforce Commerce Cloud sites with different Adyen merchant accounts or preferences.
* You want to flip a setting per site without redeploying with new environment variables.

The two sources can be mixed. Existing deployments that rely only on environment variables continue to work without any change.

#### Resolution priority

For each configuration key, the first non-`undefined` value wins, in this order:

1. `options[<siteId>_<KEY>]` — site-specific option.
2. `process.env[<siteId>_<KEY>]` — site-specific environment variable.
3. `options[<KEY>]` — global option.
4. `process.env[<KEY>]` — global environment variable.

Only the keys listed in [Supported keys](#adyen-options-supported-keys) are read. Other keys are ignored, so you cannot accidentally leak unrelated values into the Adyen configuration.

#### Pass the options object to `registerAdyenEndpoints`

In your Retail React App `overrides/app/ssr.js`, pass an `adyenOptions` object as the fourth argument to `registerAdyenEndpoints`. The keys in the object use the same names as the corresponding environment variables.

**Pass an options object to registerAdyenEndpoints**

```javascript theme={null}
const adyenOptions = {
  // Global defaults applied to every site
  ADYEN_NATIVE_3DS: "preferred",
  SYSTEM_INTEGRATOR_NAME: "Adyen-PWA",

  // Per-site overrides (use <siteId>_ prefix)
  RefArch_ADYEN_API_KEY: "your-refarch-api-key",
  RefArch_ADYEN_MERCHANT_ACCOUNT: "RefArchMerchant",
  RefArch_ADYEN_NATIVE_3DS: "disabled",

  RefArchGlobal_ADYEN_API_KEY: "your-refarchglobal-api-key",
  RefArchGlobal_ADYEN_MERCHANT_ACCOUNT: "RefArchGlobalMerchant",
};

registerAdyenEndpoints(app, runtime, {}, adyenOptions);
```

You can also mix the options object with environment variables. For example, keep secrets such as `ADYEN_API_KEY` and `ADYEN_HMAC_KEY` in environment variables, and use the options object only for non-secret per-site overrides such as `ADYEN_NATIVE_3DS`.

#### Supported keys

| Key | Description |
| - | - |
| `ADYEN_API_KEY` | Your Adyen [API key](#step-4-generate-an-adyen-api-key). |
| `ADYEN_CLIENT_KEY` | Your Adyen [client key](https://adyen-preview.mintlify.site/development-resources/client-side-authentication#get-your-client-key). |
| `ADYEN_ENVIRONMENT` | The Adyen environment, for example **test**, **live**, or a regional live value. |
| `ADYEN_MERCHANT_ACCOUNT` | Your Adyen merchant account name. |
| `ADYEN_LIVE_URL_PREFIX` | Your [live URL prefix](https://adyen-preview.mintlify.site/development-resources/live-endpoints.md#live-url-prefix) when `ADYEN_ENVIRONMENT` is **live**. |
| `ADYEN_WEBHOOK_USER` | The basic authentication user for [webhook](#set-up-webhooks) authentication. |
| `ADYEN_WEBHOOK_PASSWORD` | The basic authentication password for [webhook](#set-up-webhooks) authentication. |
| `ADYEN_HMAC_KEY` | The [HMAC key](#set-up-webhooks) used to verify webhook signatures. |
| `ADYEN_APPLE_DOMAIN_ASSOCIATION` | The [Apple Pay domain association file value](https://adyen-preview.mintlify.site/plugins/salesforce-commerce-cloud/composable-storefront/set-up-payment-methods.md#go-live-apple-pay). |
| `ADYEN_NATIVE_3DS` | Controls [native 3D Secure 2 authentication](https://adyen-preview.mintlify.site/online-payments/3d-secure/native-3ds2.md). Set to **preferred** (default) or **disabled**. |
| `GIFT_CARD_EXPIRATION_TIME` | For partial payments with gift cards, the expiration time after an order is created, in minutes. The default is **30**. |
| `ADYEN_L23_ENABLED` | Set to **true** to [send Level 2/3 enhanced scheme data](#level-2-3-data) for card payments. |
| `ADYEN_L23_COMMODITY_CODE` | The default [UNSPSC commodity code](https://www.unspsc.org/search-code) for Level 2/3 data. |
| `SYSTEM_INTEGRATOR_NAME` | The name of your system integrator. Forwarded to Adyen for telemetry. |

To scope any of these keys to a single site, prefix the key with `<siteId>_`, for example `RefArch_ADYEN_API_KEY`.

Never log the options object as is. It can carry secrets such as `ADYEN_API_KEY`, `ADYEN_HMAC_KEY`, and `ADYEN_WEBHOOK_PASSWORD`. Treat the values like environment variables and inject them from a secret manager at runtime.

### 4. Deploy your project to MRT

To run your application, you must deploy your application to MRT and to the [environment you have set up](#set-up-the-environment). You also need a Personal MRT API Key.

1. Follow the steps to [generate a Personal MRT API key in Salesforce Docs](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pushing-and-deploying-bundles.html?q=deploy#save-your-credentials).

2. In your Retail React App, save your credentials:

   ```js theme={null}
   npm run save-credentials -- --user YOUR_EMAIL --key YOUR_PERSONAL_MRT_API_KEY
   ```

3. Push your build to MRT:

   ```js theme={null}
   npm run push:env
   ```

4. Follow the steps to [deploy the bundle in Salesforce Docs](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pushing-and-deploying-bundles.html?q=deploy#deploy-a-bundle) to the environment you have created.

### Import Country Region List

## Step 10 (Optional): Import the Adyen country/region list

Salesforce allows you to add your list of countries/regions for shipping. Optionally, you can use our default list.

To use our country/region list, in your PWA Retail React app, import the Adyen `countrylist` and export it as `SHIPPING_COUNTRY_CODES` in the `constants.js` file:

```js theme={null}
import {countryList} from '@adyen/adyen-salesforce-pwa'

export const SHIPPING_COUNTRY_CODES = countryList
```

### Level 2 3 Data

## Step 11 (Optional): Send Level 2/3 data for cards

Optional

Sending Level 2 or Level 3 Enhanced Scheme Data allows you to cut your interchange rates on US domestic transactions by up to 90 basis points. At the same time, your shoppers see additional information about their purchase on their credit card statement.

Not all businesses can submit Level 2/3 data. Refer to [What is Enhanced Scheme Data?](https://help.adyen.com/knowledge/ecommerce-integrations/integrations-basics/enhanced-scheme-data) for more information.

Sending Level 2/3 data is supported from [v4.3.0](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/releases/tag/v4.3.0) of the Adyen Salesforce PWA package.

To send Level 2/3 data, add the following [environment variables](#set-environment-variables) to your Managed Runtime environment:

| Variable | Description |
| - | - |
| **YOUR\_SITE\_ID\_ADYEN\_L23\_ENABLED** | Set to **true** to enable sending Level 2/3 data. |
| **YOUR\_SITE\_ID\_ADYEN\_L23\_COMMODITY\_CODE** | The default [UNSPSC commodity code](https://www.unspsc.org/search-code) for your products or services. |

Replace **YOUR\_SITE\_ID** with the same value as your Commerce API site ID.

### Donations

## Step 12 (Optional): Set up donations with Adyen Giving

After a successful payment, you can show the shopper one or more active donation campaigns on the order confirmation page. The shopper can contribute to a charity using the same payment method that authorized the purchase, without re-entering payment details.

Donations are supported only for payment methods that return a `donationToken` on `/payments` or `/payments/details`, for example cards and several APMs. Gift cards are not supported.

Adyen Giving is supported from [v4.3.0](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/releases/tag/v4.3.0) of the Adyen Salesforce PWA package.

### 1. Configure Adyen Giving

1. In your [test Customer Area](https://ca-test.adyen.com/), [create and activate a donation campaign](https://adyen-preview.mintlify.site/online-payments/donations#managing-donation-campaigns) for the merchant account used by your storefront. The campaign currency must match your storefront's checkout currency.
2. Subscribe your [standard webhook](#set-up-webhooks) to the [**DONATION** event](https://adyen-preview.mintlify.site/development-resources/webhooks/webhook-types#other-webhooks) so that Salesforce Commerce Cloud receives the notification when Adyen settles the donation.

No additional environment variables are required. The integration reuses the [Adyen API key and client key](#set-environment-variables) that you already configured.

### 2. Add the donation component to the order confirmation page

The Adyen Salesforce PWA package exposes an `AdyenDonations` React component that loads the active campaigns, renders the AdyenWeb `Donation` widget for each campaign, and submits the donation against the order's payment instrument.

1. Import the component:

   ```js theme={null}
   import {AdyenDonations} from '@adyen/adyen-salesforce-pwa'
   ```

2. On your order confirmation page, render `AdyenDonations` only when the order has a non-gift-card payment instrument that carries a `c_donationToken`. Specify the following properties:

   | Property | Type | Required | Description |
   | - | - | - | - |
   | `site` | Object | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The current SCAPI site object. |
   | `locale` | Object | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The locale object. The `locale.id` is forwarded to AdyenWeb and used as the `locale` query parameter when fetching campaigns. |
   | `orderNo` | String | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The order number on which the donation is charged. |
   | `onCancel` | Function | | Called when the shopper dismisses the donation widget. |
   | `onError` | Function or Array of functions | | Invoked with errors from the environment, campaigns, or `/donations` calls. |
   | `spinner` | Node | | Custom loader rendered while the environment or campaigns are loading, or while a donation is being submitted. |
   | `translations` | Object | | Locale-keyed translation overrides forwarded to AdyenWeb. |

   ```js theme={null}
   const Confirmation = () => {
      const {data: order} = useOrder(orderNo)
      const {locale, site} = useMultiSite()
      const [showDonations, setShowDonations] = useState(true)

      const hasDonationToken = order?.paymentInstruments?.some(
          (pi) => pi.c_donationToken && pi.c_paymentMethodType !== 'giftcard'
      )

      return (
          <>
              {/* ... order summary */}
              {hasDonationToken && showDonations && (
                  <AdyenDonations
                      site={site}
                      locale={locale}
                      orderNo={orderNo}
                      onCancel={() => setShowDonations(false)}
                  />
              )}
          </>
      )
   }
   ```

   The component calls `GET /api/adyen/donationCampaigns` to load active campaigns and `POST /api/adyen/donations` to submit the donation. On a successful donation, the backend clears `c_donationToken` on the payment instrument so the widget is not offered again on a page reload.

### 3. Test your integration

1. [Create and activate a test donation campaign](https://adyen-preview.mintlify.site/online-payments/donations/testing.md#create-and-activate-a-test-donation-campaign) in your test Customer Area.
2. Place a test order using a [test card](https://adyen-preview.mintlify.site/online-payments/donations/testing.md#test-cards) that supports donations.
3. On the order confirmation page, select a donation amount and confirm the donation.
4. Verify that you receive the [**DONATION** webhook](https://adyen-preview.mintlify.site/development-resources/webhooks/webhook-types#other-webhooks) for the donation.

When you are ready to go live with Adyen Giving, [create and activate a live donation campaign](https://adyen-preview.mintlify.site/online-payments/donations/testing.md#create-and-activate-a-live-donation-campaign) in your [live Customer Area](https://ca-live.adyen.com/) and enable the [Adyen Giving merchant webhook](https://adyen-preview.mintlify.site/development-resources/webhooks/webhook-types#other-webhooks).

## Migrate pages

If you already have an SFCC integration with Adyen using Store Front Reference Architecture (SFRA) or SiteGenesis, you need to migrate your store pages. If you do not have an SFCC integration with Adyen already, you can start [testing](#test-your-integration).

You can perform [Phased Headless Rollouts](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/phased-headless-rollouts.html) to migrate your SFRA or SiteGenesis pages in a phased approach.

The Adyen package uses version 8 of the [Retail React App](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/retail-react-app.html) with [template extensibility](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-to-v3.html#template-extensibility). To filter out links to non-PWA kit pages, you can override the `overrides/app/routes.jsx` file. Salesforce has [sample code on GitHub](https://gist.github.com/shethj/c9d52aa1fe4188c431336438305f8e32) that shows how to override.

If you are migrating the checkout page last, you need to route traffic to your SFRA checkout page from your PWA integration. To learn how to apply routing, refer to [Salesforce Docs](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/phased-headless-rollouts.html#routing).

### Test

## Testing

After you have installed and configured the package, use our [test cards](https://adyen-preview.mintlify.site/development-resources/test-cards-and-credentials/test-card-numbers.md) to test payments.

Check the status of test payments in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**.

## Next steps

> [card] [Set up payment methods](https://adyen-preview.mintlify.site/plugins/salesforce-commerce-cloud/composable-storefront/set-up-payment-methods.md)
>
> **Required.** Set up the payment methods that you want to offer in your Salesforce Composable Storefront.

> [card] [Customize](https://adyen-preview.mintlify.site/plugins/salesforce-commerce-cloud/composable-storefront/customization-guide.md)
>
> Check our customization guide to learn how you can modify your integration..


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.