@flopay/react 1.9.8 → 1.9.10
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 +59 -13
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.mjs +8 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -902,6 +902,29 @@ SDK shows exactly one required fallback pane after approval and resumes with
|
|
|
902
902
|
the collected values. A checkout that supplied buyer details up front keeps its
|
|
903
903
|
existing request bodies and callbacks.
|
|
904
904
|
|
|
905
|
+
**In-app presentation and recovery:** Direct PayPal classifies the browser once
|
|
906
|
+
per mount into a bounded app family; it never records the raw user agent.
|
|
907
|
+
`approvalPresentation` selects the bounded `app_switch` mode only for a
|
|
908
|
+
one-time Order in an in-app browser. When the backend advertises
|
|
909
|
+
`gateways.paypal.approvalPresentation: 'app_switch'`, that mode enables PayPal's
|
|
910
|
+
`appSwitchWhenAvailable` Buttons option.
|
|
911
|
+
Ordinary browsers, legacy sessions, subscriptions, and setup tokens preserve
|
|
912
|
+
the popup flow. The PayPal button stays visible in every environment as a
|
|
913
|
+
result of this choice. If an in-app popup is blocked and no supported non-popup
|
|
914
|
+
mode is available, `onTechnicalFailure` receives `popupBlocked: true` with
|
|
915
|
+
fixed guidance to open the page in the system browser; ordinary browsers keep
|
|
916
|
+
the existing allow-popups guidance, and PayPal remains visible for retry.
|
|
917
|
+
|
|
918
|
+
`approvalPresentation` is a bounded mode, not a URL. Merchant code cannot
|
|
919
|
+
inject a return URL or resume token. Although the shared response type reserves
|
|
920
|
+
`'redirect'`, the classic Buttons adapter does not activate it: deterministic
|
|
921
|
+
redirect remains gated on the backend-issued signed resume contract and a
|
|
922
|
+
proven PayPal adapter that captures before merchant-success navigation. Until
|
|
923
|
+
both land, a redirect advertisement safely preserves popup behavior. This
|
|
924
|
+
instrumentation explains where approval attempts stop; it does not by itself
|
|
925
|
+
attribute the historical conversion drop to a particular browser or provider
|
|
926
|
+
failure.
|
|
927
|
+
|
|
905
928
|
**Flo-owned subscription continuations:** `gateways.paypal.providerObjectType`
|
|
906
929
|
selects the direct PayPal operation. `'order'` loads the PayPal SDK with
|
|
907
930
|
`intent=capture` and invokes `createOrder`, even when the checkout session mode
|
|
@@ -916,20 +939,27 @@ legacy sessions continue to derive Order versus Subscription from
|
|
|
916
939
|
`isSubscription` and keep the released `paypal` requests byte-identical. See
|
|
917
940
|
the full [channel-selection and cutover contract](../../docs/PAYPAL_FLO_SUBSCRIPTION_CONTINUATIONS.md).
|
|
918
941
|
|
|
919
|
-
**Direct PayPal initialization recovery:**
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
or
|
|
923
|
-
|
|
924
|
-
The retry uses a fresh render
|
|
925
|
-
from the superseded generation
|
|
942
|
+
**Direct PayPal initialization recovery:** Any active-generation technical
|
|
943
|
+
failure before PayPal becomes ready — script rejection, a namespace without a
|
|
944
|
+
usable `Buttons` factory, an eligible pre-ready `onError`, a `render()`
|
|
945
|
+
rejection, or the SDK's 11-second render watchdog — hides Direct PayPal, waits
|
|
946
|
+
one second, and makes exactly one background remount. Recovery is based on
|
|
947
|
+
lifecycle state, not provider error text. The retry uses a fresh render
|
|
948
|
+
generation, and callbacks or promise settlements from the superseded generation
|
|
949
|
+
are ignored. Startup remount does not create a checkout session, intent, or
|
|
950
|
+
charge; the first recovered buyer click creates at most one intent under the
|
|
951
|
+
existing per-click idempotency contract.
|
|
926
952
|
|
|
927
953
|
In a mixed checkout, card, wallets, APMs, and any other eligible methods remain
|
|
928
|
-
interactive throughout recovery. If
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
954
|
+
interactive throughout recovery. If Direct PayPal is configured alongside
|
|
955
|
+
Stripe-rendered PayPal, the Stripe-rendered path activates while Direct PayPal
|
|
956
|
+
is retrying or exhausted. If both Direct PayPal attempts fail, PayPal stays
|
|
957
|
+
hidden for that component configuration; the SDK emits one sanitized console
|
|
958
|
+
diagnostic and calls neither `onError` nor `onDecline`. Empty configuration,
|
|
959
|
+
`isEligible() === false`, cancellation, supersession, unmount, and recognized
|
|
960
|
+
lifecycle teardown are not automatically retried. Ineligibility still notifies
|
|
961
|
+
the parent that PayPal is unavailable so a fallback can appear, without
|
|
962
|
+
technical telemetry.
|
|
933
963
|
|
|
934
964
|
In a PayPal-only checkout, `FloPayCheckout` shows an accessible retrying status
|
|
935
965
|
instead of a blank surface. After automatic recovery is exhausted, it shows safe
|
|
@@ -945,7 +975,7 @@ The SDK exposes the relevant pieces in three ways:
|
|
|
945
975
|
|
|
946
976
|
- **`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.
|
|
947
977
|
|
|
948
|
-
- **`DirectPayPalButton`** (standalone): can be rendered outside `SplitCardForm` when you only need the PayPal button. Pass `clientId`, `currency`, `environment`, `isSubscription`, and the backend-advertised `providerObjectType` when present. `isSubscription` remains the compatibility fallback when the
|
|
978
|
+
- **`DirectPayPalButton`** (standalone): can be rendered outside `SplitCardForm` when you only need the PayPal button. Pass `clientId`, `currency`, `environment`, `isSubscription`, and the backend-advertised `providerObjectType` and `approvalPresentation` when present. The backing session is authoritative; `isSubscription` remains the compatibility fallback when the object type is absent.
|
|
949
979
|
|
|
950
980
|
### Using Hooks
|
|
951
981
|
|
|
@@ -1052,6 +1082,22 @@ Stripe and PayPal SDK load/runtime failures emit `provider_runtime`. Inline
|
|
|
1052
1082
|
`validation_rejected` / `payment_declined` outcomes and never carry
|
|
1053
1083
|
`failureCategory`.
|
|
1054
1084
|
|
|
1085
|
+
If Stripe.js cannot initialize after `FloPayCheckout` resolves a full session,
|
|
1086
|
+
the checkout no longer hides a provider-independent payment surface. A
|
|
1087
|
+
vault-capable session continues with the hosted card form, and Direct PayPal
|
|
1088
|
+
continues when the session advertises it; Stripe wallets and APMs are omitted.
|
|
1089
|
+
The degraded surface exposes one **Retry payment methods** action. It retries
|
|
1090
|
+
only provider initialization and never repeats session read/create/claim,
|
|
1091
|
+
automatic checkout, intent creation, or payment processing. A failed retry is
|
|
1092
|
+
not offered again during that mount, and cards or Direct PayPal remain usable.
|
|
1093
|
+
|
|
1094
|
+
When neither the hosted card form nor Direct PayPal can render, `onError` and
|
|
1095
|
+
the `error` render prop receive a `FloPayError` with code
|
|
1096
|
+
`CheckoutInitializationFailed`. The default error surface uses fixed buyer-safe
|
|
1097
|
+
copy. Raw provider messages are never placed in the DOM or merchant callback.
|
|
1098
|
+
Existing-session transport and malformed-response failures are separately
|
|
1099
|
+
reported at `session_read`; expected session outcomes remain non-alerting.
|
|
1100
|
+
|
|
1055
1101
|
Direct PayPal script and unusable-namespace failures remain
|
|
1056
1102
|
`PROVIDER_LOAD_FAILED` at `provider_load`. Once PayPal reports the button as
|
|
1057
1103
|
eligible, a pre-ready `onError` or rejected `render()` is instead
|