@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/dist/index.mjs CHANGED
@@ -1568,7 +1568,10 @@ function DirectPayPalButtonImplementation({
1568
1568
  paymentMethodCategory: "wallet",
1569
1569
  paymentMethodType: "paypal",
1570
1570
  paymentMethodId: null,
1571
- intentKind: isSubscription ? "subscription" : "order"
1571
+ // Always 'payment': the backend derives order vs subscription from the session's
1572
+ // products and returns it as the response providerObjectType. The order/subscription
1573
+ // split still drives the PayPal JS SDK call locally (see createOrder/createSubscription).
1574
+ intentKind: "payment"
1572
1575
  },
1573
1576
  { idempotencyKey: paypalIntentIdempotencyKey }
1574
1577
  );
@@ -7209,7 +7212,6 @@ function FloPayCheckout({
7209
7212
  setLoadError(null);
7210
7213
  if (createSessionHash) {
7211
7214
  const params = createSessionParamsRef.current;
7212
- setSession(buildSyntheticSession(params, checkoutModeProp));
7213
7215
  setCurrentMode(effectiveCreateSessionMode);
7214
7216
  setIsLoading(false);
7215
7217
  if (initializedHashRef.current === createSessionHash) {
@@ -7217,6 +7219,7 @@ function FloPayCheckout({
7217
7219
  cancelled = true;
7218
7220
  };
7219
7221
  }
7222
+ setSession(buildSyntheticSession(params, checkoutModeProp));
7220
7223
  (async () => {
7221
7224
  const hasPayPalRedirectParams = typeof window !== "undefined" && new URLSearchParams(window.location.search).has("payment_intent");
7222
7225
  const shouldAutoProcessInlineSession = effectiveCreateSessionMode === "auto" && !autoCheckoutAttempted.current && !hasPayPalRedirectParams;