SplitCardForm
Use SplitCardForm for individual card fields with optional PayPal support.
SplitCardForm
SplitCardForm renders individual card input fields (CardNumber, CardExpiry, CardCVC) with a full name input and optional PayPal button. It follows the same self-contained / delegated pattern as CheckoutForm.
Layout
The form renders in this order:
- PayPal button (if
showPayPalistrue, default) - "Or pay with card" divider
- Card Number field
- Card Expiry + Card CVC (side by side)
- Full Name input (First + Last)
- Submit button
Basic Usage
PayPal Integration
PayPal is enabled by default (showPayPal={true}). The SplitCardForm creates a separate Stripe Elements instance for PayPal -- this is required because PayPal's ExpressCheckoutElement cannot share an Elements instance that uses paymentMethodCreation: 'manual'.
When PayPal is enabled, you must provide totalAmount and currency:
To disable PayPal:
Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
sessionId | string | -- | Checkout session UUID (required) |
billingApiUrl | string | -- | Billing API base URL (required) |
email | string | -- | Customer email |
userId | string | -- | Customer user ID |
onComplete | (result: PaymentResult) => void | -- | Success callback |
onError | (error: FloPayError) => void | -- | Error callback |
onTokenizedBody | (body: TokenizedBody) => void | -- | Enables delegated mode |
showPayPal | boolean | true | Show PayPal button |
totalAmount | number | -- | Total in dollars (required for PayPal) |
currency | string | -- | Currency code (required for PayPal) |
firstName | string | -- | Pre-fill first name |
lastName | string | -- | Pre-fill last name |
submitLabel | string | -- | Custom submit button text |
className | string | -- | CSS class for form wrapper |
children | ReactNode | -- | Custom submit button |
isProcessing | boolean | -- | External processing state |
error | string | null | -- | External error message |
onFirstNameChange | (value: string) => void | -- | First name change callback |
onLastNameChange | (value: string) => void | -- | Last name change callback |
SplitCardForm exposes a handleNextAction method via ref, identical to CheckoutForm. Use it for 3DS handling in delegated mode.