@ikas/storefront 0.0.164-alpha.4 → 0.0.164-alpha.5
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/build/components/checkout/model.d.ts +0 -2
- package/build/index.es.js +38 -42
- package/build/index.js +38 -42
- package/build/pages/checkout/[id].d.ts +0 -2
- package/package.json +1 -1
|
@@ -23,7 +23,6 @@ export default class CheckoutViewModel {
|
|
|
23
23
|
step: CheckoutStep;
|
|
24
24
|
merchantSettings?: IkasMerchantSettings;
|
|
25
25
|
cardData?: CreditCardData | null;
|
|
26
|
-
paymentGatewayId?: string | null;
|
|
27
26
|
paymentGateways: IkasPaymentGateway[];
|
|
28
27
|
installmentInfo?: IkasInstallmentInfo | null;
|
|
29
28
|
useDifferentAddress: boolean;
|
|
@@ -48,7 +47,6 @@ export default class CheckoutViewModel {
|
|
|
48
47
|
getMerchantSettings: () => Promise<void>;
|
|
49
48
|
get cart(): import("../../models/data/cart/index").IkasCart | null | undefined;
|
|
50
49
|
get selectedPaymentGatewayIndex(): number;
|
|
51
|
-
get selectedPaymentGateway(): IkasPaymentGateway | undefined;
|
|
52
50
|
get selectedInstallmentIndex(): number;
|
|
53
51
|
get checkoutUrl(): string;
|
|
54
52
|
get customerAddressOptions(): {
|
package/build/index.es.js
CHANGED
|
@@ -22809,7 +22809,6 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
22809
22809
|
this.isChangingShippingMethod = false;
|
|
22810
22810
|
this.step = CheckoutStep.INFO;
|
|
22811
22811
|
this.cardData = null;
|
|
22812
|
-
this.paymentGatewayId = null;
|
|
22813
22812
|
this.paymentGateways = [];
|
|
22814
22813
|
this.installmentInfo = null;
|
|
22815
22814
|
this.useDifferentAddress = false;
|
|
@@ -22842,7 +22841,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
22842
22841
|
});
|
|
22843
22842
|
}); };
|
|
22844
22843
|
this.initStep = function (queryParams) { return __awaiter(_this, void 0, void 0, function () {
|
|
22845
|
-
var _a, transactions;
|
|
22844
|
+
var _a, transactions, paymentGatewayId_1;
|
|
22846
22845
|
return __generator(this, function (_b) {
|
|
22847
22846
|
switch (_b.label) {
|
|
22848
22847
|
case 0:
|
|
@@ -22914,6 +22913,10 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
22914
22913
|
this.successTransaction = transactions.length
|
|
22915
22914
|
? transactions[0]
|
|
22916
22915
|
: undefined;
|
|
22916
|
+
if (this.successTransaction) {
|
|
22917
|
+
paymentGatewayId_1 = this.successTransaction.paymentGatewayId;
|
|
22918
|
+
this.checkout.selectedPaymentGateway = this.paymentGateways.find(function (pg) { return pg.id === paymentGatewayId_1; });
|
|
22919
|
+
}
|
|
22917
22920
|
_b.label = 11;
|
|
22918
22921
|
case 11:
|
|
22919
22922
|
this.isCheckoutLoaded = true;
|
|
@@ -23093,7 +23096,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23093
23096
|
orderedPaymentGateways.push(_pg);
|
|
23094
23097
|
});
|
|
23095
23098
|
this.paymentGateways = isLocal ? paymentGateways : orderedPaymentGateways;
|
|
23096
|
-
if (!this.
|
|
23099
|
+
if (!this.checkout.selectedPaymentGateway)
|
|
23097
23100
|
this.setPaymentGateway(0);
|
|
23098
23101
|
return [2 /*return*/];
|
|
23099
23102
|
}
|
|
@@ -23244,7 +23247,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23244
23247
|
if (oldOriginalValue.length < 6 && originalValue.length >= 6) {
|
|
23245
23248
|
_this.retrieveInstallmentInfo({
|
|
23246
23249
|
binNumber: originalValue.slice(0, 6),
|
|
23247
|
-
paymentGatewayId: _this.
|
|
23250
|
+
paymentGatewayId: _this.checkout.selectedPaymentGateway.id,
|
|
23248
23251
|
price: _this.checkout.totalFinalPrice,
|
|
23249
23252
|
});
|
|
23250
23253
|
}
|
|
@@ -23483,15 +23486,17 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23483
23486
|
}); };
|
|
23484
23487
|
this.createSaleTransaction = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
23485
23488
|
var response, transactionStatus, transactionSuccess, transactionPending;
|
|
23486
|
-
|
|
23487
|
-
|
|
23488
|
-
|
|
23489
|
-
|
|
23490
|
-
|
|
23491
|
-
|
|
23492
|
-
|
|
23489
|
+
return __generator(this, function (_a) {
|
|
23490
|
+
switch (_a.label) {
|
|
23491
|
+
case 0:
|
|
23492
|
+
if (!this.checkout.selectedPaymentGateway)
|
|
23493
|
+
return [2 /*return*/];
|
|
23494
|
+
return [4 /*yield*/, IkasCheckoutAPI.createSaleTransactionWithCheckout(this.checkout.id, this.checkout.selectedPaymentGateway.id, this.checkout.selectedPaymentGateway.paymentMethodType ===
|
|
23495
|
+
IkasPaymentMethodType.CREDIT_CARD && this.cardData
|
|
23496
|
+
? this.cardData.toInput()
|
|
23497
|
+
: undefined)];
|
|
23493
23498
|
case 1:
|
|
23494
|
-
response =
|
|
23499
|
+
response = _a.sent();
|
|
23495
23500
|
transactionStatus = response === null || response === void 0 ? void 0 : response.transactionStatus;
|
|
23496
23501
|
transactionSuccess = transactionStatus &&
|
|
23497
23502
|
[
|
|
@@ -23502,7 +23507,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23502
23507
|
if (!transactionSuccess) return [3 /*break*/, 3];
|
|
23503
23508
|
return [4 /*yield*/, this.onCheckoutTransactionSuccess()];
|
|
23504
23509
|
case 2:
|
|
23505
|
-
|
|
23510
|
+
_a.sent();
|
|
23506
23511
|
return [3 /*break*/, 4];
|
|
23507
23512
|
case 3:
|
|
23508
23513
|
if (transactionPending && !!(response === null || response === void 0 ? void 0 : response.returnSlug)) {
|
|
@@ -23514,7 +23519,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23514
23519
|
type: ErrorType.UNKNOWN,
|
|
23515
23520
|
};
|
|
23516
23521
|
}
|
|
23517
|
-
|
|
23522
|
+
_a.label = 4;
|
|
23518
23523
|
case 4: return [2 /*return*/];
|
|
23519
23524
|
}
|
|
23520
23525
|
});
|
|
@@ -23564,12 +23569,13 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23564
23569
|
};
|
|
23565
23570
|
this.setPaymentGateway = function (index) {
|
|
23566
23571
|
var paymentGateway = _this.paymentGateways[index];
|
|
23567
|
-
_this.paymentGatewayId = paymentGateway.id;
|
|
23568
|
-
if (paymentGateway.paymentMethodType === IkasPaymentMethodType.CREDIT_CARD) {
|
|
23569
|
-
_this.cardData = new CreditCardData();
|
|
23570
|
-
}
|
|
23571
23572
|
_this.checkout.selectedPaymentGateway = paymentGateway;
|
|
23572
|
-
_this.
|
|
23573
|
+
if (_this.step !== CheckoutStep.SUCCESS) {
|
|
23574
|
+
if (paymentGateway.paymentMethodType === IkasPaymentMethodType.CREDIT_CARD) {
|
|
23575
|
+
_this.cardData = new CreditCardData();
|
|
23576
|
+
}
|
|
23577
|
+
_this.installmentInfo = undefined;
|
|
23578
|
+
}
|
|
23573
23579
|
};
|
|
23574
23580
|
this.setInstallmentCount = function (count) {
|
|
23575
23581
|
if (!_this.cardData)
|
|
@@ -23634,15 +23640,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23634
23640
|
Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGatewayIndex", {
|
|
23635
23641
|
get: function () {
|
|
23636
23642
|
var _this = this;
|
|
23637
|
-
return this.paymentGateways.findIndex(function (pg) { return pg.id === _this.
|
|
23638
|
-
},
|
|
23639
|
-
enumerable: false,
|
|
23640
|
-
configurable: true
|
|
23641
|
-
});
|
|
23642
|
-
Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGateway", {
|
|
23643
|
-
get: function () {
|
|
23644
|
-
var _this = this;
|
|
23645
|
-
return this.paymentGateways.find(function (pg) { return pg.id === _this.paymentGatewayId; });
|
|
23643
|
+
return this.paymentGateways.findIndex(function (pg) { var _a; return pg.id === ((_a = _this.checkout.selectedPaymentGateway) === null || _a === void 0 ? void 0 : _a.id); });
|
|
23646
23644
|
},
|
|
23647
23645
|
enumerable: false,
|
|
23648
23646
|
configurable: true
|
|
@@ -23741,7 +23739,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23741
23739
|
return false;
|
|
23742
23740
|
return (this.canProceedToShipping &&
|
|
23743
23741
|
!!((_a = this.checkout.billingAddress) === null || _a === void 0 ? void 0 : _a.isValid) &&
|
|
23744
|
-
(((_b = this.selectedPaymentGateway) === null || _b === void 0 ? void 0 : _b.paymentMethodType) ===
|
|
23742
|
+
(((_b = this.checkout.selectedPaymentGateway) === null || _b === void 0 ? void 0 : _b.paymentMethodType) ===
|
|
23745
23743
|
IkasPaymentMethodType.CREDIT_CARD
|
|
23746
23744
|
? (_c = this.cardData) === null || _c === void 0 ? void 0 : _c.isValid : true));
|
|
23747
23745
|
},
|
|
@@ -61145,14 +61143,15 @@ var CalculatedAdditionalPrices = observer(function (_a) {
|
|
|
61145
61143
|
if (!vm.cart)
|
|
61146
61144
|
return null;
|
|
61147
61145
|
return (createElement(Fragment$1, null,
|
|
61148
|
-
|
|
61149
|
-
|
|
61150
|
-
|
|
61151
|
-
|
|
61152
|
-
|
|
61153
|
-
createElement("
|
|
61154
|
-
|
|
61155
|
-
|
|
61146
|
+
vm.step !== CheckoutStep.SUCCESS &&
|
|
61147
|
+
(((_b = vm.checkout.selectedPaymentGateway) === null || _b === void 0 ? void 0 : _b.getCalculatedAdditionalPrices(vm.checkout.totalFinalPrice || 0, vm.checkout.shippingLines || null)) || [])
|
|
61148
|
+
.filter(function (adjustment) { return adjustment.amount !== 0; })
|
|
61149
|
+
.map(function (adjustment, index) { return (createElement("div", { className: styles$h.InfoRow, key: index },
|
|
61150
|
+
createElement("div", { className: styles$h.Label }, adjustment.name),
|
|
61151
|
+
createElement("div", { className: styles$h.Value },
|
|
61152
|
+
createElement("span", null, adjustment.type === "DECREMENT" ? "- " : ""),
|
|
61153
|
+
" ",
|
|
61154
|
+
createElement("span", null, formatMoney(adjustment.amount, vm.cart.currencyCode))))); }), (_c = vm.checkout.giftPackageLines) === null || _c === void 0 ? void 0 :
|
|
61156
61155
|
_c.map(function (gpl, index) { return (createElement("div", { className: styles$h.InfoRow, key: index },
|
|
61157
61156
|
createElement("div", { className: styles$h.Label },
|
|
61158
61157
|
createElement("div", { className: styles$h.GiftLabel },
|
|
@@ -62457,7 +62456,7 @@ var _slug_ = /*#__PURE__*/Object.freeze({
|
|
|
62457
62456
|
});
|
|
62458
62457
|
|
|
62459
62458
|
var CheckoutPage = function (_a) {
|
|
62460
|
-
var checkoutId = _a.checkoutId,
|
|
62459
|
+
var checkoutId = _a.checkoutId, checkoutSettingsStr = _a.checkoutSettingsStr, customizationProps = _a.customizationProps, configJson = _a.configJson, others = __rest(_a, ["checkoutId", "checkoutSettingsStr", "customizationProps", "configJson"]);
|
|
62461
62460
|
var router = useRouter();
|
|
62462
62461
|
var _b = useState(), checkout = _b[0], setCheckout = _b[1];
|
|
62463
62462
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
@@ -62485,10 +62484,7 @@ var CheckoutPage = function (_a) {
|
|
|
62485
62484
|
}, [customizationProps]);
|
|
62486
62485
|
useEffect(function () {
|
|
62487
62486
|
store.checkLocalization();
|
|
62488
|
-
|
|
62489
|
-
getCheckout();
|
|
62490
|
-
else
|
|
62491
|
-
setCheckout(editorCheckout);
|
|
62487
|
+
getCheckout();
|
|
62492
62488
|
}, []);
|
|
62493
62489
|
var getCheckout = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
62494
62490
|
var checkout;
|
package/build/index.js
CHANGED
|
@@ -22817,7 +22817,6 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
22817
22817
|
this.isChangingShippingMethod = false;
|
|
22818
22818
|
this.step = CheckoutStep.INFO;
|
|
22819
22819
|
this.cardData = null;
|
|
22820
|
-
this.paymentGatewayId = null;
|
|
22821
22820
|
this.paymentGateways = [];
|
|
22822
22821
|
this.installmentInfo = null;
|
|
22823
22822
|
this.useDifferentAddress = false;
|
|
@@ -22850,7 +22849,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
22850
22849
|
});
|
|
22851
22850
|
}); };
|
|
22852
22851
|
this.initStep = function (queryParams) { return __awaiter(_this, void 0, void 0, function () {
|
|
22853
|
-
var _a, transactions;
|
|
22852
|
+
var _a, transactions, paymentGatewayId_1;
|
|
22854
22853
|
return __generator(this, function (_b) {
|
|
22855
22854
|
switch (_b.label) {
|
|
22856
22855
|
case 0:
|
|
@@ -22922,6 +22921,10 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
22922
22921
|
this.successTransaction = transactions.length
|
|
22923
22922
|
? transactions[0]
|
|
22924
22923
|
: undefined;
|
|
22924
|
+
if (this.successTransaction) {
|
|
22925
|
+
paymentGatewayId_1 = this.successTransaction.paymentGatewayId;
|
|
22926
|
+
this.checkout.selectedPaymentGateway = this.paymentGateways.find(function (pg) { return pg.id === paymentGatewayId_1; });
|
|
22927
|
+
}
|
|
22925
22928
|
_b.label = 11;
|
|
22926
22929
|
case 11:
|
|
22927
22930
|
this.isCheckoutLoaded = true;
|
|
@@ -23101,7 +23104,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23101
23104
|
orderedPaymentGateways.push(_pg);
|
|
23102
23105
|
});
|
|
23103
23106
|
this.paymentGateways = isLocal ? paymentGateways : orderedPaymentGateways;
|
|
23104
|
-
if (!this.
|
|
23107
|
+
if (!this.checkout.selectedPaymentGateway)
|
|
23105
23108
|
this.setPaymentGateway(0);
|
|
23106
23109
|
return [2 /*return*/];
|
|
23107
23110
|
}
|
|
@@ -23252,7 +23255,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23252
23255
|
if (oldOriginalValue.length < 6 && originalValue.length >= 6) {
|
|
23253
23256
|
_this.retrieveInstallmentInfo({
|
|
23254
23257
|
binNumber: originalValue.slice(0, 6),
|
|
23255
|
-
paymentGatewayId: _this.
|
|
23258
|
+
paymentGatewayId: _this.checkout.selectedPaymentGateway.id,
|
|
23256
23259
|
price: _this.checkout.totalFinalPrice,
|
|
23257
23260
|
});
|
|
23258
23261
|
}
|
|
@@ -23491,15 +23494,17 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23491
23494
|
}); };
|
|
23492
23495
|
this.createSaleTransaction = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
23493
23496
|
var response, transactionStatus, transactionSuccess, transactionPending;
|
|
23494
|
-
|
|
23495
|
-
|
|
23496
|
-
|
|
23497
|
-
|
|
23498
|
-
|
|
23499
|
-
|
|
23500
|
-
|
|
23497
|
+
return __generator(this, function (_a) {
|
|
23498
|
+
switch (_a.label) {
|
|
23499
|
+
case 0:
|
|
23500
|
+
if (!this.checkout.selectedPaymentGateway)
|
|
23501
|
+
return [2 /*return*/];
|
|
23502
|
+
return [4 /*yield*/, IkasCheckoutAPI.createSaleTransactionWithCheckout(this.checkout.id, this.checkout.selectedPaymentGateway.id, this.checkout.selectedPaymentGateway.paymentMethodType ===
|
|
23503
|
+
IkasPaymentMethodType.CREDIT_CARD && this.cardData
|
|
23504
|
+
? this.cardData.toInput()
|
|
23505
|
+
: undefined)];
|
|
23501
23506
|
case 1:
|
|
23502
|
-
response =
|
|
23507
|
+
response = _a.sent();
|
|
23503
23508
|
transactionStatus = response === null || response === void 0 ? void 0 : response.transactionStatus;
|
|
23504
23509
|
transactionSuccess = transactionStatus &&
|
|
23505
23510
|
[
|
|
@@ -23510,7 +23515,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23510
23515
|
if (!transactionSuccess) return [3 /*break*/, 3];
|
|
23511
23516
|
return [4 /*yield*/, this.onCheckoutTransactionSuccess()];
|
|
23512
23517
|
case 2:
|
|
23513
|
-
|
|
23518
|
+
_a.sent();
|
|
23514
23519
|
return [3 /*break*/, 4];
|
|
23515
23520
|
case 3:
|
|
23516
23521
|
if (transactionPending && !!(response === null || response === void 0 ? void 0 : response.returnSlug)) {
|
|
@@ -23522,7 +23527,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23522
23527
|
type: ErrorType.UNKNOWN,
|
|
23523
23528
|
};
|
|
23524
23529
|
}
|
|
23525
|
-
|
|
23530
|
+
_a.label = 4;
|
|
23526
23531
|
case 4: return [2 /*return*/];
|
|
23527
23532
|
}
|
|
23528
23533
|
});
|
|
@@ -23572,12 +23577,13 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23572
23577
|
};
|
|
23573
23578
|
this.setPaymentGateway = function (index) {
|
|
23574
23579
|
var paymentGateway = _this.paymentGateways[index];
|
|
23575
|
-
_this.paymentGatewayId = paymentGateway.id;
|
|
23576
|
-
if (paymentGateway.paymentMethodType === IkasPaymentMethodType.CREDIT_CARD) {
|
|
23577
|
-
_this.cardData = new CreditCardData();
|
|
23578
|
-
}
|
|
23579
23580
|
_this.checkout.selectedPaymentGateway = paymentGateway;
|
|
23580
|
-
_this.
|
|
23581
|
+
if (_this.step !== CheckoutStep.SUCCESS) {
|
|
23582
|
+
if (paymentGateway.paymentMethodType === IkasPaymentMethodType.CREDIT_CARD) {
|
|
23583
|
+
_this.cardData = new CreditCardData();
|
|
23584
|
+
}
|
|
23585
|
+
_this.installmentInfo = undefined;
|
|
23586
|
+
}
|
|
23581
23587
|
};
|
|
23582
23588
|
this.setInstallmentCount = function (count) {
|
|
23583
23589
|
if (!_this.cardData)
|
|
@@ -23642,15 +23648,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23642
23648
|
Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGatewayIndex", {
|
|
23643
23649
|
get: function () {
|
|
23644
23650
|
var _this = this;
|
|
23645
|
-
return this.paymentGateways.findIndex(function (pg) { return pg.id === _this.
|
|
23646
|
-
},
|
|
23647
|
-
enumerable: false,
|
|
23648
|
-
configurable: true
|
|
23649
|
-
});
|
|
23650
|
-
Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGateway", {
|
|
23651
|
-
get: function () {
|
|
23652
|
-
var _this = this;
|
|
23653
|
-
return this.paymentGateways.find(function (pg) { return pg.id === _this.paymentGatewayId; });
|
|
23651
|
+
return this.paymentGateways.findIndex(function (pg) { var _a; return pg.id === ((_a = _this.checkout.selectedPaymentGateway) === null || _a === void 0 ? void 0 : _a.id); });
|
|
23654
23652
|
},
|
|
23655
23653
|
enumerable: false,
|
|
23656
23654
|
configurable: true
|
|
@@ -23749,7 +23747,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23749
23747
|
return false;
|
|
23750
23748
|
return (this.canProceedToShipping &&
|
|
23751
23749
|
!!((_a = this.checkout.billingAddress) === null || _a === void 0 ? void 0 : _a.isValid) &&
|
|
23752
|
-
(((_b = this.selectedPaymentGateway) === null || _b === void 0 ? void 0 : _b.paymentMethodType) ===
|
|
23750
|
+
(((_b = this.checkout.selectedPaymentGateway) === null || _b === void 0 ? void 0 : _b.paymentMethodType) ===
|
|
23753
23751
|
IkasPaymentMethodType.CREDIT_CARD
|
|
23754
23752
|
? (_c = this.cardData) === null || _c === void 0 ? void 0 : _c.isValid : true));
|
|
23755
23753
|
},
|
|
@@ -61124,14 +61122,15 @@ var CalculatedAdditionalPrices = mobxReactLite.observer(function (_a) {
|
|
|
61124
61122
|
if (!vm.cart)
|
|
61125
61123
|
return null;
|
|
61126
61124
|
return (React.createElement(React.Fragment, null,
|
|
61127
|
-
|
|
61128
|
-
|
|
61129
|
-
|
|
61130
|
-
|
|
61131
|
-
|
|
61132
|
-
React.createElement("
|
|
61133
|
-
|
|
61134
|
-
|
|
61125
|
+
vm.step !== CheckoutStep.SUCCESS &&
|
|
61126
|
+
(((_b = vm.checkout.selectedPaymentGateway) === null || _b === void 0 ? void 0 : _b.getCalculatedAdditionalPrices(vm.checkout.totalFinalPrice || 0, vm.checkout.shippingLines || null)) || [])
|
|
61127
|
+
.filter(function (adjustment) { return adjustment.amount !== 0; })
|
|
61128
|
+
.map(function (adjustment, index) { return (React.createElement("div", { className: styles$h.InfoRow, key: index },
|
|
61129
|
+
React.createElement("div", { className: styles$h.Label }, adjustment.name),
|
|
61130
|
+
React.createElement("div", { className: styles$h.Value },
|
|
61131
|
+
React.createElement("span", null, adjustment.type === "DECREMENT" ? "- " : ""),
|
|
61132
|
+
" ",
|
|
61133
|
+
React.createElement("span", null, formatMoney(adjustment.amount, vm.cart.currencyCode))))); }), (_c = vm.checkout.giftPackageLines) === null || _c === void 0 ? void 0 :
|
|
61135
61134
|
_c.map(function (gpl, index) { return (React.createElement("div", { className: styles$h.InfoRow, key: index },
|
|
61136
61135
|
React.createElement("div", { className: styles$h.Label },
|
|
61137
61136
|
React.createElement("div", { className: styles$h.GiftLabel },
|
|
@@ -62436,7 +62435,7 @@ var _slug_ = /*#__PURE__*/Object.freeze({
|
|
|
62436
62435
|
});
|
|
62437
62436
|
|
|
62438
62437
|
var CheckoutPage = function (_a) {
|
|
62439
|
-
var checkoutId = _a.checkoutId,
|
|
62438
|
+
var checkoutId = _a.checkoutId, checkoutSettingsStr = _a.checkoutSettingsStr, customizationProps = _a.customizationProps, configJson = _a.configJson, others = __rest(_a, ["checkoutId", "checkoutSettingsStr", "customizationProps", "configJson"]);
|
|
62440
62439
|
var router$1 = router.useRouter();
|
|
62441
62440
|
var _b = React.useState(), checkout = _b[0], setCheckout = _b[1];
|
|
62442
62441
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
@@ -62464,10 +62463,7 @@ var CheckoutPage = function (_a) {
|
|
|
62464
62463
|
}, [customizationProps]);
|
|
62465
62464
|
React.useEffect(function () {
|
|
62466
62465
|
store.checkLocalization();
|
|
62467
|
-
|
|
62468
|
-
getCheckout();
|
|
62469
|
-
else
|
|
62470
|
-
setCheckout(editorCheckout);
|
|
62466
|
+
getCheckout();
|
|
62471
62467
|
}, []);
|
|
62472
62468
|
var getCheckout = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
62473
62469
|
var checkout;
|
|
@@ -3,10 +3,8 @@ import * as React from "react";
|
|
|
3
3
|
import { GetServerSideProps } from "next";
|
|
4
4
|
import { ParsedUrlQuery } from "querystring";
|
|
5
5
|
import { IkasCheckoutCustomizationProps } from "../../components/checkout/index";
|
|
6
|
-
import { IkasCheckout } from "../../models/index";
|
|
7
6
|
declare type Props = {
|
|
8
7
|
checkoutId: string;
|
|
9
|
-
editorCheckout?: IkasCheckout;
|
|
10
8
|
checkoutSettingsStr: string | null;
|
|
11
9
|
customizationProps: IkasCheckoutCustomizationProps;
|
|
12
10
|
returnPolicy: string;
|