@pelcro/react-pelcro-js 3.26.0-beta.75 → 3.26.0-beta.76
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 +9 -4
- package/dist/index.esm.js +9 -4
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -20457,6 +20457,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
20457
20457
|
address_id: selectedAddressId
|
|
20458
20458
|
}, handleCouponResponse);
|
|
20459
20459
|
} else if (type === "orderCreate") {
|
|
20460
|
+
var _window$Pelcro$site$r9;
|
|
20460
20461
|
const isQuickPurchase = !Array.isArray(order);
|
|
20461
20462
|
const mappedOrderItems = isQuickPurchase ? [{
|
|
20462
20463
|
sku_id: order.id,
|
|
@@ -20465,10 +20466,14 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
20465
20466
|
sku_id: item.id,
|
|
20466
20467
|
quantity: item.quantity
|
|
20467
20468
|
}));
|
|
20468
|
-
|
|
20469
|
+
const orderSummaryParams = {
|
|
20469
20470
|
items: mappedOrderItems,
|
|
20470
20471
|
coupon_code: couponCode
|
|
20471
|
-
}
|
|
20472
|
+
};
|
|
20473
|
+
if ((_window$Pelcro$site$r9 = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r9 !== void 0 && _window$Pelcro$site$r9.taxes_enabled) {
|
|
20474
|
+
orderSummaryParams.address_id = selectedAddressId;
|
|
20475
|
+
}
|
|
20476
|
+
window.Pelcro.ecommerce.order.createSummary(orderSummaryParams, handleCouponResponse);
|
|
20472
20477
|
}
|
|
20473
20478
|
}
|
|
20474
20479
|
};
|
|
@@ -21371,11 +21376,11 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
21371
21376
|
* @return {Promise}
|
|
21372
21377
|
*/
|
|
21373
21378
|
const resolveTaxCalculation = () => {
|
|
21374
|
-
var _window$Pelcro$site$
|
|
21379
|
+
var _window$Pelcro$site$r10;
|
|
21375
21380
|
if (type === "invoicePayment") {
|
|
21376
21381
|
return new Promise(resolve => resolve());
|
|
21377
21382
|
}
|
|
21378
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
21383
|
+
const taxesEnabled = (_window$Pelcro$site$r10 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r10 === void 0 ? void 0 : _window$Pelcro$site$r10.taxes_enabled;
|
|
21379
21384
|
return new Promise((resolve, reject) => {
|
|
21380
21385
|
// resolve early if taxes isn't enabled
|
|
21381
21386
|
if (!taxesEnabled) {
|
package/dist/index.esm.js
CHANGED
|
@@ -20427,6 +20427,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
20427
20427
|
address_id: selectedAddressId
|
|
20428
20428
|
}, handleCouponResponse);
|
|
20429
20429
|
} else if (type === "orderCreate") {
|
|
20430
|
+
var _window$Pelcro$site$r9;
|
|
20430
20431
|
const isQuickPurchase = !Array.isArray(order);
|
|
20431
20432
|
const mappedOrderItems = isQuickPurchase ? [{
|
|
20432
20433
|
sku_id: order.id,
|
|
@@ -20435,10 +20436,14 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
20435
20436
|
sku_id: item.id,
|
|
20436
20437
|
quantity: item.quantity
|
|
20437
20438
|
}));
|
|
20438
|
-
|
|
20439
|
+
const orderSummaryParams = {
|
|
20439
20440
|
items: mappedOrderItems,
|
|
20440
20441
|
coupon_code: couponCode
|
|
20441
|
-
}
|
|
20442
|
+
};
|
|
20443
|
+
if ((_window$Pelcro$site$r9 = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r9 !== void 0 && _window$Pelcro$site$r9.taxes_enabled) {
|
|
20444
|
+
orderSummaryParams.address_id = selectedAddressId;
|
|
20445
|
+
}
|
|
20446
|
+
window.Pelcro.ecommerce.order.createSummary(orderSummaryParams, handleCouponResponse);
|
|
20442
20447
|
}
|
|
20443
20448
|
}
|
|
20444
20449
|
};
|
|
@@ -21341,11 +21346,11 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
21341
21346
|
* @return {Promise}
|
|
21342
21347
|
*/
|
|
21343
21348
|
const resolveTaxCalculation = () => {
|
|
21344
|
-
var _window$Pelcro$site$
|
|
21349
|
+
var _window$Pelcro$site$r10;
|
|
21345
21350
|
if (type === "invoicePayment") {
|
|
21346
21351
|
return new Promise(resolve => resolve());
|
|
21347
21352
|
}
|
|
21348
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
21353
|
+
const taxesEnabled = (_window$Pelcro$site$r10 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r10 === void 0 ? void 0 : _window$Pelcro$site$r10.taxes_enabled;
|
|
21349
21354
|
return new Promise((resolve, reject) => {
|
|
21350
21355
|
// resolve early if taxes isn't enabled
|
|
21351
21356
|
if (!taxesEnabled) {
|