stripe-pay-client
Browser and WebAssembly client for the stripe-pay SDK family.
Overview
stripe-pay-client builds the configuration a checkout page hands to the Stripe payment element. It carries no transport of its own: the browser binds the configuration to Stripe.js at mount time, so the crate stays free of I/O and can be unit tested off-wasm. It depends on stripe-pay-core for the shared domain types.
Payment element configuration
use ;
let config = new.with_kind;
let options = build_element_options?;
ElementConfig keeps the client secret and the locale, and effective_locale() falls back to the crate default when the host page does not pick one.
Mount preflight
preflight checks a page before it mounts and reports the first thing that is missing, in the order a page author would fix them: no client secret, then no mount target, then Stripe.js absent from the page.
use preflight;
preflight?;
Target
Builds for wasm32-unknown-unknown. The types are transport-free, so the same logic is testable on the host.
Licence
MIT. See LICENSE.