@pelcro/react-pelcro-js 3.22.0-beta.10 → 3.22.0-beta.12
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 +26 -18
- package/dist/index.esm.js +26 -18
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3457,7 +3457,8 @@ var labels$10 = {
|
|
|
3457
3457
|
removeCoupon: "REMOVE",
|
|
3458
3458
|
firstName: "First name",
|
|
3459
3459
|
lastName: "Last name",
|
|
3460
|
-
phone: "Phone"
|
|
3460
|
+
phone: "Phone",
|
|
3461
|
+
freeItems: "Free Items"
|
|
3461
3462
|
};
|
|
3462
3463
|
var checkoutForm_en = {
|
|
3463
3464
|
messages: messages$14,
|
|
@@ -4398,7 +4399,8 @@ var labels$H = {
|
|
|
4398
4399
|
removeCoupon: "RETIRER",
|
|
4399
4400
|
firstName: "Prénom",
|
|
4400
4401
|
lastName: "Nom de famille",
|
|
4401
|
-
phone: "Téléphoner"
|
|
4402
|
+
phone: "Téléphoner",
|
|
4403
|
+
freeItems: "Articles gratuits"
|
|
4402
4404
|
};
|
|
4403
4405
|
var checkoutForm_fr = {
|
|
4404
4406
|
messages: messages$M,
|
|
@@ -5225,7 +5227,8 @@ var labels$s = {
|
|
|
5225
5227
|
removeCoupon: "제거",
|
|
5226
5228
|
firstName: "이름",
|
|
5227
5229
|
lastName: "성",
|
|
5228
|
-
phone: "핸드폰"
|
|
5230
|
+
phone: "핸드폰",
|
|
5231
|
+
freeItems: "무료 아이템"
|
|
5229
5232
|
};
|
|
5230
5233
|
var checkoutForm_ko = {
|
|
5231
5234
|
messages: messages$v,
|
|
@@ -6156,7 +6159,8 @@ var labels$d = {
|
|
|
6156
6159
|
removeCoupon: "ELIMINAR",
|
|
6157
6160
|
firstName: "Nombre",
|
|
6158
6161
|
lastName: "Apellido",
|
|
6159
|
-
phone: "Teléfono"
|
|
6162
|
+
phone: "Teléfono",
|
|
6163
|
+
freeItems: "Artículos gratis"
|
|
6160
6164
|
};
|
|
6161
6165
|
var checkoutForm_es = {
|
|
6162
6166
|
messages: messages$e,
|
|
@@ -16841,7 +16845,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16841
16845
|
const tapInstanceRef = React__default['default'].useRef(null);
|
|
16842
16846
|
const tapInstanceCard = React__default['default'].useRef(null);
|
|
16843
16847
|
React.useEffect(() => {
|
|
16844
|
-
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 ||
|
|
16848
|
+
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 || props !== null && props !== void 0 && props.freeOrders)) return;
|
|
16845
16849
|
if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
|
|
16846
16850
|
var _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
16847
16851
|
const payPageId = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.pay_page_id;
|
|
@@ -16877,7 +16881,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16877
16881
|
}, [vantivPaymentRequest]);
|
|
16878
16882
|
React.useEffect(() => {
|
|
16879
16883
|
whenUserReady(() => {
|
|
16880
|
-
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 ||
|
|
16884
|
+
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 || props !== null && props !== void 0 && props.freeOrders)) return;
|
|
16881
16885
|
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
16882
16886
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
16883
16887
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
@@ -16891,7 +16895,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16891
16895
|
});
|
|
16892
16896
|
}, [selectedPaymentMethodId]);
|
|
16893
16897
|
const initPaymentRequest = (state, dispatch) => {
|
|
16894
|
-
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 ||
|
|
16898
|
+
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 || props !== null && props !== void 0 && props.freeOrders)) return;
|
|
16895
16899
|
try {
|
|
16896
16900
|
const paymentRequest = stripe.paymentRequest({
|
|
16897
16901
|
country: window.Pelcro.user.location.countryCode || "US",
|
|
@@ -16960,7 +16964,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16960
16964
|
*/
|
|
16961
16965
|
const updateTotalAmountWithTax = () => {
|
|
16962
16966
|
var _window$Pelcro$site$r4;
|
|
16963
|
-
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 ||
|
|
16967
|
+
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 || props !== null && props !== void 0 && props.freeOrders)) return;
|
|
16964
16968
|
const taxesEnabled = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.taxes_enabled;
|
|
16965
16969
|
if (taxesEnabled && type === "createPayment") {
|
|
16966
16970
|
dispatch({
|
|
@@ -17564,7 +17568,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17564
17568
|
});
|
|
17565
17569
|
};
|
|
17566
17570
|
const submitPayment = (state, dispatch) => {
|
|
17567
|
-
if (skipPayment &&
|
|
17571
|
+
if (skipPayment && props !== null && props !== void 0 && props.freeOrders) {
|
|
17568
17572
|
const isQuickPurchase = !Array.isArray(order);
|
|
17569
17573
|
const mappedOrderItems = isQuickPurchase ? [{
|
|
17570
17574
|
sku_id: order.id,
|
|
@@ -17820,7 +17824,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17820
17824
|
disableSubmit: true,
|
|
17821
17825
|
isLoading: true
|
|
17822
17826
|
}, (state, dispatch) => {
|
|
17823
|
-
if (skipPayment &&
|
|
17827
|
+
if (skipPayment && props !== null && props !== void 0 && props.freeOrders) {
|
|
17824
17828
|
return submitPayment(state);
|
|
17825
17829
|
}
|
|
17826
17830
|
if (getSiteCardProcessor() === "vantiv") {
|
|
@@ -17986,11 +17990,12 @@ const PaymentMethodContainer = props => {
|
|
|
17986
17990
|
}, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
|
|
17987
17991
|
store: store$k
|
|
17988
17992
|
}, props))));
|
|
17989
|
-
} else {
|
|
17993
|
+
} else if (cardProcessor !== "stripe") {
|
|
17990
17994
|
return /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainerWithoutStripe, Object.assign({
|
|
17991
17995
|
store: store$k
|
|
17992
17996
|
}, props));
|
|
17993
17997
|
}
|
|
17998
|
+
return null;
|
|
17994
17999
|
};
|
|
17995
18000
|
|
|
17996
18001
|
const StripeInputStyle = {
|
|
@@ -18820,7 +18825,7 @@ const OrderCreateFreeButton = _ref => {
|
|
|
18820
18825
|
*
|
|
18821
18826
|
*/
|
|
18822
18827
|
function PaymentMethodView(_ref) {
|
|
18823
|
-
var _window$Pelcro$site$r, _window$Pelcro$site$r2
|
|
18828
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _calcAndFormatItemsTo, _order$;
|
|
18824
18829
|
let {
|
|
18825
18830
|
onSuccess,
|
|
18826
18831
|
onGiftRenewalSuccess,
|
|
@@ -18843,15 +18848,17 @@ function PaymentMethodView(_ref) {
|
|
|
18843
18848
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
18844
18849
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
18845
18850
|
className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
|
|
18846
|
-
}, order &&
|
|
18851
|
+
}, order && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
18847
18852
|
className: "plc-w-full plc-p-2 plc-mb-4 plc-font-semibold plc-text-center plc-text-gray-900 plc-bg-gray-100 plc-border plc-border-gray-200"
|
|
18848
18853
|
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
18849
18854
|
className: "plc-text-gray-600"
|
|
18850
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
18855
|
+
}, !Array.isArray(order) ? /*#__PURE__*/React__default['default'].createElement("span", {
|
|
18856
|
+
className: "plc-tracking-wider plc-uppercase"
|
|
18857
|
+
}, order === null || order === void 0 ? void 0 : order.name) : /*#__PURE__*/React__default['default'].createElement("span", {
|
|
18851
18858
|
className: "plc-tracking-wider plc-uppercase"
|
|
18852
|
-
},
|
|
18859
|
+
}, t("labels.freeItems")), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
18853
18860
|
className: "plc-text-xl plc-font-semibold plc-text-primary-600"
|
|
18854
|
-
}, getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
18861
|
+
}, (_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
18855
18862
|
className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
|
|
18856
18863
|
}, /*#__PURE__*/React__default['default'].createElement(SvgLock, {
|
|
18857
18864
|
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
@@ -18867,7 +18874,8 @@ function PaymentMethodView(_ref) {
|
|
|
18867
18874
|
type: type,
|
|
18868
18875
|
onSuccess: onSuccess,
|
|
18869
18876
|
onGiftRenewalSuccess: onGiftRenewalSuccess,
|
|
18870
|
-
onFailure: onFailure
|
|
18877
|
+
onFailure: onFailure,
|
|
18878
|
+
freeOrders: showOrderButton
|
|
18871
18879
|
}, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
18872
18880
|
className: "plc-mb-2"
|
|
18873
18881
|
}), showSubscriptionButton && /*#__PURE__*/React__default['default'].createElement(SubscriptionCreateFreePlanButton, null), showOrderButton && /*#__PURE__*/React__default['default'].createElement(OrderCreateFreeButton, null), !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(BankRedirection, null), /*#__PURE__*/React__default['default'].createElement(BankAuthenticationSuccess, null), /*#__PURE__*/React__default['default'].createElement(SelectedPaymentMethod, null), supportsTap && (!isUserFirstName || !isUserLastName || !isUserPhone) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -24293,7 +24301,7 @@ const OrderCreateView = props => {
|
|
|
24293
24301
|
order
|
|
24294
24302
|
} = usePelcro();
|
|
24295
24303
|
const skipPayment = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.skipPaymentForFreePlans;
|
|
24296
|
-
const showOrderButton = skipPayment && (order === null || order === void 0 ? void 0 : order.price) === 0;
|
|
24304
|
+
const showOrderButton = skipPayment && ((order === null || order === void 0 ? void 0 : order.price) === 0 || (order === null || order === void 0 ? void 0 : order.length) > 0 && order.every(item => (item === null || item === void 0 ? void 0 : item.price) === 0));
|
|
24297
24305
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24298
24306
|
id: "pelcro-order-create-view"
|
|
24299
24307
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
package/dist/index.esm.js
CHANGED
|
@@ -3427,7 +3427,8 @@ var labels$10 = {
|
|
|
3427
3427
|
removeCoupon: "REMOVE",
|
|
3428
3428
|
firstName: "First name",
|
|
3429
3429
|
lastName: "Last name",
|
|
3430
|
-
phone: "Phone"
|
|
3430
|
+
phone: "Phone",
|
|
3431
|
+
freeItems: "Free Items"
|
|
3431
3432
|
};
|
|
3432
3433
|
var checkoutForm_en = {
|
|
3433
3434
|
messages: messages$14,
|
|
@@ -4368,7 +4369,8 @@ var labels$H = {
|
|
|
4368
4369
|
removeCoupon: "RETIRER",
|
|
4369
4370
|
firstName: "Prénom",
|
|
4370
4371
|
lastName: "Nom de famille",
|
|
4371
|
-
phone: "Téléphoner"
|
|
4372
|
+
phone: "Téléphoner",
|
|
4373
|
+
freeItems: "Articles gratuits"
|
|
4372
4374
|
};
|
|
4373
4375
|
var checkoutForm_fr = {
|
|
4374
4376
|
messages: messages$M,
|
|
@@ -5195,7 +5197,8 @@ var labels$s = {
|
|
|
5195
5197
|
removeCoupon: "제거",
|
|
5196
5198
|
firstName: "이름",
|
|
5197
5199
|
lastName: "성",
|
|
5198
|
-
phone: "핸드폰"
|
|
5200
|
+
phone: "핸드폰",
|
|
5201
|
+
freeItems: "무료 아이템"
|
|
5199
5202
|
};
|
|
5200
5203
|
var checkoutForm_ko = {
|
|
5201
5204
|
messages: messages$v,
|
|
@@ -6126,7 +6129,8 @@ var labels$d = {
|
|
|
6126
6129
|
removeCoupon: "ELIMINAR",
|
|
6127
6130
|
firstName: "Nombre",
|
|
6128
6131
|
lastName: "Apellido",
|
|
6129
|
-
phone: "Teléfono"
|
|
6132
|
+
phone: "Teléfono",
|
|
6133
|
+
freeItems: "Artículos gratis"
|
|
6130
6134
|
};
|
|
6131
6135
|
var checkoutForm_es = {
|
|
6132
6136
|
messages: messages$e,
|
|
@@ -16811,7 +16815,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16811
16815
|
const tapInstanceRef = React__default.useRef(null);
|
|
16812
16816
|
const tapInstanceCard = React__default.useRef(null);
|
|
16813
16817
|
useEffect(() => {
|
|
16814
|
-
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 ||
|
|
16818
|
+
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 || props !== null && props !== void 0 && props.freeOrders)) return;
|
|
16815
16819
|
if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
|
|
16816
16820
|
var _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
16817
16821
|
const payPageId = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.pay_page_id;
|
|
@@ -16847,7 +16851,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16847
16851
|
}, [vantivPaymentRequest]);
|
|
16848
16852
|
useEffect(() => {
|
|
16849
16853
|
whenUserReady(() => {
|
|
16850
|
-
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 ||
|
|
16854
|
+
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 || props !== null && props !== void 0 && props.freeOrders)) return;
|
|
16851
16855
|
if (cardProcessor === "tap" && !window.Tapjsli) {
|
|
16852
16856
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
16853
16857
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
@@ -16861,7 +16865,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16861
16865
|
});
|
|
16862
16866
|
}, [selectedPaymentMethodId]);
|
|
16863
16867
|
const initPaymentRequest = (state, dispatch) => {
|
|
16864
|
-
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 ||
|
|
16868
|
+
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 || props !== null && props !== void 0 && props.freeOrders)) return;
|
|
16865
16869
|
try {
|
|
16866
16870
|
const paymentRequest = stripe.paymentRequest({
|
|
16867
16871
|
country: window.Pelcro.user.location.countryCode || "US",
|
|
@@ -16930,7 +16934,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
16930
16934
|
*/
|
|
16931
16935
|
const updateTotalAmountWithTax = () => {
|
|
16932
16936
|
var _window$Pelcro$site$r4;
|
|
16933
|
-
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 ||
|
|
16937
|
+
if (skipPayment && ((plan === null || plan === void 0 ? void 0 : plan.amount) === 0 || props !== null && props !== void 0 && props.freeOrders)) return;
|
|
16934
16938
|
const taxesEnabled = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.taxes_enabled;
|
|
16935
16939
|
if (taxesEnabled && type === "createPayment") {
|
|
16936
16940
|
dispatch({
|
|
@@ -17534,7 +17538,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17534
17538
|
});
|
|
17535
17539
|
};
|
|
17536
17540
|
const submitPayment = (state, dispatch) => {
|
|
17537
|
-
if (skipPayment &&
|
|
17541
|
+
if (skipPayment && props !== null && props !== void 0 && props.freeOrders) {
|
|
17538
17542
|
const isQuickPurchase = !Array.isArray(order);
|
|
17539
17543
|
const mappedOrderItems = isQuickPurchase ? [{
|
|
17540
17544
|
sku_id: order.id,
|
|
@@ -17790,7 +17794,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17790
17794
|
disableSubmit: true,
|
|
17791
17795
|
isLoading: true
|
|
17792
17796
|
}, (state, dispatch) => {
|
|
17793
|
-
if (skipPayment &&
|
|
17797
|
+
if (skipPayment && props !== null && props !== void 0 && props.freeOrders) {
|
|
17794
17798
|
return submitPayment(state);
|
|
17795
17799
|
}
|
|
17796
17800
|
if (getSiteCardProcessor() === "vantiv") {
|
|
@@ -17956,11 +17960,12 @@ const PaymentMethodContainer = props => {
|
|
|
17956
17960
|
}, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
|
|
17957
17961
|
store: store$k
|
|
17958
17962
|
}, props))));
|
|
17959
|
-
} else {
|
|
17963
|
+
} else if (cardProcessor !== "stripe") {
|
|
17960
17964
|
return /*#__PURE__*/React__default.createElement(PaymentMethodContainerWithoutStripe, Object.assign({
|
|
17961
17965
|
store: store$k
|
|
17962
17966
|
}, props));
|
|
17963
17967
|
}
|
|
17968
|
+
return null;
|
|
17964
17969
|
};
|
|
17965
17970
|
|
|
17966
17971
|
const StripeInputStyle = {
|
|
@@ -18790,7 +18795,7 @@ const OrderCreateFreeButton = _ref => {
|
|
|
18790
18795
|
*
|
|
18791
18796
|
*/
|
|
18792
18797
|
function PaymentMethodView(_ref) {
|
|
18793
|
-
var _window$Pelcro$site$r, _window$Pelcro$site$r2
|
|
18798
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _calcAndFormatItemsTo, _order$;
|
|
18794
18799
|
let {
|
|
18795
18800
|
onSuccess,
|
|
18796
18801
|
onGiftRenewalSuccess,
|
|
@@ -18813,15 +18818,17 @@ function PaymentMethodView(_ref) {
|
|
|
18813
18818
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
18814
18819
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
18815
18820
|
className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
|
|
18816
|
-
}, order &&
|
|
18821
|
+
}, order && /*#__PURE__*/React__default.createElement("div", {
|
|
18817
18822
|
className: "plc-w-full plc-p-2 plc-mb-4 plc-font-semibold plc-text-center plc-text-gray-900 plc-bg-gray-100 plc-border plc-border-gray-200"
|
|
18818
18823
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
18819
18824
|
className: "plc-text-gray-600"
|
|
18820
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
18825
|
+
}, !Array.isArray(order) ? /*#__PURE__*/React__default.createElement("span", {
|
|
18826
|
+
className: "plc-tracking-wider plc-uppercase"
|
|
18827
|
+
}, order === null || order === void 0 ? void 0 : order.name) : /*#__PURE__*/React__default.createElement("span", {
|
|
18821
18828
|
className: "plc-tracking-wider plc-uppercase"
|
|
18822
|
-
},
|
|
18829
|
+
}, t("labels.freeItems")), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
|
|
18823
18830
|
className: "plc-text-xl plc-font-semibold plc-text-primary-600"
|
|
18824
|
-
}, getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default.createElement("div", {
|
|
18831
|
+
}, (_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default.createElement("div", {
|
|
18825
18832
|
className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
|
|
18826
18833
|
}, /*#__PURE__*/React__default.createElement(SvgLock, {
|
|
18827
18834
|
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
@@ -18837,7 +18844,8 @@ function PaymentMethodView(_ref) {
|
|
|
18837
18844
|
type: type,
|
|
18838
18845
|
onSuccess: onSuccess,
|
|
18839
18846
|
onGiftRenewalSuccess: onGiftRenewalSuccess,
|
|
18840
|
-
onFailure: onFailure
|
|
18847
|
+
onFailure: onFailure,
|
|
18848
|
+
freeOrders: showOrderButton
|
|
18841
18849
|
}, /*#__PURE__*/React__default.createElement(AlertWithContext, {
|
|
18842
18850
|
className: "plc-mb-2"
|
|
18843
18851
|
}), showSubscriptionButton && /*#__PURE__*/React__default.createElement(SubscriptionCreateFreePlanButton, null), showOrderButton && /*#__PURE__*/React__default.createElement(OrderCreateFreeButton, null), !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(BankRedirection, null), /*#__PURE__*/React__default.createElement(BankAuthenticationSuccess, null), /*#__PURE__*/React__default.createElement(SelectedPaymentMethod, null), supportsTap && (!isUserFirstName || !isUserLastName || !isUserPhone) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -24263,7 +24271,7 @@ const OrderCreateView = props => {
|
|
|
24263
24271
|
order
|
|
24264
24272
|
} = usePelcro();
|
|
24265
24273
|
const skipPayment = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.skipPaymentForFreePlans;
|
|
24266
|
-
const showOrderButton = skipPayment && (order === null || order === void 0 ? void 0 : order.price) === 0;
|
|
24274
|
+
const showOrderButton = skipPayment && ((order === null || order === void 0 ? void 0 : order.price) === 0 || (order === null || order === void 0 ? void 0 : order.length) > 0 && order.every(item => (item === null || item === void 0 ? void 0 : item.price) === 0));
|
|
24267
24275
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
24268
24276
|
id: "pelcro-order-create-view"
|
|
24269
24277
|
}, /*#__PURE__*/React__default.createElement("div", {
|