@betterstore/react 0.3.78 → 0.3.79
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/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,7 @@ interface CheckoutFormProps {
|
|
|
18
18
|
exchangeRate: number;
|
|
19
19
|
paymentSecret: string | null;
|
|
20
20
|
publicKey: string | null;
|
|
21
|
+
paymentComponentKey: number;
|
|
21
22
|
}
|
|
22
|
-
export default function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, paymentSecret, publicKey, }: CheckoutFormProps): React.JSX.Element;
|
|
23
|
+
export default function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, paymentSecret, publicKey, paymentComponentKey, }: CheckoutFormProps): React.JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -15,6 +15,7 @@ interface PaymentFormProps {
|
|
|
15
15
|
fonts?: Fonts;
|
|
16
16
|
locale?: StripeElementLocale;
|
|
17
17
|
publicKey: string | null;
|
|
18
|
+
paymentComponentKey: number;
|
|
18
19
|
}
|
|
19
|
-
export default function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, contactEmail, shippingAddress, shippingName, shippingPrice, checkoutAppearance, fonts, locale, publicKey, }: PaymentFormProps): React.JSX.Element;
|
|
20
|
+
export default function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, contactEmail, shippingAddress, shippingName, shippingPrice, checkoutAppearance, fonts, locale, publicKey, paymentComponentKey, }: PaymentFormProps): React.JSX.Element;
|
|
20
21
|
export {};
|
package/dist/index.cjs.js
CHANGED
|
@@ -35081,15 +35081,9 @@ function PaymentElement({ paymentSecret, publicKey, checkoutAppearance, locale,
|
|
|
35081
35081
|
}
|
|
35082
35082
|
var PaymentElement$1 = React.memo(PaymentElement);
|
|
35083
35083
|
|
|
35084
|
-
function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, contactEmail, shippingAddress, shippingName, shippingPrice, checkoutAppearance, fonts, locale, publicKey, }) {
|
|
35084
|
+
function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, contactEmail, shippingAddress, shippingName, shippingPrice, checkoutAppearance, fonts, locale, publicKey, paymentComponentKey, }) {
|
|
35085
35085
|
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
35086
|
-
const [key, setKey] = React.useState(0);
|
|
35087
35086
|
const { t } = useTranslation();
|
|
35088
|
-
React.useEffect(() => {
|
|
35089
|
-
if (paymentSecret) {
|
|
35090
|
-
setKey((prev) => prev + 1);
|
|
35091
|
-
}
|
|
35092
|
-
}, [paymentSecret]);
|
|
35093
35087
|
return (React.createElement("div", { className: "space-y-6" },
|
|
35094
35088
|
React.createElement("div", null,
|
|
35095
35089
|
React.createElement("h2", { className: "mb-2" }, t("CheckoutEmbed.Payment.title")),
|
|
@@ -35116,7 +35110,7 @@ function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack,
|
|
|
35116
35110
|
" \u00B7 ",
|
|
35117
35111
|
shippingPrice)),
|
|
35118
35112
|
React.createElement(Button, { variant: "link", size: "link", onClick: onBack }, t("CheckoutEmbed.Shipping.change")))),
|
|
35119
|
-
React.createElement("div", { className: "mt-8" }, paymentSecret && (React.createElement(PaymentElement$1, { key:
|
|
35113
|
+
React.createElement("div", { className: "mt-8" }, paymentSecret && (React.createElement(PaymentElement$1, { key: paymentComponentKey, fonts: fonts, checkoutAppearance: convertCheckoutAppearanceToStripeAppearance(checkoutAppearance, fonts), locale: locale, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, setSubmitting: setIsSubmitting, publicKey: publicKey },
|
|
35120
35114
|
React.createElement("div", { className: "flex justify-between items-center pt-8" },
|
|
35121
35115
|
React.createElement(Button, { type: "button", variant: "ghost", onClick: onBack },
|
|
35122
35116
|
React.createElement(ChevronLeft, null),
|
|
@@ -35293,7 +35287,7 @@ const resetFormStore = (formData) => {
|
|
|
35293
35287
|
localStorage.setItem("checkout", JSON.stringify(Object.assign(Object.assign({}, currentState), { state: Object.assign(Object.assign({}, currentState.state), { step: "customer", formData: { customer: formData.customer } }) })));
|
|
35294
35288
|
};
|
|
35295
35289
|
|
|
35296
|
-
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, paymentSecret, publicKey, }) {
|
|
35290
|
+
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, paymentSecret, publicKey, paymentComponentKey, }) {
|
|
35297
35291
|
const { formData, setFormData, step, setStep, checkoutId: storedCheckoutId, setCheckoutId, } = useFormStore();
|
|
35298
35292
|
const [shippingRates, setShippingRates] = React.useState([]);
|
|
35299
35293
|
const validateStep = React.useCallback(() => {
|
|
@@ -35451,7 +35445,7 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
35451
35445
|
};
|
|
35452
35446
|
const renderStep = () => {
|
|
35453
35447
|
if (step === "payment" && formData.customer && formData.shipping) {
|
|
35454
|
-
return (React.createElement(PaymentForm, { locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), shippingName: formData.shipping.name, shippingPrice: storeHelpers.formatPrice(formData.shipping.price, currency, exchangeRate), publicKey: publicKey }));
|
|
35448
|
+
return (React.createElement(PaymentForm, { paymentComponentKey: paymentComponentKey, locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), shippingName: formData.shipping.name, shippingPrice: storeHelpers.formatPrice(formData.shipping.price, currency, exchangeRate), publicKey: publicKey }));
|
|
35455
35449
|
}
|
|
35456
35450
|
if (step === "shipping" && formData.customer) {
|
|
35457
35451
|
return (React.createElement(ShippingMethodForm, { setFormData: setFormData, formData: formData, shippingRates: shippingRates, initialData: formData.shipping, onSubmit: handleShippingSubmit, onBack: handleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), currency: currency, exchangeRate: exchangeRate, locale: locale, countryCode: formData.customer.address.countryCode }));
|
|
@@ -35705,6 +35699,7 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
|
|
|
35705
35699
|
const paymentSecretPromiseRef = React.useRef(null);
|
|
35706
35700
|
const [paymentSecret, setPaymentSecret] = React.useState(null);
|
|
35707
35701
|
const [publicKey, setPublicKey] = React.useState(null);
|
|
35702
|
+
const [paymentComponentKey, setPaymentComponentKey] = React.useState(0);
|
|
35708
35703
|
const [checkout, setCheckout] = React.useState(null);
|
|
35709
35704
|
const [loading, setLoading] = React.useState(true);
|
|
35710
35705
|
React.useEffect(() => {
|
|
@@ -35775,11 +35770,13 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
|
|
|
35775
35770
|
setCheckout(newCheckout);
|
|
35776
35771
|
if (step === "payment") {
|
|
35777
35772
|
yield generatePaymentSecret();
|
|
35773
|
+
setPaymentComponentKey((prev) => prev + 1);
|
|
35778
35774
|
}
|
|
35779
35775
|
});
|
|
35780
35776
|
const revalidateDiscounts = () => __awaiter(this, void 0, void 0, function* () {
|
|
35781
35777
|
if (step === "payment") {
|
|
35782
35778
|
yield generatePaymentSecret();
|
|
35779
|
+
setPaymentComponentKey((prev) => prev + 1);
|
|
35783
35780
|
}
|
|
35784
35781
|
else {
|
|
35785
35782
|
const newCheckout = yield storeClient.revalidateDiscounts(clientSecret, checkoutId);
|
|
@@ -35791,6 +35788,7 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
|
|
|
35791
35788
|
setCheckout(newCheckout);
|
|
35792
35789
|
if (step === "payment") {
|
|
35793
35790
|
yield generatePaymentSecret();
|
|
35791
|
+
setPaymentComponentKey((prev) => prev + 1);
|
|
35794
35792
|
}
|
|
35795
35793
|
});
|
|
35796
35794
|
React.useEffect(() => {
|
|
@@ -35804,7 +35802,7 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
|
|
|
35804
35802
|
return (React.createElement(IframeWrapper, { iframeRef: iframeRef },
|
|
35805
35803
|
React.createElement("div", { className: "checkout-embed h-max gap-6 md:gap-0 py-4 md:py-12 flex flex-col md:grid md:grid-cols-7 " },
|
|
35806
35804
|
React.createElement(Appearance, { appearance: appearance, fonts: config.fonts, iframeRef: iframeRef }),
|
|
35807
|
-
React.createElement("div", { className: "md:col-span-4 px-4 h-max md:px-8" }, loading ? (React.createElement(CheckoutFormLoading, null)) : (React.createElement(CheckoutForm, { locale: locale, setShippingCost: setShippingCost, storeClient: storeClient, fonts: config.fonts, checkoutAppearance: appearance, currency: (_a = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _a !== void 0 ? _a : "", customer: checkout === null || checkout === void 0 ? void 0 : checkout.customer, cancelUrl: cancelUrl, checkoutId: checkoutId, clientSecret: clientSecret, onSuccess: onSuccess, onError: onError, exchangeRate: (_b = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _b !== void 0 ? _b : 1, publicKey: publicKey, paymentSecret: paymentSecret }))),
|
|
35805
|
+
React.createElement("div", { className: "md:col-span-4 px-4 h-max md:px-8" }, loading ? (React.createElement(CheckoutFormLoading, null)) : (React.createElement(CheckoutForm, { locale: locale, setShippingCost: setShippingCost, storeClient: storeClient, fonts: config.fonts, checkoutAppearance: appearance, currency: (_a = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _a !== void 0 ? _a : "", customer: checkout === null || checkout === void 0 ? void 0 : checkout.customer, cancelUrl: cancelUrl, checkoutId: checkoutId, clientSecret: clientSecret, onSuccess: onSuccess, onError: onError, exchangeRate: (_b = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _b !== void 0 ? _b : 1, publicKey: publicKey, paymentSecret: paymentSecret, paymentComponentKey: paymentComponentKey }))),
|
|
35808
35806
|
React.createElement("div", { className: "md:col-span-3 px-4 md:px-8 h-max order-first md:order-last" },
|
|
35809
35807
|
React.createElement(Toaster, null),
|
|
35810
35808
|
loading ? (React.createElement(CheckoutSummaryLoading, null)) : (React.createElement(CheckoutSummary, { currency: (_c = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _c !== void 0 ? _c : "", lineItems: (_d = checkout === null || checkout === void 0 ? void 0 : checkout.lineItems) !== null && _d !== void 0 ? _d : [], shipping: checkout === null || checkout === void 0 ? void 0 : checkout.shipping, tax: checkout === null || checkout === void 0 ? void 0 : checkout.tax, onCancel: onCancel, exchangeRate: (_e = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _e !== void 0 ? _e : 1, applyDiscountCode: applyDiscountCode, appliedDiscounts: (_f = checkout === null || checkout === void 0 ? void 0 : checkout.appliedDiscounts) !== null && _f !== void 0 ? _f : [], removeDiscount: removeDiscount }))))));
|
package/dist/index.mjs
CHANGED
|
@@ -35061,15 +35061,9 @@ function PaymentElement({ paymentSecret, publicKey, checkoutAppearance, locale,
|
|
|
35061
35061
|
}
|
|
35062
35062
|
var PaymentElement$1 = memo(PaymentElement);
|
|
35063
35063
|
|
|
35064
|
-
function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, contactEmail, shippingAddress, shippingName, shippingPrice, checkoutAppearance, fonts, locale, publicKey, }) {
|
|
35064
|
+
function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, contactEmail, shippingAddress, shippingName, shippingPrice, checkoutAppearance, fonts, locale, publicKey, paymentComponentKey, }) {
|
|
35065
35065
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
35066
|
-
const [key, setKey] = useState(0);
|
|
35067
35066
|
const { t } = useTranslation();
|
|
35068
|
-
useEffect(() => {
|
|
35069
|
-
if (paymentSecret) {
|
|
35070
|
-
setKey((prev) => prev + 1);
|
|
35071
|
-
}
|
|
35072
|
-
}, [paymentSecret]);
|
|
35073
35067
|
return (React__default.createElement("div", { className: "space-y-6" },
|
|
35074
35068
|
React__default.createElement("div", null,
|
|
35075
35069
|
React__default.createElement("h2", { className: "mb-2" }, t("CheckoutEmbed.Payment.title")),
|
|
@@ -35096,7 +35090,7 @@ function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack,
|
|
|
35096
35090
|
" \u00B7 ",
|
|
35097
35091
|
shippingPrice)),
|
|
35098
35092
|
React__default.createElement(Button, { variant: "link", size: "link", onClick: onBack }, t("CheckoutEmbed.Shipping.change")))),
|
|
35099
|
-
React__default.createElement("div", { className: "mt-8" }, paymentSecret && (React__default.createElement(PaymentElement$1, { key:
|
|
35093
|
+
React__default.createElement("div", { className: "mt-8" }, paymentSecret && (React__default.createElement(PaymentElement$1, { key: paymentComponentKey, fonts: fonts, checkoutAppearance: convertCheckoutAppearanceToStripeAppearance(checkoutAppearance, fonts), locale: locale, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, setSubmitting: setIsSubmitting, publicKey: publicKey },
|
|
35100
35094
|
React__default.createElement("div", { className: "flex justify-between items-center pt-8" },
|
|
35101
35095
|
React__default.createElement(Button, { type: "button", variant: "ghost", onClick: onBack },
|
|
35102
35096
|
React__default.createElement(ChevronLeft, null),
|
|
@@ -35273,7 +35267,7 @@ const resetFormStore = (formData) => {
|
|
|
35273
35267
|
localStorage.setItem("checkout", JSON.stringify(Object.assign(Object.assign({}, currentState), { state: Object.assign(Object.assign({}, currentState.state), { step: "customer", formData: { customer: formData.customer } }) })));
|
|
35274
35268
|
};
|
|
35275
35269
|
|
|
35276
|
-
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, paymentSecret, publicKey, }) {
|
|
35270
|
+
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, paymentSecret, publicKey, paymentComponentKey, }) {
|
|
35277
35271
|
const { formData, setFormData, step, setStep, checkoutId: storedCheckoutId, setCheckoutId, } = useFormStore();
|
|
35278
35272
|
const [shippingRates, setShippingRates] = useState([]);
|
|
35279
35273
|
const validateStep = useCallback(() => {
|
|
@@ -35431,7 +35425,7 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
35431
35425
|
};
|
|
35432
35426
|
const renderStep = () => {
|
|
35433
35427
|
if (step === "payment" && formData.customer && formData.shipping) {
|
|
35434
|
-
return (React__default.createElement(PaymentForm, { locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), shippingName: formData.shipping.name, shippingPrice: storeHelpers.formatPrice(formData.shipping.price, currency, exchangeRate), publicKey: publicKey }));
|
|
35428
|
+
return (React__default.createElement(PaymentForm, { paymentComponentKey: paymentComponentKey, locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), shippingName: formData.shipping.name, shippingPrice: storeHelpers.formatPrice(formData.shipping.price, currency, exchangeRate), publicKey: publicKey }));
|
|
35435
35429
|
}
|
|
35436
35430
|
if (step === "shipping" && formData.customer) {
|
|
35437
35431
|
return (React__default.createElement(ShippingMethodForm, { setFormData: setFormData, formData: formData, shippingRates: shippingRates, initialData: formData.shipping, onSubmit: handleShippingSubmit, onBack: handleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), currency: currency, exchangeRate: exchangeRate, locale: locale, countryCode: formData.customer.address.countryCode }));
|
|
@@ -35685,6 +35679,7 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
|
|
|
35685
35679
|
const paymentSecretPromiseRef = useRef(null);
|
|
35686
35680
|
const [paymentSecret, setPaymentSecret] = useState(null);
|
|
35687
35681
|
const [publicKey, setPublicKey] = useState(null);
|
|
35682
|
+
const [paymentComponentKey, setPaymentComponentKey] = useState(0);
|
|
35688
35683
|
const [checkout, setCheckout] = useState(null);
|
|
35689
35684
|
const [loading, setLoading] = useState(true);
|
|
35690
35685
|
useEffect(() => {
|
|
@@ -35755,11 +35750,13 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
|
|
|
35755
35750
|
setCheckout(newCheckout);
|
|
35756
35751
|
if (step === "payment") {
|
|
35757
35752
|
yield generatePaymentSecret();
|
|
35753
|
+
setPaymentComponentKey((prev) => prev + 1);
|
|
35758
35754
|
}
|
|
35759
35755
|
});
|
|
35760
35756
|
const revalidateDiscounts = () => __awaiter(this, void 0, void 0, function* () {
|
|
35761
35757
|
if (step === "payment") {
|
|
35762
35758
|
yield generatePaymentSecret();
|
|
35759
|
+
setPaymentComponentKey((prev) => prev + 1);
|
|
35763
35760
|
}
|
|
35764
35761
|
else {
|
|
35765
35762
|
const newCheckout = yield storeClient.revalidateDiscounts(clientSecret, checkoutId);
|
|
@@ -35771,6 +35768,7 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
|
|
|
35771
35768
|
setCheckout(newCheckout);
|
|
35772
35769
|
if (step === "payment") {
|
|
35773
35770
|
yield generatePaymentSecret();
|
|
35771
|
+
setPaymentComponentKey((prev) => prev + 1);
|
|
35774
35772
|
}
|
|
35775
35773
|
});
|
|
35776
35774
|
useEffect(() => {
|
|
@@ -35784,7 +35782,7 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
|
|
|
35784
35782
|
return (React__default.createElement(IframeWrapper, { iframeRef: iframeRef },
|
|
35785
35783
|
React__default.createElement("div", { className: "checkout-embed h-max gap-6 md:gap-0 py-4 md:py-12 flex flex-col md:grid md:grid-cols-7 " },
|
|
35786
35784
|
React__default.createElement(Appearance, { appearance: appearance, fonts: config.fonts, iframeRef: iframeRef }),
|
|
35787
|
-
React__default.createElement("div", { className: "md:col-span-4 px-4 h-max md:px-8" }, loading ? (React__default.createElement(CheckoutFormLoading, null)) : (React__default.createElement(CheckoutForm, { locale: locale, setShippingCost: setShippingCost, storeClient: storeClient, fonts: config.fonts, checkoutAppearance: appearance, currency: (_a = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _a !== void 0 ? _a : "", customer: checkout === null || checkout === void 0 ? void 0 : checkout.customer, cancelUrl: cancelUrl, checkoutId: checkoutId, clientSecret: clientSecret, onSuccess: onSuccess, onError: onError, exchangeRate: (_b = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _b !== void 0 ? _b : 1, publicKey: publicKey, paymentSecret: paymentSecret }))),
|
|
35785
|
+
React__default.createElement("div", { className: "md:col-span-4 px-4 h-max md:px-8" }, loading ? (React__default.createElement(CheckoutFormLoading, null)) : (React__default.createElement(CheckoutForm, { locale: locale, setShippingCost: setShippingCost, storeClient: storeClient, fonts: config.fonts, checkoutAppearance: appearance, currency: (_a = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _a !== void 0 ? _a : "", customer: checkout === null || checkout === void 0 ? void 0 : checkout.customer, cancelUrl: cancelUrl, checkoutId: checkoutId, clientSecret: clientSecret, onSuccess: onSuccess, onError: onError, exchangeRate: (_b = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _b !== void 0 ? _b : 1, publicKey: publicKey, paymentSecret: paymentSecret, paymentComponentKey: paymentComponentKey }))),
|
|
35788
35786
|
React__default.createElement("div", { className: "md:col-span-3 px-4 md:px-8 h-max order-first md:order-last" },
|
|
35789
35787
|
React__default.createElement(Toaster, null),
|
|
35790
35788
|
loading ? (React__default.createElement(CheckoutSummaryLoading, null)) : (React__default.createElement(CheckoutSummary, { currency: (_c = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _c !== void 0 ? _c : "", lineItems: (_d = checkout === null || checkout === void 0 ? void 0 : checkout.lineItems) !== null && _d !== void 0 ? _d : [], shipping: checkout === null || checkout === void 0 ? void 0 : checkout.shipping, tax: checkout === null || checkout === void 0 ? void 0 : checkout.tax, onCancel: onCancel, exchangeRate: (_e = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _e !== void 0 ? _e : 1, applyDiscountCode: applyDiscountCode, appliedDiscounts: (_f = checkout === null || checkout === void 0 ? void 0 : checkout.appliedDiscounts) !== null && _f !== void 0 ? _f : [], removeDiscount: removeDiscount }))))));
|