Accéder directement au contenu
Créez un compte
ou
connecter-vous
Logo de la documentation Stripe
/
Demander à l'assistant IA
Créez un compte
Connectez-vous
Démarrer
Paiements
Revenus
Plateformes et places de marché
Gestion de fonds
Ressources pour les développeurs
Aperçu
Gestion des versions
Journal des modifications
    Présentation
    Clover
    Basil
    Acacia
    Versions précédentes
Mettre à niveau votre version de l'API
Actualiser votre version du SDK
Essentials
SDK
API
Tests
CLI Stripe
Exemples de projets
Outils
Dashboard Stripe
Workbench
Dashboard des développeurs
Shell Stripe
Stripe pour Visual Studio Code
Fonctionnalités
Workflows
Destinations d'événements
Alertes d'intégrité de StripeChargements de fichiers
Solutions d'IA
Boîte à outils des agents
Modèle de protocole contextuelCréer des flux de facturation SaaS avec l’IA agentique
Sécurité et confidentialité
Sécurité
Robot d'exploration Web Stripebot
Confidentialité
Extensions Stripe
Créer des applications Stripe
Utiliser les applications de Stripe
Partenaires
Partner ecosystem
Certification des partenaires
AccueilRessources pour les développeursChangelogClover2025-09-30.clover

Remarque

Cette page n'est pas encore disponible dans cette langue. Nous faisons tout notre possible pour proposer notre documentation dans davantage de langues et nous vous fournirons la version traduite dès qu'elle sera disponible.

Updates initCheckout to be synchronousBreaking changes

What’s new

The stripe.initCheckout method is now synchronous instead of asynchronous.

Why is this a breaking change?

This breaking change affects you if your integration uses Elements with the Checkout Sessions API.

To migrate, you need to:

  1. Remove any await or .then() calls associated with initCheckout.
  2. Replace your fetchClientSecret function with a client secret string or Promise that resolves to a client secret string.
  3. Call the new asynchronous function checkout.loadActions() in order to access actions such as getSession(), which replaces session(), or confirm(). You only need to call loadActions() once.
  4. If you previously wrapped initCheckout in a try...catch block, you should examine the resolved type value of loadActions() instead to check for errors.
const promise = fetch("/create-checkout-session", { method: "POST", headers: { "Content-Type": "application/json" }, }) .then((r) => r.json()) .then((r) => r.clientSecret); const checkout = await stripe.initCheckout({ fetchClientSecret: () => promise }); const checkout = stripe.initCheckout({ clientSecret: promise }); const paymentElement = checkout.createPaymentElement(); paymentElement.mount("#payment-element"); const session = checkout.session(); const loadActionsResult = await checkout.loadActions(); if (loadActionsResult.type === 'success') { const session = loadActionsResult.actions.getSession(); }

Impact

The synchronous nature of initCheckout enables you to mount Elements earlier, which reduces the render latency of any Elements you mount immediately after initCheckout. This also enables Elements to display the skeleton loader UI after it’s mounted but the session state hasn’t fully loaded yet.

Related changes

  • Removes postal code for card payments in certain regions on Checkout and Payment Element
  • Removes currency conversion field from Checkout Session object
  • Removes support for the redirectToCheckout method
  • Adds support for collecting business and individual names in Checkout Sessions
  • Adds the ability to exclude payment methods from Checkout Sessions and Payment Intents
  • Adds support for setting the capture method for specific payment methods with the Checkout Sessions API
  • Adds support for configuring branding settings for Checkout Sessions
  • Enables specifying units of measurement for Products
Cette page vous a-t-elle été utile ?
OuiNon
  • Besoin d'aide ? Contactez le service Support.
  • Rejoignez notre programme d'accès anticipé.
  • Consultez notre log des modifications.
  • Des questions ? Contactez l'équipe commerciale.
  • LLM ? Lire llms.txt.
  • Propulsé par Markdoc