@pelcro/react-pelcro-js 3.9.0 → 3.9.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.js +4 -3
- package/dist/index.esm.js +4 -3
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -16011,7 +16011,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16011
16011
|
payload: paymentRequest
|
|
16012
16012
|
});
|
|
16013
16013
|
} catch {
|
|
16014
|
-
console.log("Google Pay/Apple pay isn't available in this country");
|
|
16014
|
+
console.log("Google Pay/Apple pay isn't available/supported in this country");
|
|
16015
16015
|
}
|
|
16016
16016
|
};
|
|
16017
16017
|
/**
|
|
@@ -17193,7 +17193,7 @@ const CheckoutForm = () => {
|
|
|
17193
17193
|
};
|
|
17194
17194
|
|
|
17195
17195
|
const DiscountedPrice = props => {
|
|
17196
|
-
var _order$currency, _order$, _plan$quantity;
|
|
17196
|
+
var _window$Pelcro$site, _window$Pelcro$site$r, _order$currency, _order$, _plan$quantity;
|
|
17197
17197
|
|
|
17198
17198
|
const {
|
|
17199
17199
|
t
|
|
@@ -17210,9 +17210,10 @@ const DiscountedPrice = props => {
|
|
|
17210
17210
|
order,
|
|
17211
17211
|
plan
|
|
17212
17212
|
} = usePelcro();
|
|
17213
|
+
const isTaxInclusive = (_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tax_inclusive;
|
|
17213
17214
|
const ecommOrderCurrency = (_order$currency = order === null || order === void 0 ? void 0 : order.currency) !== null && _order$currency !== void 0 ? _order$currency : order === null || order === void 0 ? void 0 : (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency;
|
|
17214
17215
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
17215
|
-
const discountedPriceWithoutTax = updatedPrice - taxAmount;
|
|
17216
|
+
const discountedPriceWithoutTax = isTaxInclusive ? updatedPrice : updatedPrice - taxAmount;
|
|
17216
17217
|
const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : discountedPriceWithoutTax * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
17217
17218
|
|
|
17218
17219
|
const onCouponRemove = () => {
|
package/dist/index.esm.js
CHANGED
|
@@ -15981,7 +15981,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15981
15981
|
payload: paymentRequest
|
|
15982
15982
|
});
|
|
15983
15983
|
} catch {
|
|
15984
|
-
console.log("Google Pay/Apple pay isn't available in this country");
|
|
15984
|
+
console.log("Google Pay/Apple pay isn't available/supported in this country");
|
|
15985
15985
|
}
|
|
15986
15986
|
};
|
|
15987
15987
|
/**
|
|
@@ -17163,7 +17163,7 @@ const CheckoutForm = () => {
|
|
|
17163
17163
|
};
|
|
17164
17164
|
|
|
17165
17165
|
const DiscountedPrice = props => {
|
|
17166
|
-
var _order$currency, _order$, _plan$quantity;
|
|
17166
|
+
var _window$Pelcro$site, _window$Pelcro$site$r, _order$currency, _order$, _plan$quantity;
|
|
17167
17167
|
|
|
17168
17168
|
const {
|
|
17169
17169
|
t
|
|
@@ -17180,9 +17180,10 @@ const DiscountedPrice = props => {
|
|
|
17180
17180
|
order,
|
|
17181
17181
|
plan
|
|
17182
17182
|
} = usePelcro();
|
|
17183
|
+
const isTaxInclusive = (_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tax_inclusive;
|
|
17183
17184
|
const ecommOrderCurrency = (_order$currency = order === null || order === void 0 ? void 0 : order.currency) !== null && _order$currency !== void 0 ? _order$currency : order === null || order === void 0 ? void 0 : (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency;
|
|
17184
17185
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
17185
|
-
const discountedPriceWithoutTax = updatedPrice - taxAmount;
|
|
17186
|
+
const discountedPriceWithoutTax = isTaxInclusive ? updatedPrice : updatedPrice - taxAmount;
|
|
17186
17187
|
const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : discountedPriceWithoutTax * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
17187
17188
|
|
|
17188
17189
|
const onCouponRemove = () => {
|