@flopay/react 1.18.0 → 1.18.1

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.
Files changed (2) hide show
  1. package/README.md +1 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -93,6 +93,7 @@ Skip your own session-creation route and create the session inside the component
93
93
 
94
94
  - **Currency is required.** Pass `currency` on `createSession`, or on the first item, subscription, or product. Without one the SDK throws a `CurrencyRequired` validation error before sending anything.
95
95
  - **Detached creation (default).** The checkout creates a lightweight session *shell* first, then attaches the catalog in a background claim. The hosted card form mounts from the shell without waiting for the claim or Stripe.js; wallets, alternative payment methods, and PayPal load in parallel and appear when the claim lands. The card form's submit button stays gated until the claim settles, because the billing API refuses to charge an unclaimed session; a buyer who clicks during that window is asked to press pay again. Catalog and coupon errors surface as a checkout load error. `createSession.timeoutMs` applies separately to the shell and the claim (12 seconds each by default). Detached creation requires billing API v1.7.12 or newer and `checkoutMode: 'full'`, and is skipped when `tokenizedData` is supplied; pass `deferDataAttachment: false` to force a single request.
96
+ - **Supplied buyer names.** When `createSession.account` has a non-blank `firstName` or `lastName`, the first session request (the shell) already carries the trimmed first and last name, so the billing API issues the hosted card form with its cardholder name field hidden from the start: the field is never rendered. A first name alone or a last name alone is sent on its own. Email, `userId`, the address, and the cart still arrive with the claim, and names are not part of the inline-session cache identity, so editing a name does not start a new session. Blank or whitespace-only names count as absent and leave the request and the form unchanged. The buyer types no name in this case, so no name input is reported. A billing API that does not yet keep names on the shell ignores them and shows the field as before.
96
97
  - **Late buyer identity.** Any still-anonymous session the checkout renders (including an existing session passed as `sessionId` and `nonce` with `buyerIdentified: false`) attaches the buyer email the checkout collects, or a wallet or PayPal approval supplies, through the session claim before payment.
97
98
  - **Checkout metadata.** `checkoutMetadata` is sent unchanged on the initial request and never repeated in a claim. Omitting it keeps the request shape; an explicit `null` and `{}` stay distinct. Returned metadata is on the normalized session and its `data.session`. The billing API alone enforces size limits.
98
99
  - **Idempotency.** The create request sends a stable `Idempotency-Key` whenever a secure random source is available. `FloPayCheckout` resolves the key once per logical checkout, stores it with the inline-session cache in `sessionStorage`, and reuses it across retries, effect reruns, and remounts, so StrictMode double-mounts or navigation flicker cannot create two sessions or two charges. A logical checkout is identified by merchant, buyer, cart and pricing, coupons, and checkout metadata (keys canonicalized, raw metadata not stored); checkout-mode, token, and analytics prop changes do not rotate it. Pass `createSession.idempotencyKey` to control the key yourself; it must be non-empty, at most 255 characters, and never reused for a new purchase.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flopay/react",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {
@@ -36,8 +36,8 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@flopay/js": "1.18.0",
40
- "@flopay/shared": "1.18.0",
39
+ "@flopay/js": "1.18.1",
40
+ "@flopay/shared": "1.18.1",
41
41
  "@paypal/paypal-js": "^11.3.0",
42
42
  "@stripe/react-stripe-js": "^7.1.0",
43
43
  "@stripe/stripe-js": "^10.3.0"