@flopay/react 0.3.12 → 0.3.13

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
@@ -718,7 +718,7 @@ function WalletButtonInner({
718
718
  amazonPay: "never",
719
719
  klarna: "never"
720
720
  },
721
- layout: { overflow: "never" }
721
+ layout: { maxColumns: 1, overflow: "never" }
722
722
  }
723
723
  }
724
724
  ) }),
@@ -1614,6 +1614,7 @@ function FloPayCheckout({
1614
1614
  const [confirmProcessing, setConfirmProcessing] = useState3(false);
1615
1615
  const [modeError, setModeError] = useState3(null);
1616
1616
  const [createSessionPatch, setCreateSessionPatch] = useState3(void 0);
1617
+ const [createSessionPatchBaseHash, setCreateSessionPatchBaseHash] = useState3("");
1617
1618
  const [cardBootstrapPending, setCardBootstrapPending] = useState3(false);
1618
1619
  const [deferredCardOpen, setDeferredCardOpen] = useState3(false);
1619
1620
  const autoCheckoutAttempted = useRef3(false);
@@ -1625,10 +1626,22 @@ function FloPayCheckout({
1625
1626
  onDeclineRef.current = onDecline;
1626
1627
  const onSessionCompletedRef = useRef3(onSessionCompleted);
1627
1628
  onSessionCompletedRef.current = onSessionCompleted;
1629
+ const baseCreateSessionHash = useMemo3(
1630
+ () => createSessionParams ? hashCreateParams(createSessionParams) : "",
1631
+ [createSessionParams]
1632
+ );
1633
+ const activeCreateSessionPatch = useMemo3(
1634
+ () => createSessionPatchBaseHash === baseCreateSessionHash ? createSessionPatch : void 0,
1635
+ [createSessionPatch, createSessionPatchBaseHash, baseCreateSessionHash]
1636
+ );
1628
1637
  const effectiveCreateSession = useMemo3(
1629
- () => createSessionParams ? mergeInlineSessionPatch(createSessionParams, createSessionPatch) : void 0,
1630
- [createSessionParams, createSessionPatch]
1638
+ () => createSessionParams ? mergeInlineSessionPatch(createSessionParams, activeCreateSessionPatch) : void 0,
1639
+ [createSessionParams, activeCreateSessionPatch]
1631
1640
  );
1641
+ useEffect4(() => {
1642
+ setCreateSessionPatch(void 0);
1643
+ setCreateSessionPatchBaseHash(baseCreateSessionHash);
1644
+ }, [baseCreateSessionHash]);
1632
1645
  const emitDecline = useCallback2(
1633
1646
  (method, input, overrides) => {
1634
1647
  onDeclineRef.current?.(buildDeclineEvent(method, input, overrides));
@@ -1816,6 +1829,7 @@ function FloPayCheckout({
1816
1829
  inflightRef.current.delete(cacheKey);
1817
1830
  }
1818
1831
  if (patch) {
1832
+ setCreateSessionPatchBaseHash(baseCreateSessionHash);
1819
1833
  setCreateSessionPatch((prev) => mergeInlineSessionPatches(prev, patch));
1820
1834
  }
1821
1835
  const { sid, result: realResult } = resolved;
@@ -1887,6 +1901,7 @@ function FloPayCheckout({
1887
1901
  }
1888
1902
  }, [
1889
1903
  bootstrapInlineSession,
1904
+ baseCreateSessionHash,
1890
1905
  cardBootstrapPending,
1891
1906
  effectiveCreateSession,
1892
1907
  onButtonClick,
@@ -2215,7 +2230,6 @@ function FloPayCheckout({
2215
2230
  enableAVS,
2216
2231
  avsLayout,
2217
2232
  country: session?.customer?.country,
2218
- zip: session?.customer?.zip,
2219
2233
  initialCardOpen: deferredCardOpen,
2220
2234
  submitLabel,
2221
2235
  className