@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.cjs CHANGED
@@ -762,7 +762,7 @@ function WalletButtonInner({
762
762
  amazonPay: "never",
763
763
  klarna: "never"
764
764
  },
765
- layout: { overflow: "never" }
765
+ layout: { maxColumns: 1, overflow: "never" }
766
766
  }
767
767
  }
768
768
  ) }),
@@ -1658,6 +1658,7 @@ function FloPayCheckout({
1658
1658
  const [confirmProcessing, setConfirmProcessing] = (0, import_react7.useState)(false);
1659
1659
  const [modeError, setModeError] = (0, import_react7.useState)(null);
1660
1660
  const [createSessionPatch, setCreateSessionPatch] = (0, import_react7.useState)(void 0);
1661
+ const [createSessionPatchBaseHash, setCreateSessionPatchBaseHash] = (0, import_react7.useState)("");
1661
1662
  const [cardBootstrapPending, setCardBootstrapPending] = (0, import_react7.useState)(false);
1662
1663
  const [deferredCardOpen, setDeferredCardOpen] = (0, import_react7.useState)(false);
1663
1664
  const autoCheckoutAttempted = (0, import_react7.useRef)(false);
@@ -1669,10 +1670,22 @@ function FloPayCheckout({
1669
1670
  onDeclineRef.current = onDecline;
1670
1671
  const onSessionCompletedRef = (0, import_react7.useRef)(onSessionCompleted);
1671
1672
  onSessionCompletedRef.current = onSessionCompleted;
1673
+ const baseCreateSessionHash = (0, import_react7.useMemo)(
1674
+ () => createSessionParams ? hashCreateParams(createSessionParams) : "",
1675
+ [createSessionParams]
1676
+ );
1677
+ const activeCreateSessionPatch = (0, import_react7.useMemo)(
1678
+ () => createSessionPatchBaseHash === baseCreateSessionHash ? createSessionPatch : void 0,
1679
+ [createSessionPatch, createSessionPatchBaseHash, baseCreateSessionHash]
1680
+ );
1672
1681
  const effectiveCreateSession = (0, import_react7.useMemo)(
1673
- () => createSessionParams ? mergeInlineSessionPatch(createSessionParams, createSessionPatch) : void 0,
1674
- [createSessionParams, createSessionPatch]
1682
+ () => createSessionParams ? mergeInlineSessionPatch(createSessionParams, activeCreateSessionPatch) : void 0,
1683
+ [createSessionParams, activeCreateSessionPatch]
1675
1684
  );
1685
+ (0, import_react7.useEffect)(() => {
1686
+ setCreateSessionPatch(void 0);
1687
+ setCreateSessionPatchBaseHash(baseCreateSessionHash);
1688
+ }, [baseCreateSessionHash]);
1676
1689
  const emitDecline = (0, import_react7.useCallback)(
1677
1690
  (method, input, overrides) => {
1678
1691
  onDeclineRef.current?.(buildDeclineEvent(method, input, overrides));
@@ -1860,6 +1873,7 @@ function FloPayCheckout({
1860
1873
  inflightRef.current.delete(cacheKey);
1861
1874
  }
1862
1875
  if (patch) {
1876
+ setCreateSessionPatchBaseHash(baseCreateSessionHash);
1863
1877
  setCreateSessionPatch((prev) => mergeInlineSessionPatches(prev, patch));
1864
1878
  }
1865
1879
  const { sid, result: realResult } = resolved;
@@ -1931,6 +1945,7 @@ function FloPayCheckout({
1931
1945
  }
1932
1946
  }, [
1933
1947
  bootstrapInlineSession,
1948
+ baseCreateSessionHash,
1934
1949
  cardBootstrapPending,
1935
1950
  effectiveCreateSession,
1936
1951
  onButtonClick,
@@ -2259,7 +2274,6 @@ function FloPayCheckout({
2259
2274
  enableAVS,
2260
2275
  avsLayout,
2261
2276
  country: session?.customer?.country,
2262
- zip: session?.customer?.zip,
2263
2277
  initialCardOpen: deferredCardOpen,
2264
2278
  submitLabel,
2265
2279
  className