Introduction
FloPay is a provider-agnostic payment SDK for JavaScript and React applications.
FloPay SDK
FloPay is a payment SDK that wraps provider-specific APIs (currently Stripe) behind a unified, provider-agnostic interface. It handles card payments, PayPal, 3D Secure authentication, and checkout session management so you can integrate payments without coupling your application to any single provider.
Packages
The SDK is split into four packages:
| Package | Purpose |
|---|---|
@flopay/shared | Shared types, error classes, constants, and theme definitions |
@flopay/js | Core browser SDK -- loads the payment provider, creates elements, confirms payments |
@flopay/react | React bindings -- FloPayProvider, CheckoutForm, SplitCardForm, hooks |
@flopay/node | Server-side SDK -- checkout session creation, webhook verification, customer management |
Key Features
- Provider-agnostic adapter pattern -- swap from Stripe to another provider without changing your integration code
- Self-contained checkout forms --
CheckoutFormandSplitCardFormhandle the full payment lifecycle (tokenize, create intent, confirm, process, 3DS retry) out of the box - 3D Secure handled automatically -- both forms detect
3ds_requiredresponses and trigger the authentication flow transparently - PayPal support --
SplitCardFormrenders a PayPal button alongside card fields with a separate Elements instance, matching Stripe's architecture requirements - Built-in theming -- three bundled themes (
default,flat,night) with customizable CSS variables - Structured errors --
FloPayErrorprovides typed error categories (validation_error,api_error,network_error, etc.) with factory helpers
How It Works
- Initialize -- call
loadFloPay(publishableKey)to get aFloPayinstance - Wrap -- use
<FloPayProvider>to make the instance available via React context - Render -- drop in
<CheckoutForm>or<SplitCardForm>with a session ID - Handle success -- the
onCompletecallback fires when payment succeeds
FloPay is published to GitHub Packages. See the Installation guide for registry setup.
Next Steps
- Installation -- set up your project
- React Quick Start -- build your first checkout
- Node.js Quick Start -- create sessions server-side
- Concepts -- understand the architecture