API Reference@flopay/react
PayPalButton
Standalone PayPal button component that handles the full PayPal payment flow.
PayPalButton
Standalone PayPal button that handles the full PayPal payment flow including intent creation, confirmation, and redirect resume.
Important
PayPal requires its own FloPayProvider -- it cannot share the same Stripe Elements instance as card fields when they use paymentMethodCreation: 'manual'. Use a separate provider with paymentMethodCreation: 'auto' (or unset).
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
sessionId | string | Yes | -- | Checkout session ID (UUID from billing API). |
billingApiUrl | string | Yes | -- | Billing API base URL. |
email | string | No | -- | User's email. |
userId | string | No | -- | User ID for processing payments. |
firstName | string | No | -- | First name for billing. |
lastName | string | No | -- | Last name for billing. |
chv | string | No | -- | Checkout version for tracking. |
onTokenizedBody | (body: TokenizedBody) => void | No | -- | Called with tokenized data after PayPal authorization. If omitted, processes payment internally. |
onComplete | () => void | No | -- | Called on successful payment (self-contained mode). |
onErrorChange | (error: string | null) => void | No | -- | Called when an error occurs. |
isProcessing | boolean | No | false | External processing state. |
Example
Flow
- User clicks the PayPal button.
- A PaymentIntent is created via
POST /v1/checkouts/payments/intents. - Payment is confirmed via
flopay.confirmPayment()-- may redirect to PayPal. - After redirect return, the component detects
payment_intentURL parameters and resumes the flow. - On success, calls
onTokenizedBody(delegated mode) orprocessPayment(self-contained mode).