Requirements
Before you begin, take into account the following requirements, limitations, and preparations.Keep your integration up-to-date
Staying up-to-date on the latest version of Drop-in/Components is crucial for new features, security updates, and compliance.Handle web framework re-renders
Modern frameworks can re-render UI components, which can cause unexpected behavior in the checkout. To prevent this, initializeAdyenCheckout and mount your Components only once, when you are ready to display the payment methods.
Some web frameworks might require some extra attention when using specific approaches.
- React.StrictMode: this leads to re-renders and re-executions of effects and callbacks. Ensure that
AdyenCheckoutand Components are not initialized multiple times. - Custom hooks: you can encapsulate the initialization of
AdyenCheckoutin a custom hook. If you do, ensure your hook returns the instance of the Component that you mount in your UI. And most importantly, make sure that the mounting is executed only once, in the React component that consumes that hook.
Manage Server-Side Rendering (SSR)
Drop-in/Components depend on browser APIs likewindow and document. If you use SSR, make sure the code that creates an AdyenCheckout instance and mounts a Component is executed on the client side.
Securely implement a custom pay button
If you use a custom pay button in your integration, you need to take a few things into account.Prevent multiple submissions
A shopper can trigger a payment in multiple ways, for example by selecting the Pay button, or by pressing the Enter key on their keyboard. To prevent multiple payments for the same order, you must disable your pay button as soon as a payment attempt has been made. You can detect when the payment flow is triggered by using:beforeSubmitin yourAdyenCheckoutconfiguration for a Sessions flow integration.onSubmitin yourAdyenCheckoutconfiguration for an Advanced flow integration.
beforeSubmit and onSubmit events are triggered when the pay button is selected.
The following example shows how to use the beforeSubmit callback to track the payment status and prevent multiple submissions.
Prevent multiple payments with Sessions flow
Unsupported payment methods
The custom pay button is not supported for:- PayPal
- Klarna
- Click to Pay
Use HTTPS for your checkout
To protect sensitive payment data, host your Adyen checkout on a page that uses HTTPS. In your live environment, you need to use HTTPS. It encrypts the connection between the shopper browser and your server, which prevents data interception and tampering. If you do not use HTTPS in production, it leads to security warnings and can cause payments to fail. For local development and testing, you can use HTTP. However, make sure you switch to HTTPS before you go live. Read about end-to-end online payments testing for more information.Avoid <iframe> elements
We do not recommend integrating your checkout in an <iframe> due to potential complexities. When an <iframe> is hosted on a different domain than its parent, redirect payment flows doesn’t work. This is because the <iframe> can’t redirect when the parent is a different domain. This restriction leads to failed transactions and a poor user experience. Some payment methods may also behave differently or require a specific configuration when used in an <iframe>. If you must use an <iframe>, host it on the same domain as the parent page.Avoid WebViews
For native mobile apps, we recommend that you do not use WebViews to display the checkout. WebViews are less secure and functional than native components and can cause performance issues, especially with payment methods that require redirects. Instead, you should implement native components, for example:- Custom Tabs for Android
- SFSafariViewController for iOS.
Ensure browser compatibility
Our Drop-in/Components are designed to work seamlessly with recent versions of all major browsers. To ensure the highest security standards and optimal performance we focus on modern browsers that receive regular security updates.Supported desktop browsers
Supported mobile browsers
Understand cookie usage
Drop-in/Components may set one cookie, _RP_UID, which is generated by our internal risk management module. This module is enabled by default and helps identify suspicious browsing or purchasing patterns. We do not recommend disabling it.Other cookies, from adyen.com, may be present if you previously visited our websites and accepted cookies. To see only the cookies used by your integration, clear your browser data or use an incognito window for testing.
Account for interactions with browser extensions
We do not take responsibility for how Drop-in/Components interact with browser extensions like ad blockers, cookie managers, or password managers. An improperly configured extension can block an <iframe> or other elements required for payment methods to function correctly.Enhance your integration with Adyen Uplift
We recommend that you use features of Adyen Uplift in your integration to increase payment conversion, simplify fraud management, and reduce the cost of payments.Manage client-side resources
There are two ways to load the client-side resources for Web Drop-in/Components:- Recommended Load through the Adyen Web npm package.
- Embed the Adyen Web script and stylesheet into your HTML file.
Embed the Adyen Web script and stylesheet into your HTML file
When embedding the script and stylesheet, make sure that the URL region matches with the region of your live endpoints and theenvironment you configured for Drop-in/Components in your Sessions, or Advanced flow integration.
We also recommend to use Subresource Integrity hashes to ensure security.
- v6.0.0
- v5.x.x or earlier