@flopay/react 0.4.0 → 0.4.1
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 +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +11 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -93,7 +93,7 @@ function FloPayProvider({
|
|
|
93
93
|
// src/flopay-checkout.tsx
|
|
94
94
|
import React5, { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
|
|
95
95
|
import { loadFloPay, PaymentAPI } from "@flopay/js";
|
|
96
|
-
import { FloPayError as FloPayError3, resolveBillingApiUrl as resolveBillingApiUrl3, buildCheckoutDisplayData, resolveButtonsLayoutTheme as resolveButtonsLayoutTheme2 } from "@flopay/shared";
|
|
96
|
+
import { SDK_VERSION, FloPayError as FloPayError3, resolveBillingApiUrl as resolveBillingApiUrl3, buildCheckoutDisplayData, resolveButtonsLayoutTheme as resolveButtonsLayoutTheme2 } from "@flopay/shared";
|
|
97
97
|
|
|
98
98
|
// src/card-button-content.tsx
|
|
99
99
|
import "react";
|
|
@@ -1852,6 +1852,8 @@ function FloPayCheckout({
|
|
|
1852
1852
|
onSessionCompleted
|
|
1853
1853
|
}) {
|
|
1854
1854
|
const resolvedBillingUrl = resolveBillingApiUrl3(billingApiUrl);
|
|
1855
|
+
const checkoutType = createSessionParams ? "embedded_checkout" : "standard_checkout";
|
|
1856
|
+
const checkoutLayout = children ? "custom_layout" : layout === "buttons" ? "buttons_layout" : "default_layout";
|
|
1855
1857
|
const [unified, setUnified] = useState3(null);
|
|
1856
1858
|
const [flopay, setFloPay] = useState3(null);
|
|
1857
1859
|
const flopayRef = useRef3(null);
|
|
@@ -1876,6 +1878,14 @@ function FloPayCheckout({
|
|
|
1876
1878
|
onDeclineRef.current = onDecline;
|
|
1877
1879
|
const onSessionCompletedRef = useRef3(onSessionCompleted);
|
|
1878
1880
|
onSessionCompletedRef.current = onSessionCompleted;
|
|
1881
|
+
useEffect4(() => {
|
|
1882
|
+
console.info("[FloPay] Checkout initialized", {
|
|
1883
|
+
sdk_version: SDK_VERSION,
|
|
1884
|
+
checkout_type: checkoutType,
|
|
1885
|
+
checkout_layout: checkoutLayout,
|
|
1886
|
+
billing_api_url: resolvedBillingUrl
|
|
1887
|
+
});
|
|
1888
|
+
}, [checkoutLayout, checkoutType, resolvedBillingUrl]);
|
|
1879
1889
|
const baseCreateSessionHash = useMemo3(
|
|
1880
1890
|
() => createSessionParams ? hashCreateParams(createSessionParams) : "",
|
|
1881
1891
|
[createSessionParams]
|