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:appearance and locale on the loader options (or new Overflow(pk, { … })) set the primary theme for every element. Passing appearance on a specific element is an optional per-element override.
Notes:
- 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.
- The primary theme lives on the
Overflowinstance — passappearancetonew Overflow(pk, { appearance })(or mutate it later withoverflow.update({ appearance })) and every element inherits it.
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 attached with.on('onEventName', handler) after the element is created. Event name strings include the on prefix — same idea as Stripe’s .on, different event name strings.
onChangecarriescomplete,value, and optionalerrors(FieldError[]). See onChange.onSubmitfires after a successfulsubmit()(or wallet sheet success) with a non-nullvalueto forward to your server. See onSubmit.- Validation failures from
submit()emitonErrorwithcode: 'validation_failed'andfieldErrors; they are not returned fromsubmit(). - 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 an authorize-ready payload (encrypted envelope for card,walletToken for wallets); the server authorizes.
element.submit() returns void. Register onSubmit and onError before calling it — success and failure both arrive as events.
Validation and error handling
- Validation errors surface on
onChange.errorswhile the shopper types, and as anonErrorevent withcode: 'validation_failed'andfieldErrorswhensubmit()fails. See Handle validation errors. - Error payloads follow
OverflowErrorEvent:{ code, message, fieldErrors?, cause? }. For Checkout, eachFieldErrormay include an optionalsource('contact' | 'billingAddress' | 'shippingAddress' | 'paymentMethod' | 'customElement') —fieldErrorsis always an array, not an object 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.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.