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 alive_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:- Publishable keys use the
live_pub_…andtest_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
appearanceinto each element’s options.
Mounting
Themount() signature is compatible:
unmount() before re-mounting.
Options mapping
Options are set per element in the factory call, not on a sharedelements 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().
onChangecarriescomplete,empty, and a structurederror. See onChange.onSubmitfires aftersubmit()completes with the tokenized payload to forward to your server. See onSubmit.- Wallet buttons emit
onClicksynchronously so you can validate the cart before showing the sheet. See onClick. - Shopper abandonment fires
onExitand 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.Validation and error handling
- Validation errors surface through
onChangeand are returned fromsubmit(). See Handle validation errors. - Errors are typed as
PaymentElementsErrorwithcode,message, and, for Checkout, structuredfieldErrorskeyed 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.sizeandappearance.shadowSizepresets 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.