@flopay/react 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/dist/index.cjs +1244 -494
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +141 -11
- package/dist/index.d.ts +141 -11
- package/dist/index.mjs +1154 -405
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -389,13 +389,20 @@ The `SplitCardForm` layout:
|
|
|
389
389
|
|
|
390
390
|
### PayPal Handling
|
|
391
391
|
|
|
392
|
-
|
|
392
|
+
The SDK supports two PayPal paths, selected per-session based on what the billing API advertises under `gateways.*`:
|
|
393
393
|
|
|
394
|
-
|
|
394
|
+
- **Direct PayPal** (preferred where available — works inside Facebook, Instagram, and other in-app browsers): when the session exposes `gateways.paypal.publishableKey`, the SDK renders PayPal via the official PayPal JS SDK using `<DirectPayPalButton>`. The PayPal client ID and `environment` (`'sandbox'`/`'live'`) come directly from the backend.
|
|
395
|
+
- **Stripe-rendered PayPal fallback** (legacy): when only `gateways.stripe` is configured, PayPal renders through Stripe's `ExpressCheckoutElement` in its own Elements wrapper. This path can't render in Facebook/Instagram in-app browsers.
|
|
395
396
|
|
|
396
|
-
|
|
397
|
+
Renderer selection is mutually exclusive per session — direct PayPal takes priority over Stripe-rendered PayPal. Consumer props such as `showPayPal` continue to gate visibility on the client side.
|
|
397
398
|
|
|
398
|
-
|
|
399
|
+
The SDK exposes the relevant pieces in three ways:
|
|
400
|
+
|
|
401
|
+
- **`SplitCardForm`** / **`FloPayCheckout`**: pick the renderer automatically based on `gateways.*`. No additional configuration needed.
|
|
402
|
+
|
|
403
|
+
- **`FloPayProvider`** (manual composition): accepts an optional `paypalFlopay` prop used to drive Stripe's PayPal redirect leg. Load a second `FloPay` instance yourself only if you need to render PayPal manually. `usePayPalFloPay()` exposes it to descendants.
|
|
404
|
+
|
|
405
|
+
- **`DirectPayPalButton`** (standalone): can be rendered outside `SplitCardForm` when you only need the PayPal button. Pass `clientId`, `currency`, `environment`, and `isSubscription`.
|
|
399
406
|
|
|
400
407
|
- **`PayPalButton`** (standalone): Must be rendered inside its own `FloPayProvider`:
|
|
401
408
|
|