Weiter zum Inhalt
Konto erstellen
oder
anmelden
Das Logo der Stripe-Dokumentation
/
KI fragen
Konto erstellen
Anmelden
Jetzt starten
Zahlungen
Umsatz
Plattformen und Marktplätze
Geldmanagement
Entwicklerressourcen
Übersicht
Versionierung
Änderungsprotokoll
    Übersicht
    Clover
    Basilikum
    Acacia
    Vorherige Versionen
Aktualisieren Sie Ihre API-Version
Ihre SDK-Version aktualisieren
Essentials
SDKs
API
Tests
Stripe-CLI
Beispiel-Projekte
Tools
Stripe Dashboard
Workbench
Entwickler-Dashboard
Stripe Shell
Stripe für Visual Studio Code
Funktionen
Arbeitsabläufe
Ereignisziele
Stripe-StatuswarnungenHochgeladene Dateien
KI-Lösungen
Agent-Toolkit
Model Context ProtocolAgentische KI-SaaS-Billing-Workflows aufbauen
Sicherheit und Datenschutz
Sicherheit
Stripebot-Webcrawler
Datenschutz
Extend Stripe
Erstellen Sie Stripe-Apps
Verwenden Sie Apps von Stripe
Partner
Partner-Ecosystem
Partner-Zertifizierung
StartseiteEntwicklerressourcenChangelogClover2025-09-30.clover

Notiz

Bis jetzt ist diese Seite noch nicht in dieser Sprache verfügbar. Wir arbeiten aber verstärkt daran, unsere Dokumentation in weiteren Sprachen bereitzustellen, und werden die Übersetzung sofort anzeigen, sobald diese verfügbar ist.

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
War diese Seite hilfreich?
JaNein
  • Benötigen Sie Hilfe? Kontaktieren Sie den Kundensupport.
  • Nehmen Sie an unserem Programm für frühzeitigen Zugriff teil.
  • Schauen Sie sich unser Änderungsprotokoll an.
  • Fragen? Sales-Team kontaktieren.
  • LLM? Lesen Sie llms.txt.
  • Unterstützt von Markdoc