@flopay/react 1.4.2 → 1.4.3

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
@@ -280,6 +280,11 @@ Switch from the default form layout to stacked payment buttons with an expandabl
280
280
  />
281
281
  ```
282
282
 
283
+ `layout` can be changed at runtime. Switching a mounted `FloPayCheckout` from
284
+ the default layout to `"buttons"` keeps the resolved checkout session and its
285
+ gateway capabilities, so the **Credit / Debit Card** choice remains available
286
+ without recreating the session.
287
+
283
288
  > **Deprecated**: the legacy `buttonsTheme` prop (`'default'` / `'minimal'` / `'rounded'` / `'dark'`) still works but new code should use `theme` so the same value drives both the buttons-layout wrapper and the auto-payment fallback. See [ButtonsLayoutStyles reference](https://docs.flopay.com/api-reference/react/flopay-checkout#buttonslayoutstyles-reference) for the underlying override fields.
284
289
 
285
290
  #### Button Hooks
package/dist/index.cjs CHANGED
@@ -1590,7 +1590,10 @@ function DirectPayPalButtonImplementation({
1590
1590
  paymentMethodCategory: "wallet",
1591
1591
  paymentMethodType: "paypal",
1592
1592
  paymentMethodId: null,
1593
- intentKind: isSubscription ? "subscription" : "order"
1593
+ // Always 'payment': the backend derives order vs subscription from the session's
1594
+ // products and returns it as the response providerObjectType. The order/subscription
1595
+ // split still drives the PayPal JS SDK call locally (see createOrder/createSubscription).
1596
+ intentKind: "payment"
1594
1597
  },
1595
1598
  { idempotencyKey: paypalIntentIdempotencyKey }
1596
1599
  );
@@ -7231,7 +7234,6 @@ function FloPayCheckout({
7231
7234
  setLoadError(null);
7232
7235
  if (createSessionHash) {
7233
7236
  const params = createSessionParamsRef.current;
7234
- setSession(buildSyntheticSession(params, checkoutModeProp));
7235
7237
  setCurrentMode(effectiveCreateSessionMode);
7236
7238
  setIsLoading(false);
7237
7239
  if (initializedHashRef.current === createSessionHash) {
@@ -7239,6 +7241,7 @@ function FloPayCheckout({
7239
7241
  cancelled = true;
7240
7242
  };
7241
7243
  }
7244
+ setSession(buildSyntheticSession(params, checkoutModeProp));
7242
7245
  (async () => {
7243
7246
  const hasPayPalRedirectParams = typeof window !== "undefined" && new URLSearchParams(window.location.search).has("payment_intent");
7244
7247
  const shouldAutoProcessInlineSession = effectiveCreateSessionMode === "auto" && !autoCheckoutAttempted.current && !hasPayPalRedirectParams;