> ## 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.

# Upgrade to Adyen Web v6

> Make the changes required to upgrade from Web Drop-in/Components v3.x.x to v6.x.x.

## Benefits to upgrading

Read our [release notes](https://adyen-preview.mintlify.site/online-payments/release-notes.md#releaseNote=2024-07-24-web-componentsdrop-in-6.0.0) to learn about the benefits of upgrading.

To upgrade from [Web Drop-in/Components](https://github.com/Adyen/adyen-web) v3.x.x to v6.0.0, complete the following steps.

If you are upgrading from a later version, you need to follow a different upgrade guide:

* [From **v4.x.x** to v6.x.x](https://adyen-preview.mintlify.site/online-payments/upgrade-your-integration/upgrade-to-web-v6/from-v4.md).
* [From **v5.x.x** to v6.x.x](https://adyen-preview.mintlify.site/online-payments/upgrade-your-integration/upgrade-to-web-v6).

## Required API version

Using Web Drop-in/Components v6.0.0 requires [Checkout API v69](https://adyen-preview.mintlify.site/online-payments/release-notes.md#releaseNote=2022-05-24-checkout-api-69) or later.

## Step 1: Use the new package

> [tab] npm (recommended)
>
> Install this version of the [Adyen Drop-in/Components Node.js package](https://www.npmjs.com/package/@adyen/adyen-web):
>
> ```bash theme={null}
> npm install @adyen/adyen-web@latest --save
> ```

> [tab] Embed script and stylesheet
>
> Find the [Subresource Integrity hashes](https://adyen-preview.mintlify.site/development-resources/live-endpoints.md#subresource-integrity-hashes) for the latest version in our [release notes](https://adyen-preview.mintlify.site/online-payments/release-notes.md).
>
> The base URLs for the script source are different for each environment. Use the one that corresponds to your [live endpoint](https://adyen-preview.mintlify.site/development-resources/live-endpoints.md#checkout-endpoints):
>
> | Environment | URL |
> | - | - |
> | Test | `https://checkoutshopper-test.cdn.adyen.com` |
> | Europe (EU) live | `https://checkoutshopper-live.cdn.adyen.com` |
> | United States (US) live | `https://checkoutshopper-live-us.cdn.adyen.com` |
> | Australia (AU) live | `https://checkoutshopper-live-au.cdn.adyen.com` |
> | Northeast Asia (NEA) live | `https://checkoutshopper-live-nea.cdn.adyen.com` |
> | India (IN) live | `https://checkoutshopper-live-in.cdn.adyen.com` |
>
> ```bash theme={null}
> <script src="https://checkoutshopper-test.cdn.adyen.com/checkoutshopper/sdk/6.0.0/adyen.js"
>      integrity="sha384-GDA6txYXS6ka6zCgDtLmgI80TQMlYST32KjDtdiyFi/k/zp9rXP64qbziIXVOI5h"
>      crossorigin="anonymous"></script>
>
> <link rel="stylesheet"
>      href="https://checkoutshopper-test.cdn.adyen.com/checkoutshopper/sdk/6.0.0/adyen.css"
>      integrity="sha384-Gngchfiq4JxdVPMOwrUaDK70raLnMJ7IgBKi2OE0VSlbUeHysN7Mwd4aHREEvEAw"
>      crossorigin="anonymous">
> ```
>
> ## Step 2: Update import statements

> [tab] Drop-in
>
> You can import Drop-in [using npm](#import-using-npm) or by [embedding the scripts](#import-using-embedded-scripts).
>
> ### Using npm
>
> Starting from Drop-in v6, we offer two ways of importing with npm:
>
> * [Import Drop-in with all payment methods](#npm-auto): this method resembles what you are used to before v6. You do not need to import individual payment methods, at the cost of a slower loading time.
> * [Import Drop-in with individual payment methods](#npm-reduced-bundle-size): this method uses tree shaking to let you import only the payment methods you use, speeding up loading time. However, adding new payment methods requires developer resources.
>
> #### Import Drop-in with all payment methods
>
> This method of importing resembles what you were used to before v6. With this method, you do not need to import every individual payment method for Drop-in. This allows for a simpler integration where adding a new payment method doesn't require any development resources.
>
> However, this results in a larger bundle size and slower loading times, as all module exports are imported client-side. If a smaller bundle size and faster page load times is a priority to you, consider importing [Drop-in with individual payment methods](#npm-reduced-bundle-size).
>
> For example, to load the Drop-in with all available payment methods:
>
> ```js theme={null}
> import { AdyenCheckout, Dropin } from '@adyen/adyen-web/auto'
> ```
>
> To add new payment methods, you only need to [add the payment method to you account](https://adyen-preview.mintlify.site/payment-methods/add-payment-methods).
>
> #### Import Drop-in with individual payment methods
>
> Our tree-shakable `@adyen/adyen-web` npm package lets your import only the Components you use. This reduces the bundle size and loading times.
>
> For example, to load the Drop-in with card payments, PayPal, Google Pay, Apple Pay and Cash App Pay:
>
> ```js theme={null}
> import { AdyenCheckout, Dropin, Card, PayPal, GooglePay, ApplePay, CashAppPay} from '@adyen/adyen-web'
> ```
>
> To add new payment methods, you need to:
>
> 1. [Add the payment methods to you account](https://adyen-preview.mintlify.site/payment-methods/add-payment-methods).
> 2. Import them (see code sample above).
> 3. Assign them to the `paymentMethodComponents` property [within the Drop-in configuration](#update-creating-an-instance).
>
> For an overview of available Components, see [The library's Component exports](https://github.com/Adyen/adyen-web/blob/main/packages/lib/src/components/index.ts). To know what Component you need for your payment methods, go to the relevant [payment method's Web Drop-in/Components page](https://adyen-preview.mintlify.site/payment-methods).
>
> ### Using embedded scripts
>
> After you [import the scripts](https://adyen-preview.mintlify.site/online-payments/upgrade-your-integration/upgrade-to-web-v6#use-the-new-package), the Drop-in/Components resources are available on the `window` global variable.
>
> Before v6, you would use the `window.AdyenCheckout()` method to create an instance of `AdyenCheckout`:
>
> **Before v6**
>
> ```js theme={null}
> const checkout = new window.AdyenCheckout({ /* Configuration */ });
> ```
>
> From v6 onwards, the `AdyenCheckout()` function is a property of `window.AdyenWeb`, alongside `Dropin` and all the payment method-specific Components:
>
> **From v6 onwards**
>
> ```js theme={null}
> const { AdyenCheckout, Dropin, Card } = window.AdyenWeb;
> const checkout = await AdyenCheckout({ /* Configuration */ });
> ```

> [tab] Components
>
> You can import Components [using npm](#import-using-npm}) or by [embedding the scripts](#import-using-embedded-scripts).
>
> ### Using npm
>
> We're introducing more granular imports for the `@adyen/adyen-web` package to let you load only the Components that you need, reducing the bundle size and improving overall performance.
>
> For example, to load only the card Component:
>
> ```js theme={null}
> import { AdyenCheckout, Card } from '@adyen/adyen-web'
> ```
>
> For an overview of available Components, see [The library's Component exports](https://github.com/Adyen/adyen-web/blob/main/packages/lib/src/components/index.ts). To know what Component you need for your payment methods, go to the payment method pages.
>
> If you do not find a specific Component for a payment method, and the payment method redirects the shopper, use the `Redirect` Component. For example, for iDEAL:
>
> **Use the Redirect Component for iDEAL**
>
> ```js theme={null}
> new Redirect(checkout, { type: 'ideal' });
> ```
>
> ### Using embedded scripts
>
> After you [import the scripts](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md#install-adyen-web), the Drop-in/Components resources are available on the `window` global variable.
>
> Before v6, you would use the `window.AdyenCheckout()` method to create an instance of `AdyenCheckout`:
>
> **Before v6**
>
> ```js theme={null}
> const checkout = new window.AdyenCheckout({ /* Configuration */ });
> ```
>
> From v6 onwards, the `AdyenCheckout()` function is and property of `window.AdyenWeb`, alongside all the payment method-specific Components:
>
> **From v6 onwards**
>
> ```js theme={null}
> const { AdyenCheckout, Card, PayPal } = window.AdyenWeb;
> ```
>
> ## Step 3: Update your configuration
>
> Make the following changes to your configuration properties:
>
> * `countryCode` is now a mandatory configuration property. Set it during the `AdyenCheckout` initialization.
>   * If you use the Sessions flow, you can also set `countryCode` in the [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request.
> * The `setStatusAutomatically` property is no longer used. To disable the Drop-in animation, set `disableFinalAnimation` to **true**.
> * You can no longer set `installmentOptions` during the `AdyenCheckout` instantiation. Set it directly in the Card configuration instead.
> * You can no longer set `paymentMethodsConfiguration` during the `AdyenCheckout` instantiation. Set it directly in the [Drop-in configuration](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md#step-4-configure-drop-in) instead.
> * The `showBrandsUnderCardNumber` property is no longer used. Update your code accordingly.
> * The `showFormInstruction` property is no longer used. Update your code accordingly.
> * If you integrate with the custom card component, use the `onValidationError()` event listener to access the field errors.
> * The `originKey` is no longer supported. Migrate to [client key](https://adyen-preview.mintlify.site/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key.md).
>
> ### Component specific configuration
>
> For certain components, some deprecated props were removed. Make sure that your integration uses the remaining props.
>
> \*\*
>
> #### Card component and Custom card component
>
> | Removed prop | Prop to use instead |
> | - | - |
> | `groupTypes` | `brands` |
> | `size` | `challengeWindowSize` |
> | `ariaLabels` | No longer supported. Use [translation fields instead](#aria-labels-in-transaltion-fields). |
>
> ##### Configure aria labels through translation fields
>
> Configuring `aria-label` attributes using the `ariaLabels` field inside the component is no longer supported. In v6, `Aria-label` attributes are read from [translation fields](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md#localization).
>
> You can no longer configure the `label` property, the label is added automatically, aligning with the visual label for the field. This is to follow [accessibility](https://adyen-preview.mintlify.site/online-payments/accessibility.md) best practices.
>
> **Before v6**
>
> ```js theme={null}
> const customCard = checkout.create('securedfields', {
>   ...
>   ariaLabels: {
>     lang: "en-US",
>     encryptedCardNumber: {
>       label: "Card number field",
>       iframeTitle: "Iframe for secured card number"
>     },
>     ...
>   }
>   ...
> }).mount('#customCard-container');
> ```
>
> **From v6 onwards**
>
> ```js theme={null}
> const checkout = await AdyenCheckout({
>     locale: 'en-US',
>     translations: {
>         'en-US': {
>             "creditCard.encryptedCardNumber.aria.iframeTitle": "Iframe for secured card number",
>         }
>     }
>     /* ...Your other configurations  */
> });
> ```
>
> \*\*
>
> #### Apple Pay component
>
> | Removed prop | Prop to use instead |
> | - | - |
> | `amount` | No longer needs to be configured. The Drop-in/Component takes this from the `amount.value`, passed to `AdyenCheckout`. |
> | `currencyCode` | No longer needs to be configured. The Drop-in/Component takes this from the `amount.currency`, passed to `AdyenCheckout`. |
> | `configuration.merchantDisplayName` | No longer needs to be configured. This value is returned when you make a [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request for the [Sessions flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md), or [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request for the [Advanced flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration/advanced-flow.md). |
> | `configuration.merchantIdentifier` | No longer needs to be configured. This value is returned when you make a [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request for the [Sessions flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md), or [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request for the [Advanced flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration/advanced-flow.md). |
>
> \*\*
>
> #### Google Pay component
>
> | Removed prop | Prop to use instead |
> | - | - |
> | `showButton` | `showPayButton` |
> | `merchantIdentifier` | No longer supported. This value is returned when you make a [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request for the [Sessions flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md), or [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request for the [Advanced flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration/advanced-flow.md). |
>
> \*\*
>
> #### IssuerList component
>
> If you are configuring a list of issuers using the `IssuerList` component, make sure you use the `issuers` prop.
>
> This applies to the following payment methods: MOLPay, EPS, OpenBanking UK, Online Banking India, and Indian wallet or online payments through Billdesk or PayU.
>
> | Removed prop | Prop to use instead |
> | - | - |
> | `items` | `issuers` |
>
> \*\*
>
> #### Paypal component
>
> | Removed prop | Prop to use instead |
> | - | - |
> | `intent` | `configuration.intent` |
> | `merchantId` | `configuration.merchantId` |
>
> ## Step 4: Update creating an instance
>
> In earlier versions of Drop-in/Components, creating an instance of a Component or the Drop-in used the `AdyenCheckout.create()` method. We've updated this to use a constructor function instead.

> [tab] Drop-in
>
> Before v6, creating an instance of Drop-in was as follows:
>
> **Before v6**
>
> ```js theme={null}
> const checkout = new AdyenCheckout({ /* Configuration */ });
> const dropin = checkout.create('dropin').mount('#dropin')
> ```
>
> From v6 onwards, creating an instance of Drop-in is as follows:
>
> **From v6 onwards**
>
> ```js theme={null}
> const checkout = await AdyenCheckout({ /* Configuration */ });
>
> const dropin = new Dropin(checkout, {
>   paymentMethodComponents: [Card, PayPal, GooglePay] // Only needed with tree-shakable npm package
>   paymentMethodsConfiguration: { /* Configuration */ }
> }).mount('#dropin')
> ```
>
> If you import through [npm auto](https://adyen-preview.mintlify.site/online-payments/upgrade-your-integration/upgrade-to-web-v6#npm-auto) or [embedded scripts](https://adyen-preview.mintlify.site/online-payments/upgrade-your-integration/upgrade-to-web-v6#import-using-embedded-scripts), you do not need to set `paymentMethodComponents`.
>
> The Drop-in constructor function takes two positional arguments:
>
> 1. Your instance of `AdyenCheckout`.
> 2. Your [Drop-in configuration](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md#configure).

> [tab] Components
>
> Before v6, creating an instance of the Card Component is as follows:
>
> **Before v6**
>
> ```js theme={null}
> const checkout = new AdyenCheckout({ /* Configuration */ });
>
> const card = checkout.create('card', {
>     hideCVC: true,
>     enableStoreDetails: true
> }).mount('#card');
> ```
>
> From v6 onwards, creating an instance of the Card Component is as follows:
>
> **From v6 onwards**
>
> ```js theme={null}
> const checkout = await AdyenCheckout({
>     // configuration
> });
>
> const card = new Card(checkout, {
>     hideCVC: true,
>     enableStoreDetails: true
> }).mount('#card');
> ```
>
> The Component constructor function takes two positional arguments:
>
> 1. Your instance of `AdyenCheckout`.
> 2. Your payment method-specific configuration.
>
> ## Step 5: Update your event handlers
>
> In v6, we're introducing changes to several of the library's event handlers:
>
> ### `onValid`
>
> The `onValid()` event listener is no longer used. Remove it from your configuration.
>
> ### `onSubmit` and `onAdditionalDetails`
>
> These events handlers now have access to the new `actions` parameter, which lets you:
>
> * Continue the payment flow: `actions.resolve()`. Call `actions.resolve()` and pass the `resultCode`, also when the payment is unsuccessful.
>
> * Stop the payment flow: `actions.reject()`. Stop the payment flow only in the following cases:
>
>   * When your server's request to Adyen's API fails.
>   * When you experience network connection issues.
>
> Use the `actions` object to manage the payment flow, for example:
>
> ```javascript theme={null}
> const checkout = await AdyenCheckout({
>   // Insert your global configuration here
>   onSubmit: async (state, component, actions) => {
>     try {
>       const { action, order, resultCode, donationToken } = await makePayment(state.data);
>
>       if (!resultCode) actions.reject();
>
>       actions.resolve({
>         resultCode,
>         action,
>         order,
>         donationToken
>       });
>     } catch (error) {
>       actions.reject();
>     }
>   },
> });
> ```
>
> ### `onPaymentCompleted`
>
> This event now works both in the [Sessions Flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration#sessions-flow-a-single-api-request) and [Advanced Flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration#advanced-flow-three-api-requests).
>
> This event is no longer triggered for failed payments. For failed payments, we now use the [`onPaymentFailed` ](#onpaymentfailed)event handler instead.
>
> Once this event is triggered, initiate the successful transaction flow on your web page.
>
> ### `onPaymentFailed`
>
> This is a new event, which is triggered when a payment fails. Previously, this event was part of `onPaymentCompleted`.
>
> This event is triggered when the `resultCode` of a payment is **Cancelled**, **Error**, or **Refused**.
>
> Once this event is triggered, initiate the failed transaction flow on your web page.
>
> ### `onOrderCreated` and `onPaymentMethodsRequest`
>
> These events are used for [partial payments](https://adyen-preview.mintlify.site/online-payments/partial-payments.md).
>
> `onOrderCreated` is renamed to `onOrderUpdated`. Update your codebase accordingly.
>
> `onPaymentMethodsRequest` is a new event, which is triggered when a partial payment is made and the associated order isn't fully paid. Use the event handler to request payment methods for a new payment:
>
> ```js theme={null}
> const checkout = await AdyenCheckout({
>   // core configuration
>   onPaymentMethodsRequest: async (data, { resolve, reject }) => {
>
>     const paymentMethods = await getPaymentMethods({
>       amount,
>       shopperLocale: data.locale,
>       order: data.order,
>     });
>
>     resolve(paymentMethods);
>   },
> });
> ```
>
> The `onPaymentMethodsRequest` event is only evoked in the [Advanced flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration#advanced-flow-three-api-requests), as you do not need to request payment methods yourself in the Sessions flow.
>
> ### `onError`
>
> The `onError` callback now returns:
>
> * an error object that contains details about the error
> * a reference to the payment method component for which the error occurs
>
> ## Step 6: Update your styling
>
> Starting from v6.0.0, we use CSS custom properties to give you more fine-grained control over Drop-in and Components' look and feel.
>
> For an overview of all available CSS variables, see [our GitHub repository](https://github.com/Adyen/adyen-web?tab=readme-ov-file#where-do-we-define-those-css-variables-and-what-is-the-default-value).
>
> If you previously added your own styles to Components, make sure that these styles are being applied, because this version introduces different class names and DOM structures.
>
> Although we recommend you use CSS custom properties to style your Drop-in and Components, you can still override the CSS class names as before.
>
> ### Overriding styles with custom properties
>
> You can customize elements that are not inside an iFrame, by overriding the styles:
>
> 1. Create a CSS file `override.css`, with the [CSS variables](https://github.com/Adyen/adyen-web?tab=readme-ov-file#where-do-we-define-those-css-variables-and-what-is-the-default-value) you want to style:
>    ```css theme={null}
>    :root {
>      --adyen-sdk-color-background-secondary: #f7f7f8;
>    }
>    ```
> 2. Import the `override.css` file after importing the Adyen library's main CSS file:
>    ```css theme={null}
>    import '@adyen/adyen-web/styles/adyen.css';
>    import './override.css';
>    ```
>
> ### Update placeholder texts
>
> Placeholders are no longer added by default. To enhance the accessibility and UX, they are replaced with permanently visible contextual elements, which are shown below input fields.
>
> However, you can still add placeholder text to input fields. Placeholder texts are no longer part of the `translations` object, but part of the payment method configuration, as the placeholder texts are specific to payment methods.
>
> For example, to update the placeholder text for the card number in the Card Component:

> [tab] Drop-in
>
> **Placeholders for cards in Drop-in**
>
> ```js theme={null}
> const dropin = new Dropin({
>     paymentMethodsConfiguration: {
>         card: {
>             placeholders: { cardNumber: 'Enter your card number' }
>         }
>     }
> });
> ```

> [tab] Card Component
>
> **Placeholders in Card Component**
>
> ```js theme={null}
> const card = new Card(checkout, {
>     placeholders: { cardNumber: 'Enter your card number' }
> });
> ```
>
> ## Step 7: (Optional) update your express payment methods
>
> \*\*
>
> ### Apple Pay
>
> #### Express
>
> The event handlers `onShippingContactSelected()` and `onShippingMethodSelected()` now work only when the Apple Pay Component configuration `isExpress` is set to **true**.
>
> ##### `onAuthorized`
>
> This event is now triggered before the `onSubmit` event, and must be resolved or rejected to continue the payment flow. `onAuthorized` returns an object with the `authorizedEvent` (raw data from Apple Pay) along with the formatted `billingAddress` and `deliveryAddress`.
>
> Create an `onAuthorized` event handler to implement checks before continuing the payment flow:
>
> ```js theme={null}
> const applepay = new ApplePay(checkout, {
>   onAuthorized({ authorizedEvent, billingAddress, deliveryAddress }, actions) {
>    if (/* Your checks based on the raw data, billing and shipping address */) actions.resolve();
>    else actions.reject();
>   },
> });
> ```
>
> \*\*
>
> ### Google Pay
>
> * The `isAvailable()` method does not return a boolean flag anymore. It now works same as [Apple Pay's `isAvailable()`](https://adyen-preview.mintlify.site/payment-methods/apple-pay/web-component#step-3-mount-the-component).
> * The event handler `onPaymentDataChanged()` now works only when the Google Pay Component configuration `isExpress` is set to **true**.
>
> ##### `onAuthorized`
>
> This event is now triggered before the `onSubmit` event, and must be resolved or rejected to continue the payment flow. `onAuthorized` returns an object with the `authorizedEvent` (raw data from Google Pay) along with the formatted `billingAddress` and `deliveryAddress`.
>
> Create an `onAuthorized` event handler to implement checks before continuing the payment flow:
>
> ```js theme={null}
> const googlepay = new GooglePay(checkout, {
>   onAuthorized({ authorizedEvent, billingAddress, deliveryAddress }, actions) {
>    if (/* Your checks based on the raw data, billing and shipping address */) actions.resolve();
>    else actions.reject();
>   },
> });
> ```
>
> \*\*
>
> ### PayPal
>
> * The `onShopperDetails(shopperDetails, rawData, actions)` event handler is renamed to `onAuthorized({authorizedEvent, billingAddress, deliveryAddress}, actions)`.
> * The `onShippingChange()` event handler is no longer supported. Implement [`onShippingAddressChange()` ](https://adyen-preview.mintlify.site/payment-methods/paypal/web-component/express-checkout#step-4-handle-delivery-address-changes)and [`onShippingOptionsChange()` ](https://adyen-preview.mintlify.site/payment-methods/paypal/web-component/express-checkout#handle-delivery-method-changes-sessions)instead.
>
> ## Step 8: (Optional) update your Giving integration
>
> From v6 onwards, your Adyen Giving integration must use the [Giving Campaign Manager Component](https://docs.adyen.com/online-payments/donations/campaign-manager-web-component/).
>
> ## Step 9: (Optional) update partial payments in Advanced flow
>
> If you use the [Advanced flow](https://adyen-preview.mintlify.site/online-payments/build-your-integration#advanced-flow-three-api-requests) and process [partial payments](https://adyen-preview.mintlify.site/online-payments/partial-payments.md), make the following change.
>
> Previously, you initiated the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) call from your `onSubmit()` or `onAdditionalDetails()` event handlers to update the payment methods for the remaining amount to be paid. From v6 onwards, we introduce a new event handler named [`onPaymentMethodsRequest()` ](#onordercreated-and-onpaymentmethodsrequest)for this use case.
>
> To use it, pass the [order](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-order) from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) call to the `action.resolve()` method in your `onSubmit()` or `onAdditionalDetails()` event handler:
>
> ```js theme={null}
> const checkout = await AdyenCheckout({
>   onSubmit: async (state, component, actions) => {
>     try {
>       const {
>         action,
>         order,
>         resultCode
>       } = await makePayment(state.data);
>
>       if (!resultCode) actions.reject();
>
>       actions.resolve({
>         resultCode,
>         action,
>         order,
>       });
>     } catch (error) {
>       console.error('An error occured in the onSubmit() event handler:', error);
>       actions.reject();
>     }
>   },
>
>   onPaymentMethodsRequest: async (data, actions) => {
>     // Merchant custom implementation to fetch payment methods
>     const paymentMethods = fetchPaymentMethods(data);
>     actions.resolve(paymentMethods);
>   },
> });
> ```


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