| [ Web Proxy ] |
| Viewing: https://stripe.com/nl-be/docs/elements/express-checkout-element | [Back] [Original] |
The Express Checkout Element is an integration for accepting payments through one-click payment method buttons. Supported payment methods include Link, Apple Pay, Google Pay, PayPal, Klarna, and Amazon Pay.
With this integration, you can:
In the following demo, you can toggle some of the prebuilt options to change the background color, layout, size, and shipping address collection of the payment interface. The demo displays Google Pay and Apple Pay only on their available platforms. Payment Method buttons are only shown in their supported countries.
If you dont see the demo, try viewing this page in a supported browser.
| Option | Description |
|---|---|
| Merchant country | Set this using the publishable key that you use to initialize Stripe.js. To change the country, you must unmount the Express Checkout Element, update the publishable key, then re-mount the Express Checkout Element. |
| Background color | Set colors using the Elements Appearance API. Button themes are inherited from the Appearance API but you can also define them directly when you create the Element. |
| Desktop and mobile size | Use the dropdown to set the max pixel width of the parent element that the Express Checkout Element is mounted to. You can set it to 750px (Desktop) or 320px (Mobile). |
| Max columns and max rows | Set these values using the layout parameter when you Create the Express Checkout Element. |
| Overflow menu | Set this using the layout parameter when you Create the Express Checkout Element. |
| Collect shipping address | To collect shipping information, you must pass options when creating the Express Checkout Element. Learn more about collecting customer details and displaying line items. |
The Express Checkout Element presents one-click payment methods that are active, supported, and set up.
The element sorts payment methods by relevance to your customer.
You can also add custom payment methods to the Express Checkout Element button row using the customPaymentMethods option on stripe.elements().
To control these behaviors, you can customize the payment methods.
Certain payment methods work with specific browsers.
| Apple Pay | Google Pay | Link | PayPal | Amazon Pay | Klarna | |
|---|---|---|---|---|---|---|
| Chrome1 | 3 | |||||
| Edge | 3 | |||||
| Firefox | 3 | 4 | ||||
| Opera | 3 | |||||
| Safari | 2 | 4 | ||||
| Chrome on iOS 16+ | 4 | |||||
| Firefox on iOS 16+ | 4 | |||||
| Edge on iOS 16+ | 4 | |||||
| Chrome on Android |
1Other Chromium browsers might be supported. For more information, see supported browsers.
2When using an iframe, its origin must match the top-level origin (except for Safari 17+ when specifying allow="payment" attribute). Two pages have the same origin if the protocol, host (full domain name), and port (if specified) are the same for both pages.
3Apple Pay on non-Safari desktop browsers is only supported when paymentMethods.applePay is set to always.
4Google Pay on this browser is only supported when paymentMethods.googlePay is set to always.
In-app webview support differs from browser support. The table lists which Express Checkout Element payment methods support in-app webviews.
| Support for in-app webviews | |
|---|---|
| Apple Pay | Supported in iOS webviews, subject to standard Apple Pay eligibility requirements. |
| Google Pay | Supported when the environment is otherwise eligible for Google Pay, and Google Pay can complete without opening a pop-up window. In Android webviews, the host app must also be configured to support the Payment Request API. |
| Link | Not supported |
| PayPal | Not supported |
| Klarna | Not supported |
| Amazon Pay | Not supported |
Webview support is in addition to each payment methods standard browser and eligibility requirements. Use the Express Checkout Element availablepaymentmethodschange event to detect which payment methods are available in your customers current environment. For mobile app integrations, consider using the iOS SDK or Android SDK.
By default, when the Express Checkout Element displays multiple buttons, it arranges the buttons in a grid based on available space, and shows an overflow menu if necessary.
You can override this default and specify a grid layout yourself with the layout option.
You can control a buttons text by selecting a buttonType. Each wallet offers its own types.
Link only offers one button type, which presents the "Pay with Link" call to action and the Link logo.
We attempt to detect your customers locale and use it to localize the button text. You can also specify a locale.
This example code includes the call to action Buy or Buy now for buttons that support it. Then, it specifies the locale de to get their German equivalents.
const expressCheckoutOptions = { buttonType: { applePay: 'buy', googlePay: 'buy', paypal: 'buynow', klarna: 'pay', } } const elements = stripe.elements({ locale: 'de',
You cant fully customize the appearance of Express Checkout Element buttons because each payment method sets its own logo and brand colors. You can customize the following options:
The Apple Pay button automatically resizes when border radius increases beyond a certain threshold. If modifying the default border radius, make sure to test it with all active payment methods.
This example code sets up an elements group with a light theme and 36px border radius, makes buttons 50px tall, and overrides the theme to use the white-outline version of the Apple Pay button.
const appearance = { theme: 'stripe', variables: { borderRadius: '36px', } } const expressCheckoutOptions = { buttonHeight: 50, buttonTheme: {
We support the following themes:
Link has a single button theme, which is readable on either a light or a dark background.
You can control which payment methods appear. However, wallet availability still applies. For example, you cant force a Google Pay button to appear if your customers device doesnt support Google Pay.
But you can customize payment method behavior in various ways, such as:
never.always. This still wont force them to appear on unsupported platforms, or when the payment is in an unsupported currency.cpmt_ ID set up in the Dashboard, or if its handleRender method throws an error.Listen for the availablepaymentmethodschange event to check which wallets are available for the Express Checkout Element to display. If no wallets are available, provide another option for your customer to pay.
() => { const [eceActive, setEceActive] = useState(false); return ( <div> <ExpressCheckoutElement onAvailablePaymentMethodsChange={({ paymentMethods }) => { if (paymentMethods) { setEceActive(true);
Alternatively, hide the entire Express Checkout Element until you know the element has methods to display.
() => { const [eceActive, setEceActive] = useState(false); return ( <div> <OneClickCheckoutContainer hidden={!eceActive}> <ExpressCheckoutElement onAvailablePaymentMethodsChange={({ paymentMethods }) => { if (paymentMethods) {
The same event is available on the element object when created without React.
const expressCheckoutElement = elements.create("expressCheckout", { ... }); expressCheckoutElement.on("availablepaymentmethodschange", ({ paymentMethods }) => { console.log(paymentMethods); }); expressCheckoutElement.mount("#express-checkout-element");
| Web Proxy Viewer | New URL | Original Page |