Skip to main content
This guide covers the SDK-level migration only: loading, mounting, options, events, and submit flow. Data migration (customers, saved payment methods, stored tokens) is a separate operations topic and is not covered here.
Migrating stored payment credentials and historical customer data requires a separate handoff with the Overflow team. That content is not yet published. Contact support when you are ready to plan that work.

Before you start

  • Get a test_pub_… publishable key for your staging environment and a live_pub_… key for production. See Concepts.
  • Confirm your server has an authorize endpoint wired to Overflow. See the authorize a payment API reference.
  • Read the Checkout element overview. Checkout is the recommended primary path and maps most directly to Stripe’s Payment Element.

Concept mapping

Loading and initialization

Stripe:
Payment Elements:
Notes:
  • Publishable keys use the live_pub_… and test_pub_… prefixes. There is no separate live/test toggle in code; the prefix determines the environment.
  • The npm package is a small loader that fetches the SDK from the CDN. There is no bundled SDK build. See Installation.
  • Appearance is set per element, not on a shared provider. Pass appearance into each element’s options.

Mounting

The mount() signature is compatible:
Only one instance may be mounted to a given selector at a time. Call unmount() before re-mounting.

Options mapping

Options are set per element in the factory call, not on a shared elements object. Optional fields document their defaults on each page under Options.

Event mapping

Handlers are passed as options at construction time, not attached with .on().
The full event surface for each element is documented in Events. Highlights:
  • onChange carries complete, empty, and a structured error. See onChange.
  • onSubmit fires after submit() completes with the tokenized payload to forward to your server. See onSubmit.
  • Wallet buttons emit onClick synchronously so you can validate the cart before showing the sheet. See onClick.
  • Shopper abandonment fires onExit and is not an error. See onExit.

Submit and authorize flow

There is no client secret in the browser. The browser produces a tokenized payload; the server authorizes.
On the server, call the Overflow authorize endpoint with your secret key. See the authorize a payment API reference for the request and response shape.

Validation and error handling

  • Validation errors surface through onChange and are returned from submit(). See Handle validation errors.
  • Errors are typed as PaymentElementsError with code, message, and, for Checkout, structured fieldErrors keyed by section. See Field errors and Error codes.
  • Wallet unavailability (Apple Pay or Google Pay not offered on this device) is not an error. Fall back to the primary Checkout element.

Theming

  • Set high-level tokens with appearance.variables. See Token reference.
  • Use appearance.size and appearance.shadowSize presets rather than per-element pixel values. See Sizing presets and Shadows.
  • Element-scoped overrides live under appearance.elements.<name>. See Element-scoped overrides.
  • The element renders inside an isolated tree; page CSS does not leak in. See CSS isolation.

What this guide does not cover

  • Migrating stored payment methods, customer records, or existing Stripe tokens. That work requires coordination with the Overflow team and is not published yet.
  • Drop-in API compatibility. The event names, options shapes, and payloads are different by design; do not rely on Stripe types.
  • Webhook and dispute migration. Those are server-side concerns unrelated to the SDK.

See also

Last modified on July 17, 2026