Guides
CheckoutForm
Use the drop-in CheckoutForm for self-contained or delegated payment flows.
CheckoutForm
CheckoutForm is a drop-in React component that renders a Stripe PaymentElement with a submit button and handles the full payment lifecycle.
Two Modes
Self-Contained Mode (Default)
Provide onComplete and the form handles everything: tokenize the card, create the intent, confirm with Stripe, process via the billing API, and retry on 3DS challenges.
Delegated Mode
Provide onTokenizedBody to take control of the backend submission. The form tokenizes the card and confirms the payment, then hands you the TokenizedBody to submit to your own API.
Props Reference
| Prop | Type | Description |
|---|---|---|
sessionId | string | Checkout session UUID from the billing API (required) |
billingApiUrl | string | Billing API base URL (required) |
email | string | Customer email for payment intents |
userId | string | Customer user ID for payment processing |
onComplete | (result: PaymentResult) => void | Called on successful payment (self-contained mode) |
onError | (error: FloPayError) => void | Called on payment error |
onTokenizedBody | (body: TokenizedBody) => void | Enables delegated mode |
layout | 'tabs' | 'accordion' | 'auto' | PaymentElement layout style |
submitLabel | string | Custom submit button text |
showAddress | boolean | 'billing' | 'shipping' | Show an address element |
className | string | CSS class for the form wrapper |
children | ReactNode | Custom submit button (overrides default) |
isProcessing | boolean | External processing state (delegated mode) |
error | string | null | External error message (delegated mode) |
onErrorChange | (error: string | null) => void | Called when internal error state changes |
When using delegated mode, you are responsible for 3DS handling. Use the handleNextAction method on the form ref. See the 3D Secure guide.