@flopay/react 1.20.2 → 1.20.4

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 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
+ - **PayPal and wallet buttons follow the claim response.** The shell's gateways are only a provisional advertisement made before the cart is known. When the claim lands, the PayPal, Apple Pay, Google Pay and other wallet buttons come from the claim response: a provider it returns as `null` (for example `paypal: null` or `stripe: null`) is removed even if the shell advertised it, and its Stripe.js instances and PayPal button are torn down while the hosted card form stays. A provider the claim keeps stays mounted as it is, and a provider key the claim leaves out (an older API) keeps the shell's advertisement. The SDK shows what the API advertises and never chooses gateways itself.
96
97
  - **Stripe account routing.** A detached create also sends the cart's distinct catalogue product codes as `routingProducts` (`[{ code }]`, one entry per code), a routing hint only: the billing API uses it to advertise the cart's Stripe account on the first response, so Stripe.js, fraud signals, Apple Pay and Google Pay start on that account from first paint, and it never stores the hint. An empty cart and a create that is not detached send no `routingProducts` at all, and for a merchant that does not use gateway selection the hint changes nothing. The claim stays the authority: when the claim changes the checkout to a different Stripe account, `FloPayCheckout` loads Stripe.js for the new account, drops the old instance and its Elements, and re-mounts the wallet buttons on the new account before showing the claimed session, so a wallet payment confirms on the new account only. A claim that keeps the account re-initialises nothing. If Stripe.js cannot load for the new account, the wallets stay hidden, the hosted card form and direct PayPal keep working, and **Retry payment methods** loads the new account. `FloPayCheckout` declares that it can switch with the `stripe-account-switch-v1` token in the `x-flo-sdk-capabilities` header of the detached create and its claims, so the billing API keeps Apple Pay and Google Pay on such a claim instead of hiding them. The SDK still never chooses or filters a gateway: it renders what the session advertises. `@flopay/vue` does not declare the capability; its port follows with SDK 2.0.
97
98
  - **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.
98
99
  - **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.