--- title: Customize checkout behavior subtitle: Customize the behavior of the checkout process to increase conversion and revenue. route: /payments/checkout/customization/behavior --- # Customize checkout behavior Customize the behavior of the checkout process to increase conversion and revenue. # Stripe-hosted page > This is a Stripe-hosted page for when payment-ui is stripe-hosted. View the original doc at https://docs.stripe.com/payments/checkout/customization/behavior?payment-ui=stripe-hosted. ## Customize the Submit button To better align Checkout with your business model, configure the copy displayed on the Checkout submit button for one-time purchases. Define a `submit_type` on your session. In this example (for a 5 USD donation), your customized Checkout submit button would read **Donate $5.00**. See the [API reference](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-submit_type) for a complete list of `submit_type` options. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Checkout.SessionCreateOptions { SubmitType = "donate", LineItems = new List { new Stripe.Checkout.SessionLineItemOptions { Price = "<>", Quantity = 1 }, }, Mode = "payment", SuccessUrl = "https://example.com/success", CancelUrl = "https://example.com/cancel", }; var service = new Stripe.Checkout.SessionService(); Stripe.Checkout.Session session = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.CheckoutSessionParams{ SubmitType: stripe.String(string(stripe.CheckoutSessionSubmitTypeDonate)), LineItems: []*stripe.CheckoutSessionLineItemParams{ &stripe.CheckoutSessionLineItemParams{ Price: stripe.String("<>"), Quantity: stripe.Int64(1), }, }, Mode: stripe.String(string(stripe.CheckoutSessionModePayment)), SuccessURL: stripe.String("https://example.com/success"), CancelURL: stripe.String("https://example.com/cancel"), }; result, err := session.New(params); ``` ```java Stripe.apiKey = "<>"; SessionCreateParams params = SessionCreateParams.builder() .setSubmitType(SessionCreateParams.SubmitType.DONATE) .addLineItem( SessionCreateParams.LineItem.builder().setPrice("<>").setQuantity(1L).build() ) .setMode(SessionCreateParams.Mode.PAYMENT) .setSuccessUrl("https://example.com/success") .setCancelUrl("https://example.com/cancel") .build(); Session session = Session.create(params); ``` ```node const stripe = require('stripe')('<>'); const session = await stripe.checkout.sessions.create({ submit_type: 'donate', line_items: [ { price: '<>', quantity: 1, }, ], mode: 'payment', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }); ``` ```python import stripe stripe.api_key = "<>" session = stripe.checkout.Session.create( submit_type="donate", line_items=[{"price": "<>", "quantity": 1}], mode="payment", success_url="https://example.com/success", cancel_url="https://example.com/cancel", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $session = $stripe->checkout->sessions->create([ 'submit_type' => 'donate', 'line_items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], 'mode' => 'payment', 'success_url' => 'https://example.com/success', 'cancel_url' => 'https://example.com/cancel', ]); ``` ```ruby Stripe.api_key = '<>' session = Stripe::Checkout::Session.create({ submit_type: 'donate', line_items: [ { price: '<>', quantity: 1, }, ], mode: 'payment', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }) ``` ## Localization and supported languages By default, Checkout detects the locale of the customer’s browser and displays a translated version of the page in their language, if Stripe [supports it](https://support.stripe.com/questions/supported-languages-for-stripe-checkout). You can override the browser locale for Checkout by passing the `locale` [parameter](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-locale) when you create a Checkout Session. Checkout also uses the locale to format numbers and currencies. For example, when selling a product whose price is set in EUR with the locale set to `auto`, a browser configured to use English (`en`) would display €25.00 while one configured for German (`de`) would display 25,00 €. ## Autofill payment details with Link You can automatically use Link (Stripe’s one-click checkout) in your prebuilt Checkout page. To learn more, see [Link with Checkout](https://docs.stripe.com/payments/link/checkout-link.md). ## Filter card brands You can specify which card brands you want to block from your customers in the Checkout Session. To block specific card brands, you can include the `brands_blocked` parameter when creating a Checkout Session. Pass an array with any of the following card brand values: - `visa` - `mastercard` - `american_express` - `discover_global_network` The `discover_global_network` value encompasses all of the cards that are part of the Discover Global Network, including Discover, Diners, JCB, UnionPay, and Elo. The following code example initializes the Checkout Session with the `brands_blocked` parameter set to `['american_express']`, which prevents customers from using American Express cards. If a customer enters an unsupported card number in Checkout, an error message notifies them that their card brand isn’t accepted. ![Card brand filtering on Checkout](images/checkout/card-brand-filtering/card-brand-filtering-on-form.png) An error surfaces informing the customer that you don’t accept Visa (or whatever card brand you have blocked). Additionally, Link also disables saved cards for returning users if the saved card is blocked. ![Card brand filtering on Checkout with Link](images/checkout/card-brand-filtering/card-brand-filtering-link.png) If a Link user’s saved card is blocked, it is disabled. Checkout also filters cards in Apple and Google Pay wallets, customer’s [saved payment methods](https://docs.stripe.com/payments/checkout/save-during-payment.md), and [networks from co-badged cards](https://docs.stripe.com/co-badged-cards-compliance.md). # Embedded form > This is a Embedded form for when payment-ui is embedded-form. View the original doc at https://docs.stripe.com/payments/checkout/customization/behavior?payment-ui=embedded-form. ## Customize the Submit button To better align Checkout with your business model, configure the text that displays on the Checkout submit button for one-time purchases. Define a `submit_type` on your session. In this example (for a 5 USD donation), your customized Checkout submit button would read **Donate $5.00**. See the [API reference](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-submit_type) for a complete list of `submit_type` options. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Checkout.SessionCreateOptions { SubmitType = "donate", LineItems = new List { new Stripe.Checkout.SessionLineItemOptions { Price = "<>", Quantity = 1 }, }, Mode = "payment", UiMode = "embedded", ReturnUrl = "https://example.com/return", }; var service = new Stripe.Checkout.SessionService(); Stripe.Checkout.Session session = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.CheckoutSessionParams{ SubmitType: stripe.String(string(stripe.CheckoutSessionSubmitTypeDonate)), LineItems: []*stripe.CheckoutSessionLineItemParams{ &stripe.CheckoutSessionLineItemParams{ Price: stripe.String("<>"), Quantity: stripe.Int64(1), }, }, Mode: stripe.String(string(stripe.CheckoutSessionModePayment)), UIMode: stripe.String(string(stripe.CheckoutSessionUIModeEmbedded)), ReturnURL: stripe.String("https://example.com/return"), }; result, err := session.New(params); ``` ```java Stripe.apiKey = "<>"; SessionCreateParams params = SessionCreateParams.builder() .setSubmitType(SessionCreateParams.SubmitType.DONATE) .addLineItem( SessionCreateParams.LineItem.builder().setPrice("<>").setQuantity(1L).build() ) .setMode(SessionCreateParams.Mode.PAYMENT) .setUiMode(SessionCreateParams.UiMode.EMBEDDED) .setReturnUrl("https://example.com/return") .build(); Session session = Session.create(params); ``` ```node const stripe = require('stripe')('<>'); const session = await stripe.checkout.sessions.create({ submit_type: 'donate', line_items: [ { price: '<>', quantity: 1, }, ], mode: 'payment', ui_mode: 'embedded', return_url: 'https://example.com/return', }); ``` ```python import stripe stripe.api_key = "<>" session = stripe.checkout.Session.create( submit_type="donate", line_items=[{"price": "<>", "quantity": 1}], mode="payment", ui_mode="embedded", return_url="https://example.com/return", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $session = $stripe->checkout->sessions->create([ 'submit_type' => 'donate', 'line_items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], 'mode' => 'payment', 'ui_mode' => 'embedded', 'return_url' => 'https://example.com/return', ]); ``` ```ruby Stripe.api_key = '<>' session = Stripe::Checkout::Session.create({ submit_type: 'donate', line_items: [ { price: '<>', quantity: 1, }, ], mode: 'payment', ui_mode: 'embedded', return_url: 'https://example.com/return', }) ``` ## Localization and supported languages By default, Checkout detects the locale of the customer’s browser and displays a translated version of the page in their language, if Stripe [supports it](https://support.stripe.com/questions/supported-languages-for-stripe-checkout). You can override the browser locale for Checkout by passing the `locale` [parameter](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-locale) when you create a Checkout Session. Checkout also uses the locale to format numbers and currencies. For example, when selling a product whose price is set in EUR with the locale set to `auto`, a browser configured to use English (`en`) would display €25.00 while one configured for German (`de`) would display 25,00 €. ## Autofill payment details with Link You can automatically use Link (the Stripe click to check out product) in your prebuilt Checkout page. To learn more, see [Link with Checkout](https://docs.stripe.com/payments/link/checkout-link.md). ## Filter card brands You can specify which card brands you want to block from your customers in the Checkout Session. To block specific card brands, you can include the `brands_blocked` parameter when creating a Checkout Session. Pass an array with any of the following card brand values: - `visa` - `mastercard` - `american_express` - `discover_global_network` The `discover_global_network` value encompasses all of the cards that are part of the Discover Global Network, including Discover, Diners, JCB, UnionPay, and Elo. The following code example initializes the Checkout Session with the `brands_blocked` parameter set to `['american_express']`, which prevents customers from using American Express cards. If a customer enters an unsupported card number in Checkout, an error message notifies them that their card brand isn’t accepted. ![Card brand filtering on Checkout](images/checkout/card-brand-filtering/card-brand-filtering-on-form.png) An error surfaces informing the customer that you don’t accept Visa (or whatever card brand you have blocked). Additionally, Link also disables saved cards for returning users if the saved card is blocked. ![Card brand filtering on Checkout with Link](images/checkout/card-brand-filtering/card-brand-filtering-link.png) If a Link user’s saved card is blocked, it is disabled. Checkout also filters cards in Apple and Google Pay wallets, customer’s [saved payment methods](https://docs.stripe.com/payments/checkout/save-during-payment.md), and [networks from co-badged cards](https://docs.stripe.com/co-badged-cards-compliance.md). # Embedded components > This is a Embedded components for when payment-ui is embedded-components. View the original doc at https://docs.stripe.com/payments/checkout/customization/behavior?payment-ui=embedded-components. ## Localization and supported languages By default, Elements detects the locale of the customer’s browser and displays a translated version in their language, if Stripe supports the [locale](https://docs.stripe.com/js/appendix/supported_locales). You can also set a locale when you initialize a `stripe` instance. ```js // Set your publishable key: remember to change this to your live publishable key in production // See your keys here: https://dashboard.stripe.com/apikeys const stripe = Stripe('<>', { locale: 'fr', }); ``` ```javascript import {loadStripe} from '@stripe/stripe-js'; const stripe = loadStripe("<>", { locale: 'fr', }); ``` ## Autofill payment details with Link Use [Link](https://docs.stripe.com/payments/link.md) in the Payment Element to let your customers check out faster. You can autofill information for any logged-in customer already using Link, regardless of whether they initially saved their information in Link with another business. The Payment Element includes a Link prompt in the card form. To manage Link in the Payment Element, go to your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). ## Filter card brands Blocking specific card brands isn’t supported when using Elements with the Checkout Sessions API.