@wix/auto_sdk_ecom_checkout 1.0.36 → 1.0.38
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/{es/src/ecom-v1-checkout-checkout.types.d.ts → ecom-v1-checkout-checkout.universal-DEDRvPML.d.mts} +674 -365
- package/build/{cjs/src/ecom-v1-checkout-checkout.types.d.ts → ecom-v1-checkout-checkout.universal-DEDRvPML.d.ts} +674 -365
- package/build/index.d.mts +210 -0
- package/build/index.d.ts +210 -0
- package/build/index.js +2782 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +2708 -0
- package/build/index.mjs.map +1 -0
- package/build/internal/{cjs/src/ecom-v1-checkout-checkout.types.d.ts → ecom-v1-checkout-checkout.universal-CirtPjnM.d.mts} +803 -364
- package/build/internal/{es/src/ecom-v1-checkout-checkout.types.d.ts → ecom-v1-checkout-checkout.universal-CirtPjnM.d.ts} +803 -364
- package/build/internal/index.d.mts +240 -0
- package/build/internal/index.d.ts +240 -0
- package/build/internal/index.js +2782 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +2708 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/internal/meta.d.mts +2606 -0
- package/build/internal/meta.d.ts +2606 -0
- package/build/internal/meta.js +1587 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +1544 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/meta.d.mts +2606 -0
- package/build/meta.d.ts +2606 -0
- package/build/meta.js +1587 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +1544 -0
- package/build/meta.mjs.map +1 -0
- package/package.json +12 -11
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -18
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/meta.d.ts +0 -1
- package/build/cjs/meta.js +0 -18
- package/build/cjs/meta.js.map +0 -1
- package/build/cjs/src/ecom-v1-checkout-checkout.context.d.ts +0 -35
- package/build/cjs/src/ecom-v1-checkout-checkout.context.js +0 -76
- package/build/cjs/src/ecom-v1-checkout-checkout.context.js.map +0 -1
- package/build/cjs/src/ecom-v1-checkout-checkout.http.d.ts +0 -101
- package/build/cjs/src/ecom-v1-checkout-checkout.http.js +0 -1317
- package/build/cjs/src/ecom-v1-checkout-checkout.http.js.map +0 -1
- package/build/cjs/src/ecom-v1-checkout-checkout.meta.d.ts +0 -59
- package/build/cjs/src/ecom-v1-checkout-checkout.meta.js +0 -351
- package/build/cjs/src/ecom-v1-checkout-checkout.meta.js.map +0 -1
- package/build/cjs/src/ecom-v1-checkout-checkout.public.d.ts +0 -182
- package/build/cjs/src/ecom-v1-checkout-checkout.public.js +0 -357
- package/build/cjs/src/ecom-v1-checkout-checkout.public.js.map +0 -1
- package/build/cjs/src/ecom-v1-checkout-checkout.types.js +0 -303
- package/build/cjs/src/ecom-v1-checkout-checkout.types.js.map +0 -1
- package/build/cjs/src/ecom-v1-checkout-checkout.universal.d.ts +0 -4437
- package/build/cjs/src/ecom-v1-checkout-checkout.universal.js +0 -1587
- package/build/cjs/src/ecom-v1-checkout-checkout.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/package.json +0 -3
- package/build/es/src/ecom-v1-checkout-checkout.context.d.ts +0 -35
- package/build/es/src/ecom-v1-checkout-checkout.context.js +0 -41
- package/build/es/src/ecom-v1-checkout-checkout.context.js.map +0 -1
- package/build/es/src/ecom-v1-checkout-checkout.http.d.ts +0 -101
- package/build/es/src/ecom-v1-checkout-checkout.http.js +0 -1297
- package/build/es/src/ecom-v1-checkout-checkout.http.js.map +0 -1
- package/build/es/src/ecom-v1-checkout-checkout.meta.d.ts +0 -59
- package/build/es/src/ecom-v1-checkout-checkout.meta.js +0 -308
- package/build/es/src/ecom-v1-checkout-checkout.meta.js.map +0 -1
- package/build/es/src/ecom-v1-checkout-checkout.public.d.ts +0 -182
- package/build/es/src/ecom-v1-checkout-checkout.public.js +0 -305
- package/build/es/src/ecom-v1-checkout-checkout.public.js.map +0 -1
- package/build/es/src/ecom-v1-checkout-checkout.types.js +0 -300
- package/build/es/src/ecom-v1-checkout-checkout.types.js.map +0 -1
- package/build/es/src/ecom-v1-checkout-checkout.universal.d.ts +0 -4437
- package/build/es/src/ecom-v1-checkout-checkout.universal.js +0 -1544
- package/build/es/src/ecom-v1-checkout-checkout.universal.js.map +0 -1
- package/build/internal/cjs/index.d.ts +0 -1
- package/build/internal/cjs/index.js +0 -18
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.d.ts +0 -1
- package/build/internal/cjs/meta.js +0 -18
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.context.d.ts +0 -41
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.context.js +0 -76
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.context.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.http.d.ts +0 -101
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.http.js +0 -1317
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.http.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.meta.d.ts +0 -59
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.meta.js +0 -351
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.meta.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.public.d.ts +0 -206
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.public.js +0 -357
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.public.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.types.js +0 -303
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.types.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.universal.d.ts +0 -4623
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.universal.js +0 -1587
- package/build/internal/cjs/src/ecom-v1-checkout-checkout.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/ecom-v1-checkout-checkout.context.d.ts +0 -41
- package/build/internal/es/src/ecom-v1-checkout-checkout.context.js +0 -41
- package/build/internal/es/src/ecom-v1-checkout-checkout.context.js.map +0 -1
- package/build/internal/es/src/ecom-v1-checkout-checkout.http.d.ts +0 -101
- package/build/internal/es/src/ecom-v1-checkout-checkout.http.js +0 -1297
- package/build/internal/es/src/ecom-v1-checkout-checkout.http.js.map +0 -1
- package/build/internal/es/src/ecom-v1-checkout-checkout.meta.d.ts +0 -59
- package/build/internal/es/src/ecom-v1-checkout-checkout.meta.js +0 -308
- package/build/internal/es/src/ecom-v1-checkout-checkout.meta.js.map +0 -1
- package/build/internal/es/src/ecom-v1-checkout-checkout.public.d.ts +0 -206
- package/build/internal/es/src/ecom-v1-checkout-checkout.public.js +0 -305
- package/build/internal/es/src/ecom-v1-checkout-checkout.public.js.map +0 -1
- package/build/internal/es/src/ecom-v1-checkout-checkout.types.js +0 -300
- package/build/internal/es/src/ecom-v1-checkout-checkout.types.js.map +0 -1
- package/build/internal/es/src/ecom-v1-checkout-checkout.universal.d.ts +0 -4623
- package/build/internal/es/src/ecom-v1-checkout-checkout.universal.js +0 -1544
- package/build/internal/es/src/ecom-v1-checkout-checkout.universal.js.map +0 -1
|
@@ -1,1587 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getCheckoutPaymentSettings = exports.updateLineItemsQuantity = exports.markCheckoutAsCompleted = exports.markCheckoutAsCompletedAndRedirectToUrl = exports.createOrderAndCharge = exports.createOrder = exports.removeLineItems = exports.addToCheckout = exports.removeOverrideCheckoutUrl = exports.removeGiftCard = exports.removeCoupon = exports.updateCheckout = exports.getCheckoutUrl = exports.getWixCheckoutUrl = exports.getCheckoutByCartId = exports.getCheckout = exports.createCheckout = exports.WebhookIdentityType = exports.ChannelInfoChannelType = exports.DiscountDiscountType = exports.VatType = exports.MediaItemType = exports.LineItemType = exports.IdentityType = exports.GetCheckoutPaymentSettingsResponsePaymentOption = exports.SuggestedFix = exports.NameInLineItem = exports.NameInOther = exports.Severity = exports.AdditionalFeeSource = exports.ChannelType = exports.FallbackReason = exports.ManualCalculationReason = exports.RateType = exports.WeightUnit = exports.DiscountType = exports.RuleType = exports.ChargeType = exports.PickupMethod = exports.CommonVatType = exports.TaxableAddressType = exports.PaymentOptionType = exports.FileType = exports.SubscriptionFrequency = exports.ItemTypeItemType = exports.ItemAvailabilityStatus = exports.DescriptionLineType = exports.JurisdictionType = void 0;
|
|
27
|
-
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
-
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
29
|
-
const ambassadorWixEcomV1Checkout = __importStar(require("./ecom-v1-checkout-checkout.http.js"));
|
|
30
|
-
const address_1 = require("@wix/sdk-runtime/transformations/address");
|
|
31
|
-
const address_2 = require("@wix/sdk-runtime/transformations/address");
|
|
32
|
-
const image_1 = require("@wix/sdk-runtime/transformations/image");
|
|
33
|
-
const image_2 = require("@wix/sdk-runtime/transformations/image");
|
|
34
|
-
const page_url_v2_1 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
35
|
-
const page_url_v2_2 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
36
|
-
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
37
|
-
/** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
|
|
38
|
-
var JurisdictionType;
|
|
39
|
-
(function (JurisdictionType) {
|
|
40
|
-
JurisdictionType["UNDEFINED"] = "UNDEFINED";
|
|
41
|
-
JurisdictionType["COUNTRY"] = "COUNTRY";
|
|
42
|
-
JurisdictionType["STATE"] = "STATE";
|
|
43
|
-
JurisdictionType["COUNTY"] = "COUNTY";
|
|
44
|
-
JurisdictionType["CITY"] = "CITY";
|
|
45
|
-
JurisdictionType["SPECIAL"] = "SPECIAL";
|
|
46
|
-
})(JurisdictionType || (exports.JurisdictionType = JurisdictionType = {}));
|
|
47
|
-
var DescriptionLineType;
|
|
48
|
-
(function (DescriptionLineType) {
|
|
49
|
-
/** Unrecognized type. */
|
|
50
|
-
DescriptionLineType["UNRECOGNISED"] = "UNRECOGNISED";
|
|
51
|
-
/** Plain text type. */
|
|
52
|
-
DescriptionLineType["PLAIN_TEXT"] = "PLAIN_TEXT";
|
|
53
|
-
/** Color type. */
|
|
54
|
-
DescriptionLineType["COLOR"] = "COLOR";
|
|
55
|
-
})(DescriptionLineType || (exports.DescriptionLineType = DescriptionLineType = {}));
|
|
56
|
-
var ItemAvailabilityStatus;
|
|
57
|
-
(function (ItemAvailabilityStatus) {
|
|
58
|
-
ItemAvailabilityStatus["AVAILABLE"] = "AVAILABLE";
|
|
59
|
-
/** Item does not exist. */
|
|
60
|
-
ItemAvailabilityStatus["NOT_FOUND"] = "NOT_FOUND";
|
|
61
|
-
/** Item is not in stock. */
|
|
62
|
-
ItemAvailabilityStatus["NOT_AVAILABLE"] = "NOT_AVAILABLE";
|
|
63
|
-
/** Available quantity is less than requested. */
|
|
64
|
-
ItemAvailabilityStatus["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
|
|
65
|
-
})(ItemAvailabilityStatus || (exports.ItemAvailabilityStatus = ItemAvailabilityStatus = {}));
|
|
66
|
-
var ItemTypeItemType;
|
|
67
|
-
(function (ItemTypeItemType) {
|
|
68
|
-
ItemTypeItemType["UNRECOGNISED"] = "UNRECOGNISED";
|
|
69
|
-
ItemTypeItemType["PHYSICAL"] = "PHYSICAL";
|
|
70
|
-
ItemTypeItemType["DIGITAL"] = "DIGITAL";
|
|
71
|
-
ItemTypeItemType["GIFT_CARD"] = "GIFT_CARD";
|
|
72
|
-
ItemTypeItemType["SERVICE"] = "SERVICE";
|
|
73
|
-
})(ItemTypeItemType || (exports.ItemTypeItemType = ItemTypeItemType = {}));
|
|
74
|
-
/** Frequency unit of recurring payment */
|
|
75
|
-
var SubscriptionFrequency;
|
|
76
|
-
(function (SubscriptionFrequency) {
|
|
77
|
-
SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
|
|
78
|
-
SubscriptionFrequency["DAY"] = "DAY";
|
|
79
|
-
SubscriptionFrequency["WEEK"] = "WEEK";
|
|
80
|
-
SubscriptionFrequency["MONTH"] = "MONTH";
|
|
81
|
-
SubscriptionFrequency["YEAR"] = "YEAR";
|
|
82
|
-
})(SubscriptionFrequency || (exports.SubscriptionFrequency = SubscriptionFrequency = {}));
|
|
83
|
-
var FileType;
|
|
84
|
-
(function (FileType) {
|
|
85
|
-
FileType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
86
|
-
FileType["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
87
|
-
FileType["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
88
|
-
FileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
89
|
-
FileType["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
90
|
-
FileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
91
|
-
})(FileType || (exports.FileType = FileType = {}));
|
|
92
|
-
/** Type of selected payment option for catalog item */
|
|
93
|
-
var PaymentOptionType;
|
|
94
|
-
(function (PaymentOptionType) {
|
|
95
|
-
/** The entire payment for this item happens as part of the checkout. */
|
|
96
|
-
PaymentOptionType["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
|
|
97
|
-
/** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
|
|
98
|
-
PaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
|
|
99
|
-
/** Payment for this item is done by charging a membership. When selected, `price` is `0`. */
|
|
100
|
-
PaymentOptionType["MEMBERSHIP"] = "MEMBERSHIP";
|
|
101
|
-
/** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */
|
|
102
|
-
PaymentOptionType["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
|
|
103
|
-
/** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */
|
|
104
|
-
PaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
|
|
105
|
-
})(PaymentOptionType || (exports.PaymentOptionType = PaymentOptionType = {}));
|
|
106
|
-
var TaxableAddressType;
|
|
107
|
-
(function (TaxableAddressType) {
|
|
108
|
-
TaxableAddressType["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
|
|
109
|
-
TaxableAddressType["BUSINESS"] = "BUSINESS";
|
|
110
|
-
TaxableAddressType["BILLING"] = "BILLING";
|
|
111
|
-
TaxableAddressType["SHIPPING"] = "SHIPPING";
|
|
112
|
-
})(TaxableAddressType || (exports.TaxableAddressType = TaxableAddressType = {}));
|
|
113
|
-
/** tax info types */
|
|
114
|
-
var CommonVatType;
|
|
115
|
-
(function (CommonVatType) {
|
|
116
|
-
CommonVatType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
117
|
-
/** CPF - for individual tax payers. */
|
|
118
|
-
CommonVatType["CPF"] = "CPF";
|
|
119
|
-
/** CNPJ - for corporations */
|
|
120
|
-
CommonVatType["CNPJ"] = "CNPJ";
|
|
121
|
-
})(CommonVatType || (exports.CommonVatType = CommonVatType = {}));
|
|
122
|
-
var PickupMethod;
|
|
123
|
-
(function (PickupMethod) {
|
|
124
|
-
PickupMethod["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
|
|
125
|
-
PickupMethod["STORE_PICKUP"] = "STORE_PICKUP";
|
|
126
|
-
PickupMethod["PICKUP_POINT"] = "PICKUP_POINT";
|
|
127
|
-
})(PickupMethod || (exports.PickupMethod = PickupMethod = {}));
|
|
128
|
-
var ChargeType;
|
|
129
|
-
(function (ChargeType) {
|
|
130
|
-
ChargeType["HANDLING_FEE"] = "HANDLING_FEE";
|
|
131
|
-
ChargeType["INSURANCE"] = "INSURANCE";
|
|
132
|
-
})(ChargeType || (exports.ChargeType = ChargeType = {}));
|
|
133
|
-
var RuleType;
|
|
134
|
-
(function (RuleType) {
|
|
135
|
-
RuleType["VALIDATION"] = "VALIDATION";
|
|
136
|
-
RuleType["OTHER"] = "OTHER";
|
|
137
|
-
RuleType["MAX"] = "MAX";
|
|
138
|
-
RuleType["MIN"] = "MIN";
|
|
139
|
-
RuleType["MAX_LENGTH"] = "MAX_LENGTH";
|
|
140
|
-
RuleType["MIN_LENGTH"] = "MIN_LENGTH";
|
|
141
|
-
RuleType["MAX_SIZE"] = "MAX_SIZE";
|
|
142
|
-
RuleType["MIN_SIZE"] = "MIN_SIZE";
|
|
143
|
-
RuleType["FORMAT"] = "FORMAT";
|
|
144
|
-
RuleType["DECIMAL_LTE"] = "DECIMAL_LTE";
|
|
145
|
-
RuleType["DECIMAL_GTE"] = "DECIMAL_GTE";
|
|
146
|
-
RuleType["DECIMAL_LT"] = "DECIMAL_LT";
|
|
147
|
-
RuleType["DECIMAL_GT"] = "DECIMAL_GT";
|
|
148
|
-
RuleType["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
|
|
149
|
-
RuleType["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
|
|
150
|
-
RuleType["REQUIRED_FIELD"] = "REQUIRED_FIELD";
|
|
151
|
-
RuleType["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
|
|
152
|
-
RuleType["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
|
|
153
|
-
RuleType["EXACT_LENGTH"] = "EXACT_LENGTH";
|
|
154
|
-
RuleType["EXACT_SIZE"] = "EXACT_SIZE";
|
|
155
|
-
RuleType["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
|
|
156
|
-
})(RuleType || (exports.RuleType = RuleType = {}));
|
|
157
|
-
var DiscountType;
|
|
158
|
-
(function (DiscountType) {
|
|
159
|
-
DiscountType["GLOBAL"] = "GLOBAL";
|
|
160
|
-
DiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
|
|
161
|
-
DiscountType["SHIPPING"] = "SHIPPING";
|
|
162
|
-
})(DiscountType || (exports.DiscountType = DiscountType = {}));
|
|
163
|
-
var WeightUnit;
|
|
164
|
-
(function (WeightUnit) {
|
|
165
|
-
/** Weight unit can't be classified due to an error. */
|
|
166
|
-
WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
|
|
167
|
-
/** Kilograms. */
|
|
168
|
-
WeightUnit["KG"] = "KG";
|
|
169
|
-
/** Pounds. */
|
|
170
|
-
WeightUnit["LB"] = "LB";
|
|
171
|
-
})(WeightUnit || (exports.WeightUnit = WeightUnit = {}));
|
|
172
|
-
var RateType;
|
|
173
|
-
(function (RateType) {
|
|
174
|
-
/** no tax being collected for this request due to location of purchase */
|
|
175
|
-
RateType["NO_TAX_COLLECTED"] = "NO_TAX_COLLECTED";
|
|
176
|
-
/** manual rate used for calculation */
|
|
177
|
-
RateType["MANUAL_RATE"] = "MANUAL_RATE";
|
|
178
|
-
/** autotax rate used for calculation */
|
|
179
|
-
RateType["AUTO_RATE"] = "AUTO_RATE";
|
|
180
|
-
/** fallback rate used for calculation */
|
|
181
|
-
RateType["FALLBACK_RATE"] = "FALLBACK_RATE";
|
|
182
|
-
})(RateType || (exports.RateType = RateType = {}));
|
|
183
|
-
var ManualCalculationReason;
|
|
184
|
-
(function (ManualCalculationReason) {
|
|
185
|
-
/** user set calculator in Business Manager to be Manual */
|
|
186
|
-
ManualCalculationReason["GLOBAL_SETTING_TO_MANUAL"] = "GLOBAL_SETTING_TO_MANUAL";
|
|
187
|
-
/** specific region is on manual even though Global setting is Auto-tax */
|
|
188
|
-
ManualCalculationReason["REGION_SETTING_TO_MANUAL"] = "REGION_SETTING_TO_MANUAL";
|
|
189
|
-
})(ManualCalculationReason || (exports.ManualCalculationReason = ManualCalculationReason = {}));
|
|
190
|
-
var FallbackReason;
|
|
191
|
-
(function (FallbackReason) {
|
|
192
|
-
/** auto-tax failed to be calculated */
|
|
193
|
-
FallbackReason["AUTO_TAX_FAILED"] = "AUTO_TAX_FAILED";
|
|
194
|
-
/** auto-tax was temporarily deactivated on a system-level */
|
|
195
|
-
FallbackReason["AUTO_TAX_DEACTIVATED"] = "AUTO_TAX_DEACTIVATED";
|
|
196
|
-
})(FallbackReason || (exports.FallbackReason = FallbackReason = {}));
|
|
197
|
-
var ChannelType;
|
|
198
|
-
(function (ChannelType) {
|
|
199
|
-
/** Unspecified sales channel. This value is not supported. */
|
|
200
|
-
ChannelType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
201
|
-
/** A web client. */
|
|
202
|
-
ChannelType["WEB"] = "WEB";
|
|
203
|
-
/** [Point of sale solutions](https://support.wix.com/en/wix-mobile-pos-2196395). */
|
|
204
|
-
ChannelType["POS"] = "POS";
|
|
205
|
-
/** [eBay shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-ebay-shop). */
|
|
206
|
-
ChannelType["EBAY"] = "EBAY";
|
|
207
|
-
/** [Amazon shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-amazon-shop). */
|
|
208
|
-
ChannelType["AMAZON"] = "AMAZON";
|
|
209
|
-
/** Other sales platform. */
|
|
210
|
-
ChannelType["OTHER_PLATFORM"] = "OTHER_PLATFORM";
|
|
211
|
-
/** [Wix Owner app](https://support.wix.com/article/wix-owner-app-an-overview). */
|
|
212
|
-
ChannelType["WIX_APP_STORE"] = "WIX_APP_STORE";
|
|
213
|
-
/** Wix Invoices app in [your dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Finvoices/settings/general-settings) */
|
|
214
|
-
ChannelType["WIX_INVOICES"] = "WIX_INVOICES";
|
|
215
|
-
/** Wix merchant backoffice. */
|
|
216
|
-
ChannelType["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
|
|
217
|
-
/** Wish sales channel. */
|
|
218
|
-
ChannelType["WISH"] = "WISH";
|
|
219
|
-
/** [ClassPass sales channel](https://support.wix.com/en/article/wix-bookings-letting-clients-book-your-services-with-classpass). */
|
|
220
|
-
ChannelType["CLASS_PASS"] = "CLASS_PASS";
|
|
221
|
-
/** Global-E sales channel. */
|
|
222
|
-
ChannelType["GLOBAL_E"] = "GLOBAL_E";
|
|
223
|
-
/** [Facebook shop](https://support.wix.com/en/article/wix-stores-changes-to-facebook-shops). */
|
|
224
|
-
ChannelType["FACEBOOK"] = "FACEBOOK";
|
|
225
|
-
/** [Etsy sales channel](https://support.wix.com/en/article/wix-stores-request-adding-etsy-as-a-sales-channel). */
|
|
226
|
-
ChannelType["ETSY"] = "ETSY";
|
|
227
|
-
/** [TikTok sales channel](https://support.wix.com/en/article/wix-stores-request-adding-tiktok-as-a-sales-channel). */
|
|
228
|
-
ChannelType["TIKTOK"] = "TIKTOK";
|
|
229
|
-
/** [Faire marketplace integration](https://support.wix.com/en/article/wix-stores-creating-a-faire-store-using-the-faire-integration-app). */
|
|
230
|
-
ChannelType["FAIRE_COM"] = "FAIRE_COM";
|
|
231
|
-
})(ChannelType || (exports.ChannelType = ChannelType = {}));
|
|
232
|
-
var AdditionalFeeSource;
|
|
233
|
-
(function (AdditionalFeeSource) {
|
|
234
|
-
AdditionalFeeSource["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
|
|
235
|
-
/** The additional fee was added by an additional fee service plugin */
|
|
236
|
-
AdditionalFeeSource["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
|
|
237
|
-
/** The additional fee was added on the item either via the catalog or on custom line item */
|
|
238
|
-
AdditionalFeeSource["ITEM"] = "ITEM";
|
|
239
|
-
/** The additional fee was added manually on the request */
|
|
240
|
-
AdditionalFeeSource["MANUAL"] = "MANUAL";
|
|
241
|
-
/** The additional fee was added by the shipping provider */
|
|
242
|
-
AdditionalFeeSource["SHIPPING"] = "SHIPPING";
|
|
243
|
-
})(AdditionalFeeSource || (exports.AdditionalFeeSource = AdditionalFeeSource = {}));
|
|
244
|
-
var Severity;
|
|
245
|
-
(function (Severity) {
|
|
246
|
-
/** The user is allowed to move forward in the flow. */
|
|
247
|
-
Severity["WARNING"] = "WARNING";
|
|
248
|
-
/**
|
|
249
|
-
* The user is blocked from moving forward in the flow.
|
|
250
|
-
* For example, if callerContext is CART - moving to checkout is blocked. if callerContext is CHECKOUT, placing an order is blocked.
|
|
251
|
-
*/
|
|
252
|
-
Severity["ERROR"] = "ERROR";
|
|
253
|
-
})(Severity || (exports.Severity = Severity = {}));
|
|
254
|
-
/** Available locations on the webpage */
|
|
255
|
-
var NameInOther;
|
|
256
|
-
(function (NameInOther) {
|
|
257
|
-
/** Default location, in case no specific location is specified. */
|
|
258
|
-
NameInOther["OTHER_DEFAULT"] = "OTHER_DEFAULT";
|
|
259
|
-
})(NameInOther || (exports.NameInOther = NameInOther = {}));
|
|
260
|
-
/** Available locations on the line item */
|
|
261
|
-
var NameInLineItem;
|
|
262
|
-
(function (NameInLineItem) {
|
|
263
|
-
/** Default location, in case no specific location is specified. */
|
|
264
|
-
NameInLineItem["LINE_ITEM_DEFAULT"] = "LINE_ITEM_DEFAULT";
|
|
265
|
-
})(NameInLineItem || (exports.NameInLineItem = NameInLineItem = {}));
|
|
266
|
-
var SuggestedFix;
|
|
267
|
-
(function (SuggestedFix) {
|
|
268
|
-
/** No suggested fix is specified. The user should refer to the violation description to resolve the issue. */
|
|
269
|
-
SuggestedFix["UNKNOWN_SUGGESTED_FIX"] = "UNKNOWN_SUGGESTED_FIX";
|
|
270
|
-
/** The line item should be removed from the cart or checkout to resolve the violation. */
|
|
271
|
-
SuggestedFix["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
|
|
272
|
-
})(SuggestedFix || (exports.SuggestedFix = SuggestedFix = {}));
|
|
273
|
-
var GetCheckoutPaymentSettingsResponsePaymentOption;
|
|
274
|
-
(function (GetCheckoutPaymentSettingsResponsePaymentOption) {
|
|
275
|
-
GetCheckoutPaymentSettingsResponsePaymentOption["UNKNOWN_PAYMENT_OPTION"] = "UNKNOWN_PAYMENT_OPTION";
|
|
276
|
-
GetCheckoutPaymentSettingsResponsePaymentOption["MANUAL"] = "MANUAL";
|
|
277
|
-
})(GetCheckoutPaymentSettingsResponsePaymentOption || (exports.GetCheckoutPaymentSettingsResponsePaymentOption = GetCheckoutPaymentSettingsResponsePaymentOption = {}));
|
|
278
|
-
var IdentityType;
|
|
279
|
-
(function (IdentityType) {
|
|
280
|
-
IdentityType["UNSPECIFIED_IDENTITY_TYPE"] = "UNSPECIFIED_IDENTITY_TYPE";
|
|
281
|
-
/** Site member */
|
|
282
|
-
IdentityType["MEMBER"] = "MEMBER";
|
|
283
|
-
/** Contact */
|
|
284
|
-
IdentityType["CONTACT"] = "CONTACT";
|
|
285
|
-
})(IdentityType || (exports.IdentityType = IdentityType = {}));
|
|
286
|
-
var LineItemType;
|
|
287
|
-
(function (LineItemType) {
|
|
288
|
-
/** Line item type can't be classified, due to an error */
|
|
289
|
-
LineItemType["UNSPECIFIED_LINE_ITEM_TYPE"] = "UNSPECIFIED_LINE_ITEM_TYPE";
|
|
290
|
-
/** Physical item type */
|
|
291
|
-
LineItemType["PHYSICAL"] = "PHYSICAL";
|
|
292
|
-
/** Digital item type */
|
|
293
|
-
LineItemType["DIGITAL"] = "DIGITAL";
|
|
294
|
-
/** Custom item price */
|
|
295
|
-
LineItemType["CUSTOM_AMOUNT_ITEM"] = "CUSTOM_AMOUNT_ITEM";
|
|
296
|
-
})(LineItemType || (exports.LineItemType = LineItemType = {}));
|
|
297
|
-
var MediaItemType;
|
|
298
|
-
(function (MediaItemType) {
|
|
299
|
-
/** Media item type can't be classified, due to an error */
|
|
300
|
-
MediaItemType["UNSPECIFIED_MEDIA_TYPE_ITEM"] = "UNSPECIFIED_MEDIA_TYPE_ITEM";
|
|
301
|
-
/** Image item type */
|
|
302
|
-
MediaItemType["IMAGE"] = "IMAGE";
|
|
303
|
-
})(MediaItemType || (exports.MediaItemType = MediaItemType = {}));
|
|
304
|
-
/** Brazilian tax info types */
|
|
305
|
-
var VatType;
|
|
306
|
-
(function (VatType) {
|
|
307
|
-
/** When the tax info type can't be classified, due to an error */
|
|
308
|
-
VatType["UNSPECIFIED_TAX_TYPE"] = "UNSPECIFIED_TAX_TYPE";
|
|
309
|
-
/** CPF - for individual tax payers */
|
|
310
|
-
VatType["CPF"] = "CPF";
|
|
311
|
-
/** CNPJ - for corporations */
|
|
312
|
-
VatType["CNPJ"] = "CNPJ";
|
|
313
|
-
})(VatType || (exports.VatType = VatType = {}));
|
|
314
|
-
var DiscountDiscountType;
|
|
315
|
-
(function (DiscountDiscountType) {
|
|
316
|
-
DiscountDiscountType["UNDEFINED"] = "UNDEFINED";
|
|
317
|
-
/** No discount */
|
|
318
|
-
DiscountDiscountType["AMOUNT"] = "AMOUNT";
|
|
319
|
-
DiscountDiscountType["PERCENT"] = "PERCENT";
|
|
320
|
-
})(DiscountDiscountType || (exports.DiscountDiscountType = DiscountDiscountType = {}));
|
|
321
|
-
var ChannelInfoChannelType;
|
|
322
|
-
(function (ChannelInfoChannelType) {
|
|
323
|
-
ChannelInfoChannelType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
324
|
-
ChannelInfoChannelType["WEB"] = "WEB";
|
|
325
|
-
ChannelInfoChannelType["OTHER_PLATFORM"] = "OTHER_PLATFORM";
|
|
326
|
-
ChannelInfoChannelType["WIX_APP_STORE"] = "WIX_APP_STORE";
|
|
327
|
-
})(ChannelInfoChannelType || (exports.ChannelInfoChannelType = ChannelInfoChannelType = {}));
|
|
328
|
-
var WebhookIdentityType;
|
|
329
|
-
(function (WebhookIdentityType) {
|
|
330
|
-
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
331
|
-
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
332
|
-
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
333
|
-
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
334
|
-
WebhookIdentityType["APP"] = "APP";
|
|
335
|
-
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
336
|
-
/**
|
|
337
|
-
* Creates a checkout.
|
|
338
|
-
*
|
|
339
|
-
* A checkout must include at least 1 item in `lineItems` or `customLineItems`.
|
|
340
|
-
*
|
|
341
|
-
* If passing `checkoutInfo.customFields`, then `checkoutInfo.customFields.value` is a required field.
|
|
342
|
-
* @public
|
|
343
|
-
* @requiredField options.channelType
|
|
344
|
-
* @requiredField options.checkoutInfo.customFields.value
|
|
345
|
-
* @requiredField options.checkoutInfo.membershipOptions.selectedMemberships.memberships._id
|
|
346
|
-
* @requiredField options.checkoutInfo.membershipOptions.selectedMemberships.memberships.appId
|
|
347
|
-
* @requiredField options.checkoutInfo.membershipOptions.selectedMemberships.memberships.lineItemIds
|
|
348
|
-
* @requiredField options.customLineItems.descriptionLines.name
|
|
349
|
-
* @requiredField options.customLineItems.descriptionLines.value
|
|
350
|
-
* @requiredField options.customLineItems.itemType
|
|
351
|
-
* @requiredField options.customLineItems.price
|
|
352
|
-
* @requiredField options.customLineItems.productName
|
|
353
|
-
* @requiredField options.customLineItems.quantity
|
|
354
|
-
* @requiredField options.lineItems.catalogReference
|
|
355
|
-
* @requiredField options.lineItems.catalogReference.appId
|
|
356
|
-
* @requiredField options.lineItems.catalogReference.catalogItemId
|
|
357
|
-
* @requiredField options.lineItems.quantity
|
|
358
|
-
* @param options - Checkout creation options.
|
|
359
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
360
|
-
* @permissionId ECOM.ADMIN_MODIFY_CHECKOUTS
|
|
361
|
-
* @permissionScope Manage Stores - all permissions
|
|
362
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
363
|
-
* @permissionScope Manage Stores
|
|
364
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
365
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
366
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
367
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
368
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
369
|
-
* @permissionScope Manage Orders
|
|
370
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
371
|
-
* @permissionScope Manage Stores - all permissions
|
|
372
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
373
|
-
* @permissionScope Manage eCommerce - Admin Permissions
|
|
374
|
-
* @permissionScopeId SCOPE.ECOM.MANAGE-ADMIN
|
|
375
|
-
* @permissionScope Manage Stores
|
|
376
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
377
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
378
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
379
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
380
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
381
|
-
* @applicableIdentity APP
|
|
382
|
-
* @applicableIdentity VISITOR
|
|
383
|
-
* @returns Newly created checkout.
|
|
384
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.CreateCheckout
|
|
385
|
-
*/
|
|
386
|
-
async function createCheckout(options) {
|
|
387
|
-
// @ts-ignore
|
|
388
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
389
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
390
|
-
checkoutInfo: options?.checkoutInfo,
|
|
391
|
-
couponCode: options?.couponCode,
|
|
392
|
-
lineItems: options?.lineItems,
|
|
393
|
-
customLineItems: options?.customLineItems,
|
|
394
|
-
channelType: options?.channelType,
|
|
395
|
-
giftCardCode: options?.giftCardCode,
|
|
396
|
-
overrideCheckoutUrl: options?.overrideCheckoutUrl,
|
|
397
|
-
}), [
|
|
398
|
-
{
|
|
399
|
-
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
400
|
-
paths: [
|
|
401
|
-
{ path: 'checkoutInfo.lineItems.url' },
|
|
402
|
-
{ path: 'lineItems.url' },
|
|
403
|
-
{ path: 'customLineItems.url' },
|
|
404
|
-
],
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
transformFn: image_1.transformSDKImageToRESTImage,
|
|
408
|
-
paths: [
|
|
409
|
-
{ path: 'checkoutInfo.lineItems.media' },
|
|
410
|
-
{ path: 'checkoutInfo.lineItems.catalogOverrideFields.image' },
|
|
411
|
-
{ path: 'lineItems.media' },
|
|
412
|
-
{ path: 'lineItems.catalogOverrideFields.image' },
|
|
413
|
-
{ path: 'customLineItems.media' },
|
|
414
|
-
],
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
418
|
-
paths: [
|
|
419
|
-
{ path: 'checkoutInfo.billingInfo.address' },
|
|
420
|
-
{ path: 'checkoutInfo.shippingInfo.shippingDestination.address' },
|
|
421
|
-
{
|
|
422
|
-
path: 'checkoutInfo.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
path: 'checkoutInfo.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
426
|
-
},
|
|
427
|
-
],
|
|
428
|
-
},
|
|
429
|
-
]);
|
|
430
|
-
const reqOpts = ambassadorWixEcomV1Checkout.createCheckout(payload);
|
|
431
|
-
sideEffects?.onSiteCall?.();
|
|
432
|
-
try {
|
|
433
|
-
const result = await httpClient.request(reqOpts);
|
|
434
|
-
sideEffects?.onSuccess?.(result);
|
|
435
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
436
|
-
{
|
|
437
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
438
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
442
|
-
paths: [
|
|
443
|
-
{ path: 'checkout.lineItems.media' },
|
|
444
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
445
|
-
],
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
449
|
-
paths: [
|
|
450
|
-
{ path: 'checkout.billingInfo.address' },
|
|
451
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
452
|
-
{
|
|
453
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
457
|
-
},
|
|
458
|
-
],
|
|
459
|
-
},
|
|
460
|
-
]))?.checkout;
|
|
461
|
-
}
|
|
462
|
-
catch (err) {
|
|
463
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
464
|
-
spreadPathsToArguments: {},
|
|
465
|
-
explicitPathsToArguments: {
|
|
466
|
-
checkoutInfo: '$[0].checkoutInfo',
|
|
467
|
-
couponCode: '$[0].couponCode',
|
|
468
|
-
lineItems: '$[0].lineItems',
|
|
469
|
-
customLineItems: '$[0].customLineItems',
|
|
470
|
-
channelType: '$[0].channelType',
|
|
471
|
-
giftCardCode: '$[0].giftCardCode',
|
|
472
|
-
overrideCheckoutUrl: '$[0].overrideCheckoutUrl',
|
|
473
|
-
},
|
|
474
|
-
singleArgumentUnchanged: false,
|
|
475
|
-
}, ['options']);
|
|
476
|
-
sideEffects?.onError?.(err);
|
|
477
|
-
throw transformedError;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
exports.createCheckout = createCheckout;
|
|
481
|
-
/**
|
|
482
|
-
* Retrieves a checkout.
|
|
483
|
-
* @param _id - Checkout ID.
|
|
484
|
-
* @public
|
|
485
|
-
* @requiredField _id
|
|
486
|
-
* @permissionId ECOM.READ_CHECKOUTS
|
|
487
|
-
* @permissionScope Manage Stores - all permissions
|
|
488
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
489
|
-
* @permissionScope Manage Stores
|
|
490
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
491
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
492
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
493
|
-
* @permissionScope Read Orders
|
|
494
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
|
|
495
|
-
* @permissionScope Read Stores - all read permissions
|
|
496
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
497
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
498
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
499
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
500
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
501
|
-
* @permissionScope Manage Orders
|
|
502
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
503
|
-
* @applicableIdentity APP
|
|
504
|
-
* @applicableIdentity VISITOR
|
|
505
|
-
* @returns Retrieved checkout.
|
|
506
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.GetCheckout
|
|
507
|
-
*/
|
|
508
|
-
async function getCheckout(_id) {
|
|
509
|
-
// @ts-ignore
|
|
510
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
511
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
512
|
-
const reqOpts = ambassadorWixEcomV1Checkout.getCheckout(payload);
|
|
513
|
-
sideEffects?.onSiteCall?.();
|
|
514
|
-
try {
|
|
515
|
-
const result = await httpClient.request(reqOpts);
|
|
516
|
-
sideEffects?.onSuccess?.(result);
|
|
517
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
518
|
-
{
|
|
519
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
520
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
524
|
-
paths: [
|
|
525
|
-
{ path: 'checkout.lineItems.media' },
|
|
526
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
527
|
-
],
|
|
528
|
-
},
|
|
529
|
-
{
|
|
530
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
531
|
-
paths: [
|
|
532
|
-
{ path: 'checkout.billingInfo.address' },
|
|
533
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
534
|
-
{
|
|
535
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
539
|
-
},
|
|
540
|
-
],
|
|
541
|
-
},
|
|
542
|
-
]))?.checkout;
|
|
543
|
-
}
|
|
544
|
-
catch (err) {
|
|
545
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
546
|
-
spreadPathsToArguments: {},
|
|
547
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
548
|
-
singleArgumentUnchanged: false,
|
|
549
|
-
}, ['_id']);
|
|
550
|
-
sideEffects?.onError?.(err);
|
|
551
|
-
throw transformedError;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
exports.getCheckout = getCheckout;
|
|
555
|
-
/**
|
|
556
|
-
* Retrieves the checkout associated with a specified cart.
|
|
557
|
-
* @param _id - Cart ID.
|
|
558
|
-
* @public
|
|
559
|
-
* @requiredField _id
|
|
560
|
-
* @permissionId ECOM.READ_CHECKOUTS
|
|
561
|
-
* @permissionScope Manage Stores - all permissions
|
|
562
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
563
|
-
* @permissionScope Manage Stores
|
|
564
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
565
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
566
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
567
|
-
* @permissionScope Read Orders
|
|
568
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
|
|
569
|
-
* @permissionScope Read Stores - all read permissions
|
|
570
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
571
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
572
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
573
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
574
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
575
|
-
* @permissionScope Manage Orders
|
|
576
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
577
|
-
* @applicableIdentity APP
|
|
578
|
-
* @applicableIdentity VISITOR
|
|
579
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.GetCheckoutByCartId
|
|
580
|
-
*/
|
|
581
|
-
async function getCheckoutByCartId(_id) {
|
|
582
|
-
// @ts-ignore
|
|
583
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
584
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
585
|
-
const reqOpts = ambassadorWixEcomV1Checkout.getCheckoutByCartId(payload);
|
|
586
|
-
sideEffects?.onSiteCall?.();
|
|
587
|
-
try {
|
|
588
|
-
const result = await httpClient.request(reqOpts);
|
|
589
|
-
sideEffects?.onSuccess?.(result);
|
|
590
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
591
|
-
{
|
|
592
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
593
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
594
|
-
},
|
|
595
|
-
{
|
|
596
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
597
|
-
paths: [
|
|
598
|
-
{ path: 'checkout.lineItems.media' },
|
|
599
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
600
|
-
],
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
604
|
-
paths: [
|
|
605
|
-
{ path: 'checkout.billingInfo.address' },
|
|
606
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
607
|
-
{
|
|
608
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
612
|
-
},
|
|
613
|
-
],
|
|
614
|
-
},
|
|
615
|
-
]));
|
|
616
|
-
}
|
|
617
|
-
catch (err) {
|
|
618
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
619
|
-
spreadPathsToArguments: {},
|
|
620
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
621
|
-
singleArgumentUnchanged: false,
|
|
622
|
-
}, ['_id']);
|
|
623
|
-
sideEffects?.onError?.(err);
|
|
624
|
-
throw transformedError;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
exports.getCheckoutByCartId = getCheckoutByCartId;
|
|
628
|
-
/**
|
|
629
|
-
* Deprecated and will be removed soon, use GetCheckoutURL
|
|
630
|
-
* @param _id - Checkout ID.
|
|
631
|
-
* @internal
|
|
632
|
-
* @documentationMaturity preview
|
|
633
|
-
* @requiredField _id
|
|
634
|
-
* @permissionId ECOM.READ_CHECKOUTS
|
|
635
|
-
* @permissionScope Manage Stores - all permissions
|
|
636
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
637
|
-
* @permissionScope Manage Stores
|
|
638
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
639
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
640
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
641
|
-
* @permissionScope Read Orders
|
|
642
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
|
|
643
|
-
* @permissionScope Read Stores - all read permissions
|
|
644
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
645
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
646
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
647
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
648
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
649
|
-
* @permissionScope Manage Orders
|
|
650
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
651
|
-
* @applicableIdentity APP
|
|
652
|
-
* @applicableIdentity VISITOR
|
|
653
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.GetWixCheckoutURL
|
|
654
|
-
*/
|
|
655
|
-
async function getWixCheckoutUrl(_id) {
|
|
656
|
-
// @ts-ignore
|
|
657
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
658
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
659
|
-
const reqOpts = ambassadorWixEcomV1Checkout.getWixCheckoutUrl(payload);
|
|
660
|
-
sideEffects?.onSiteCall?.();
|
|
661
|
-
try {
|
|
662
|
-
const result = await httpClient.request(reqOpts);
|
|
663
|
-
sideEffects?.onSuccess?.(result);
|
|
664
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
665
|
-
}
|
|
666
|
-
catch (err) {
|
|
667
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
668
|
-
spreadPathsToArguments: {},
|
|
669
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
670
|
-
singleArgumentUnchanged: false,
|
|
671
|
-
}, ['_id']);
|
|
672
|
-
sideEffects?.onError?.(err);
|
|
673
|
-
throw transformedError;
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
exports.getWixCheckoutUrl = getWixCheckoutUrl;
|
|
677
|
-
/**
|
|
678
|
-
* Retrieves the checkout page URL of a specified checkout.
|
|
679
|
-
*
|
|
680
|
-
* By default, a `checkoutUrl` generates for a checkout and directs to a standard Wix checkout page.
|
|
681
|
-
* However, if `overrideCheckoutUrl` has a value, it will replace and set the value of `checkoutUrl`.
|
|
682
|
-
* @param _id - Checkout ID.
|
|
683
|
-
* @public
|
|
684
|
-
* @requiredField _id
|
|
685
|
-
* @permissionId ECOM.READ_CHECKOUTS
|
|
686
|
-
* @permissionScope Manage Stores - all permissions
|
|
687
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
688
|
-
* @permissionScope Manage Stores
|
|
689
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
690
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
691
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
692
|
-
* @permissionScope Read Orders
|
|
693
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
|
|
694
|
-
* @permissionScope Read Stores - all read permissions
|
|
695
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
696
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
697
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
698
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
699
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
700
|
-
* @permissionScope Manage Orders
|
|
701
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
702
|
-
* @applicableIdentity APP
|
|
703
|
-
* @applicableIdentity VISITOR
|
|
704
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.GetCheckoutURL
|
|
705
|
-
*/
|
|
706
|
-
async function getCheckoutUrl(_id) {
|
|
707
|
-
// @ts-ignore
|
|
708
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
709
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
710
|
-
const reqOpts = ambassadorWixEcomV1Checkout.getCheckoutUrl(payload);
|
|
711
|
-
sideEffects?.onSiteCall?.();
|
|
712
|
-
try {
|
|
713
|
-
const result = await httpClient.request(reqOpts);
|
|
714
|
-
sideEffects?.onSuccess?.(result);
|
|
715
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
716
|
-
}
|
|
717
|
-
catch (err) {
|
|
718
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
719
|
-
spreadPathsToArguments: {},
|
|
720
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
721
|
-
singleArgumentUnchanged: false,
|
|
722
|
-
}, ['_id']);
|
|
723
|
-
sideEffects?.onError?.(err);
|
|
724
|
-
throw transformedError;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
exports.getCheckoutUrl = getCheckoutUrl;
|
|
728
|
-
/**
|
|
729
|
-
* Updates a checkout.
|
|
730
|
-
*
|
|
731
|
-
* Use this method to update checkout fields such as billing and shipping info, or to add a coupon code or gift card.
|
|
732
|
-
*
|
|
733
|
-
* To update a checkout's `lineItems`, `completed` status, or to remove coupons and gift cards, see these methods:
|
|
734
|
-
* + Add to Checkout: Add line items to the checkout.
|
|
735
|
-
* + Update Line Items Quantity: Update the quantity of 1 or more line items in the checkout.
|
|
736
|
-
* + Remove Line Items: Remove a line item from the checkout.
|
|
737
|
-
* + Mark Checkout As Completed: To update `completed` to `true` if the checkout was completed through a non-Wix orders or payments system.
|
|
738
|
-
* + Remove Coupon: To remove an applied coupon from the checkout.
|
|
739
|
-
* + Remove Gift Card: To remove an applied gift card from the checkout.
|
|
740
|
-
*
|
|
741
|
-
* >**Notes:**
|
|
742
|
-
* > + If nothing is passed in the request, the call will fail.
|
|
743
|
-
* > + The `checkout.buyerInfo.email` may not be removed once it is set.
|
|
744
|
-
* @param _id - Checkout ID.
|
|
745
|
-
* @public
|
|
746
|
-
* @requiredField _id
|
|
747
|
-
* @requiredField checkout
|
|
748
|
-
* @requiredField checkout.customFields.value
|
|
749
|
-
* @requiredField checkout.membershipOptions.selectedMemberships.memberships._id
|
|
750
|
-
* @requiredField checkout.membershipOptions.selectedMemberships.memberships.appId
|
|
751
|
-
* @requiredField checkout.membershipOptions.selectedMemberships.memberships.lineItemIds
|
|
752
|
-
* @requiredField options.customLineItems.descriptionLines.name
|
|
753
|
-
* @requiredField options.customLineItems.descriptionLines.value
|
|
754
|
-
* @requiredField options.customLineItems.itemType
|
|
755
|
-
* @requiredField options.customLineItems.productName
|
|
756
|
-
* @requiredField options.customLineItems.quantity
|
|
757
|
-
* @requiredField options.lineItems.catalogReference
|
|
758
|
-
* @requiredField options.lineItems.catalogReference.appId
|
|
759
|
-
* @requiredField options.lineItems.catalogReference.catalogItemId
|
|
760
|
-
* @requiredField options.lineItems.quantity
|
|
761
|
-
* @param options - Checkout update options.
|
|
762
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
763
|
-
* @permissionId ECOM.ADMIN_MODIFY_CHECKOUTS
|
|
764
|
-
* @permissionScope Manage Stores - all permissions
|
|
765
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
766
|
-
* @permissionScope Manage Stores
|
|
767
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
768
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
769
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
770
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
771
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
772
|
-
* @permissionScope Manage Orders
|
|
773
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
774
|
-
* @permissionScope Manage Stores - all permissions
|
|
775
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
776
|
-
* @permissionScope Manage eCommerce - Admin Permissions
|
|
777
|
-
* @permissionScopeId SCOPE.ECOM.MANAGE-ADMIN
|
|
778
|
-
* @permissionScope Manage Stores
|
|
779
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
780
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
781
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
782
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
783
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
784
|
-
* @applicableIdentity APP
|
|
785
|
-
* @applicableIdentity VISITOR
|
|
786
|
-
* @returns Updated checkout.
|
|
787
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.UpdateCheckout
|
|
788
|
-
*/
|
|
789
|
-
async function updateCheckout(_id, checkout, options) {
|
|
790
|
-
// @ts-ignore
|
|
791
|
-
const { httpClient, sideEffects } = arguments[3];
|
|
792
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
793
|
-
checkout: { ...checkout, id: _id },
|
|
794
|
-
couponCode: options?.couponCode,
|
|
795
|
-
giftCardCode: options?.giftCardCode,
|
|
796
|
-
overrideCheckoutUrl: options?.overrideCheckoutUrl,
|
|
797
|
-
lineItems: options?.lineItems,
|
|
798
|
-
customLineItems: options?.customLineItems,
|
|
799
|
-
}), [
|
|
800
|
-
{
|
|
801
|
-
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
802
|
-
paths: [
|
|
803
|
-
{ path: 'checkout.lineItems.url' },
|
|
804
|
-
{ path: 'lineItems.url' },
|
|
805
|
-
{ path: 'customLineItems.url' },
|
|
806
|
-
],
|
|
807
|
-
},
|
|
808
|
-
{
|
|
809
|
-
transformFn: image_1.transformSDKImageToRESTImage,
|
|
810
|
-
paths: [
|
|
811
|
-
{ path: 'checkout.lineItems.media' },
|
|
812
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
813
|
-
{ path: 'lineItems.media' },
|
|
814
|
-
{ path: 'lineItems.catalogOverrideFields.image' },
|
|
815
|
-
{ path: 'customLineItems.media' },
|
|
816
|
-
],
|
|
817
|
-
},
|
|
818
|
-
{
|
|
819
|
-
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
820
|
-
paths: [
|
|
821
|
-
{ path: 'checkout.billingInfo.address' },
|
|
822
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
823
|
-
{
|
|
824
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
828
|
-
},
|
|
829
|
-
],
|
|
830
|
-
},
|
|
831
|
-
]);
|
|
832
|
-
const reqOpts = ambassadorWixEcomV1Checkout.updateCheckout(payload);
|
|
833
|
-
sideEffects?.onSiteCall?.();
|
|
834
|
-
try {
|
|
835
|
-
const result = await httpClient.request(reqOpts);
|
|
836
|
-
sideEffects?.onSuccess?.(result);
|
|
837
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
838
|
-
{
|
|
839
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
840
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
841
|
-
},
|
|
842
|
-
{
|
|
843
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
844
|
-
paths: [
|
|
845
|
-
{ path: 'checkout.lineItems.media' },
|
|
846
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
847
|
-
],
|
|
848
|
-
},
|
|
849
|
-
{
|
|
850
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
851
|
-
paths: [
|
|
852
|
-
{ path: 'checkout.billingInfo.address' },
|
|
853
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
854
|
-
{
|
|
855
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
856
|
-
},
|
|
857
|
-
{
|
|
858
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
859
|
-
},
|
|
860
|
-
],
|
|
861
|
-
},
|
|
862
|
-
]))?.checkout;
|
|
863
|
-
}
|
|
864
|
-
catch (err) {
|
|
865
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
866
|
-
spreadPathsToArguments: { checkout: '$[1]' },
|
|
867
|
-
explicitPathsToArguments: {
|
|
868
|
-
'checkout.id': '$[0]',
|
|
869
|
-
couponCode: '$[2].couponCode',
|
|
870
|
-
giftCardCode: '$[2].giftCardCode',
|
|
871
|
-
overrideCheckoutUrl: '$[2].overrideCheckoutUrl',
|
|
872
|
-
lineItems: '$[2].lineItems',
|
|
873
|
-
customLineItems: '$[2].customLineItems',
|
|
874
|
-
},
|
|
875
|
-
singleArgumentUnchanged: false,
|
|
876
|
-
}, ['_id', 'checkout', 'options']);
|
|
877
|
-
sideEffects?.onError?.(err);
|
|
878
|
-
throw transformedError;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
exports.updateCheckout = updateCheckout;
|
|
882
|
-
/**
|
|
883
|
-
* Removes the coupon from a specified checkout.
|
|
884
|
-
* @param _id - ID of the checkout to remove the coupon from.
|
|
885
|
-
* @public
|
|
886
|
-
* @requiredField _id
|
|
887
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
888
|
-
* @permissionScope Manage Stores - all permissions
|
|
889
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
890
|
-
* @permissionScope Manage Stores
|
|
891
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
892
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
893
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
894
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
895
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
896
|
-
* @permissionScope Manage Orders
|
|
897
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
898
|
-
* @applicableIdentity APP
|
|
899
|
-
* @applicableIdentity VISITOR
|
|
900
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.RemoveCoupon
|
|
901
|
-
*/
|
|
902
|
-
async function removeCoupon(_id) {
|
|
903
|
-
// @ts-ignore
|
|
904
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
905
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
906
|
-
const reqOpts = ambassadorWixEcomV1Checkout.removeCoupon(payload);
|
|
907
|
-
sideEffects?.onSiteCall?.();
|
|
908
|
-
try {
|
|
909
|
-
const result = await httpClient.request(reqOpts);
|
|
910
|
-
sideEffects?.onSuccess?.(result);
|
|
911
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
912
|
-
{
|
|
913
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
914
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
915
|
-
},
|
|
916
|
-
{
|
|
917
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
918
|
-
paths: [
|
|
919
|
-
{ path: 'checkout.lineItems.media' },
|
|
920
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
921
|
-
],
|
|
922
|
-
},
|
|
923
|
-
{
|
|
924
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
925
|
-
paths: [
|
|
926
|
-
{ path: 'checkout.billingInfo.address' },
|
|
927
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
928
|
-
{
|
|
929
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
930
|
-
},
|
|
931
|
-
{
|
|
932
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
933
|
-
},
|
|
934
|
-
],
|
|
935
|
-
},
|
|
936
|
-
]));
|
|
937
|
-
}
|
|
938
|
-
catch (err) {
|
|
939
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
940
|
-
spreadPathsToArguments: {},
|
|
941
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
942
|
-
singleArgumentUnchanged: false,
|
|
943
|
-
}, ['_id']);
|
|
944
|
-
sideEffects?.onError?.(err);
|
|
945
|
-
throw transformedError;
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
exports.removeCoupon = removeCoupon;
|
|
949
|
-
/**
|
|
950
|
-
* Removes the gift card from a specified checkout.
|
|
951
|
-
*
|
|
952
|
-
* A checkout can only hold 1 gift card.
|
|
953
|
-
* @param _id - ID of the checkout to remove the gift card from.
|
|
954
|
-
* @public
|
|
955
|
-
* @requiredField _id
|
|
956
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
957
|
-
* @permissionScope Manage Stores - all permissions
|
|
958
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
959
|
-
* @permissionScope Manage Stores
|
|
960
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
961
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
962
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
963
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
964
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
965
|
-
* @permissionScope Manage Orders
|
|
966
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
967
|
-
* @applicableIdentity APP
|
|
968
|
-
* @applicableIdentity VISITOR
|
|
969
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.RemoveGiftCard
|
|
970
|
-
*/
|
|
971
|
-
async function removeGiftCard(_id) {
|
|
972
|
-
// @ts-ignore
|
|
973
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
974
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
975
|
-
const reqOpts = ambassadorWixEcomV1Checkout.removeGiftCard(payload);
|
|
976
|
-
sideEffects?.onSiteCall?.();
|
|
977
|
-
try {
|
|
978
|
-
const result = await httpClient.request(reqOpts);
|
|
979
|
-
sideEffects?.onSuccess?.(result);
|
|
980
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
981
|
-
{
|
|
982
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
983
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
984
|
-
},
|
|
985
|
-
{
|
|
986
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
987
|
-
paths: [
|
|
988
|
-
{ path: 'checkout.lineItems.media' },
|
|
989
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
990
|
-
],
|
|
991
|
-
},
|
|
992
|
-
{
|
|
993
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
994
|
-
paths: [
|
|
995
|
-
{ path: 'checkout.billingInfo.address' },
|
|
996
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
997
|
-
{
|
|
998
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
1002
|
-
},
|
|
1003
|
-
],
|
|
1004
|
-
},
|
|
1005
|
-
]));
|
|
1006
|
-
}
|
|
1007
|
-
catch (err) {
|
|
1008
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1009
|
-
spreadPathsToArguments: {},
|
|
1010
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1011
|
-
singleArgumentUnchanged: false,
|
|
1012
|
-
}, ['_id']);
|
|
1013
|
-
sideEffects?.onError?.(err);
|
|
1014
|
-
throw transformedError;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
exports.removeGiftCard = removeGiftCard;
|
|
1018
|
-
/**
|
|
1019
|
-
* Removes the `overrideCheckoutUrl` from a specified checkout.
|
|
1020
|
-
*
|
|
1021
|
-
* When `overrideCheckoutUrl` is removed, the `checkoutUrl` will be set to the default, standard
|
|
1022
|
-
* Wix checkout page URL.
|
|
1023
|
-
* @param _id - ID of the checkout to remove the override checkout url from.
|
|
1024
|
-
* @public
|
|
1025
|
-
* @requiredField _id
|
|
1026
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
1027
|
-
* @permissionScope Manage Stores - all permissions
|
|
1028
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1029
|
-
* @permissionScope Manage Stores
|
|
1030
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1031
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1032
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1033
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1034
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1035
|
-
* @permissionScope Manage Orders
|
|
1036
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1037
|
-
* @applicableIdentity APP
|
|
1038
|
-
* @applicableIdentity VISITOR
|
|
1039
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.RemoveOverrideCheckoutUrl
|
|
1040
|
-
*/
|
|
1041
|
-
async function removeOverrideCheckoutUrl(_id) {
|
|
1042
|
-
// @ts-ignore
|
|
1043
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1044
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
1045
|
-
const reqOpts = ambassadorWixEcomV1Checkout.removeOverrideCheckoutUrl(payload);
|
|
1046
|
-
sideEffects?.onSiteCall?.();
|
|
1047
|
-
try {
|
|
1048
|
-
const result = await httpClient.request(reqOpts);
|
|
1049
|
-
sideEffects?.onSuccess?.(result);
|
|
1050
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1051
|
-
{
|
|
1052
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1053
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
1054
|
-
},
|
|
1055
|
-
{
|
|
1056
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1057
|
-
paths: [
|
|
1058
|
-
{ path: 'checkout.lineItems.media' },
|
|
1059
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
1060
|
-
],
|
|
1061
|
-
},
|
|
1062
|
-
{
|
|
1063
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1064
|
-
paths: [
|
|
1065
|
-
{ path: 'checkout.billingInfo.address' },
|
|
1066
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
1067
|
-
{
|
|
1068
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
1069
|
-
},
|
|
1070
|
-
{
|
|
1071
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
1072
|
-
},
|
|
1073
|
-
],
|
|
1074
|
-
},
|
|
1075
|
-
]));
|
|
1076
|
-
}
|
|
1077
|
-
catch (err) {
|
|
1078
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1079
|
-
spreadPathsToArguments: {},
|
|
1080
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1081
|
-
singleArgumentUnchanged: false,
|
|
1082
|
-
}, ['_id']);
|
|
1083
|
-
sideEffects?.onError?.(err);
|
|
1084
|
-
throw transformedError;
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
exports.removeOverrideCheckoutUrl = removeOverrideCheckoutUrl;
|
|
1088
|
-
/**
|
|
1089
|
-
* Adds catalog line items and/or custom line items to a checkout.
|
|
1090
|
-
*
|
|
1091
|
-
* When adding catalog ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)) items
|
|
1092
|
-
* to a checkout, the `lineItems.catalogReference.appId` and `lineItems.catalogReference.catalogItemId` fields are required.
|
|
1093
|
-
* @param _id - Checkout ID.
|
|
1094
|
-
* @public
|
|
1095
|
-
* @requiredField _id
|
|
1096
|
-
* @requiredField options.customLineItems.descriptionLines.name
|
|
1097
|
-
* @requiredField options.customLineItems.descriptionLines.value
|
|
1098
|
-
* @requiredField options.customLineItems.itemType
|
|
1099
|
-
* @requiredField options.customLineItems.productName
|
|
1100
|
-
* @requiredField options.customLineItems.quantity
|
|
1101
|
-
* @requiredField options.lineItems.catalogReference
|
|
1102
|
-
* @requiredField options.lineItems.catalogReference.appId
|
|
1103
|
-
* @requiredField options.lineItems.catalogReference.catalogItemId
|
|
1104
|
-
* @requiredField options.lineItems.quantity
|
|
1105
|
-
* @param options - Items to be added to checkout.
|
|
1106
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
1107
|
-
* @permissionId ECOM.ADMIN_MODIFY_CHECKOUTS
|
|
1108
|
-
* @permissionScope Manage Stores - all permissions
|
|
1109
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1110
|
-
* @permissionScope Manage Stores
|
|
1111
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1112
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1113
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1114
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1115
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1116
|
-
* @permissionScope Manage Orders
|
|
1117
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1118
|
-
* @permissionScope Manage Stores - all permissions
|
|
1119
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1120
|
-
* @permissionScope Manage eCommerce - Admin Permissions
|
|
1121
|
-
* @permissionScopeId SCOPE.ECOM.MANAGE-ADMIN
|
|
1122
|
-
* @permissionScope Manage Stores
|
|
1123
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1124
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1125
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1126
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1127
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1128
|
-
* @applicableIdentity APP
|
|
1129
|
-
* @applicableIdentity VISITOR
|
|
1130
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.AddToCheckout
|
|
1131
|
-
*/
|
|
1132
|
-
async function addToCheckout(_id, options) {
|
|
1133
|
-
// @ts-ignore
|
|
1134
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1135
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1136
|
-
id: _id,
|
|
1137
|
-
lineItems: options?.lineItems,
|
|
1138
|
-
customLineItems: options?.customLineItems,
|
|
1139
|
-
}), [
|
|
1140
|
-
{
|
|
1141
|
-
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
1142
|
-
paths: [{ path: 'lineItems.url' }, { path: 'customLineItems.url' }],
|
|
1143
|
-
},
|
|
1144
|
-
{
|
|
1145
|
-
transformFn: image_1.transformSDKImageToRESTImage,
|
|
1146
|
-
paths: [
|
|
1147
|
-
{ path: 'lineItems.media' },
|
|
1148
|
-
{ path: 'lineItems.catalogOverrideFields.image' },
|
|
1149
|
-
{ path: 'customLineItems.media' },
|
|
1150
|
-
],
|
|
1151
|
-
},
|
|
1152
|
-
]);
|
|
1153
|
-
const reqOpts = ambassadorWixEcomV1Checkout.addToCheckout(payload);
|
|
1154
|
-
sideEffects?.onSiteCall?.();
|
|
1155
|
-
try {
|
|
1156
|
-
const result = await httpClient.request(reqOpts);
|
|
1157
|
-
sideEffects?.onSuccess?.(result);
|
|
1158
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1159
|
-
{
|
|
1160
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1161
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
1162
|
-
},
|
|
1163
|
-
{
|
|
1164
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1165
|
-
paths: [
|
|
1166
|
-
{ path: 'checkout.lineItems.media' },
|
|
1167
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
1168
|
-
],
|
|
1169
|
-
},
|
|
1170
|
-
{
|
|
1171
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1172
|
-
paths: [
|
|
1173
|
-
{ path: 'checkout.billingInfo.address' },
|
|
1174
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
1175
|
-
{
|
|
1176
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
1177
|
-
},
|
|
1178
|
-
{
|
|
1179
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
1180
|
-
},
|
|
1181
|
-
],
|
|
1182
|
-
},
|
|
1183
|
-
]));
|
|
1184
|
-
}
|
|
1185
|
-
catch (err) {
|
|
1186
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1187
|
-
spreadPathsToArguments: {},
|
|
1188
|
-
explicitPathsToArguments: {
|
|
1189
|
-
id: '$[0]',
|
|
1190
|
-
lineItems: '$[1].lineItems',
|
|
1191
|
-
customLineItems: '$[1].customLineItems',
|
|
1192
|
-
},
|
|
1193
|
-
singleArgumentUnchanged: false,
|
|
1194
|
-
}, ['_id', 'options']);
|
|
1195
|
-
sideEffects?.onError?.(err);
|
|
1196
|
-
throw transformedError;
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
exports.addToCheckout = addToCheckout;
|
|
1200
|
-
/**
|
|
1201
|
-
* Removes line items from the specified checkout.
|
|
1202
|
-
* @param _id - ID of the checkout to remove line items from.
|
|
1203
|
-
* @param lineItemIds - IDs of the line items to remove from the checkout.
|
|
1204
|
-
*
|
|
1205
|
-
* To find the IDs of the checkout line items you'd like to remove,
|
|
1206
|
-
* pass the checkout ID to Get Checkout and look for the IDs under
|
|
1207
|
-
* `lineItems`.
|
|
1208
|
-
* @public
|
|
1209
|
-
* @requiredField _id
|
|
1210
|
-
* @requiredField lineItemIds
|
|
1211
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
1212
|
-
* @permissionScope Manage Stores - all permissions
|
|
1213
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1214
|
-
* @permissionScope Manage Stores
|
|
1215
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1216
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1217
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1218
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1219
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1220
|
-
* @permissionScope Manage Orders
|
|
1221
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1222
|
-
* @applicableIdentity APP
|
|
1223
|
-
* @applicableIdentity VISITOR
|
|
1224
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.RemoveLineItems
|
|
1225
|
-
*/
|
|
1226
|
-
async function removeLineItems(_id, lineItemIds) {
|
|
1227
|
-
// @ts-ignore
|
|
1228
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1229
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1230
|
-
id: _id,
|
|
1231
|
-
lineItemIds: lineItemIds,
|
|
1232
|
-
});
|
|
1233
|
-
const reqOpts = ambassadorWixEcomV1Checkout.removeLineItems(payload);
|
|
1234
|
-
sideEffects?.onSiteCall?.();
|
|
1235
|
-
try {
|
|
1236
|
-
const result = await httpClient.request(reqOpts);
|
|
1237
|
-
sideEffects?.onSuccess?.(result);
|
|
1238
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1239
|
-
{
|
|
1240
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1241
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
1242
|
-
},
|
|
1243
|
-
{
|
|
1244
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1245
|
-
paths: [
|
|
1246
|
-
{ path: 'checkout.lineItems.media' },
|
|
1247
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
1248
|
-
],
|
|
1249
|
-
},
|
|
1250
|
-
{
|
|
1251
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1252
|
-
paths: [
|
|
1253
|
-
{ path: 'checkout.billingInfo.address' },
|
|
1254
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
1255
|
-
{
|
|
1256
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
1257
|
-
},
|
|
1258
|
-
{
|
|
1259
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
1260
|
-
},
|
|
1261
|
-
],
|
|
1262
|
-
},
|
|
1263
|
-
]));
|
|
1264
|
-
}
|
|
1265
|
-
catch (err) {
|
|
1266
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1267
|
-
spreadPathsToArguments: {},
|
|
1268
|
-
explicitPathsToArguments: { id: '$[0]', lineItemIds: '$[1]' },
|
|
1269
|
-
singleArgumentUnchanged: false,
|
|
1270
|
-
}, ['_id', 'lineItemIds']);
|
|
1271
|
-
sideEffects?.onError?.(err);
|
|
1272
|
-
throw transformedError;
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
exports.removeLineItems = removeLineItems;
|
|
1276
|
-
/**
|
|
1277
|
-
* Creates an order from a specified checkout.
|
|
1278
|
-
*
|
|
1279
|
-
* For an order to be created from a checkout, the following requirements must be met:
|
|
1280
|
-
* + A checkout cannot have calculation errors. Pass the checkout ID to Get Checkout and review the `calculationErrors` field.
|
|
1281
|
-
* + A checkout must have at least 1 line item or custom line item.
|
|
1282
|
-
* + All of the line Items have an `availability.status` of `"AVAILABLE"` or `"PARTIALLY_AVAILABLE"`.
|
|
1283
|
-
* + If there is a payment to be made, meaning that `priceSummary.total` is greater than `0`, the `billingInfo.address` field are required.
|
|
1284
|
-
* + When a checkout has line items to be shipped, the `shippingInfo.shippingDestination.address` and `shippingInfo.selectedCarrierServiceOption` fields are required.
|
|
1285
|
-
* + When a checkout has line items for pickup, the `shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails` field are required.
|
|
1286
|
-
* @param _id - Checkout ID.
|
|
1287
|
-
* @public
|
|
1288
|
-
* @requiredField _id
|
|
1289
|
-
* @param options - Additional order creation options.
|
|
1290
|
-
* @permissionId ECOM.CREATE_ORDER_FROM_CHECKOUT
|
|
1291
|
-
* @permissionScope Manage Stores - all permissions
|
|
1292
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1293
|
-
* @permissionScope Manage Stores
|
|
1294
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1295
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1296
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1297
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1298
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1299
|
-
* @permissionScope Manage Orders
|
|
1300
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1301
|
-
* @applicableIdentity APP
|
|
1302
|
-
* @applicableIdentity VISITOR
|
|
1303
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.CreateOrder
|
|
1304
|
-
*/
|
|
1305
|
-
async function createOrder(_id, options) {
|
|
1306
|
-
// @ts-ignore
|
|
1307
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1308
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1309
|
-
id: _id,
|
|
1310
|
-
savePaymentMethod: options?.savePaymentMethod,
|
|
1311
|
-
delayCapture: options?.delayCapture,
|
|
1312
|
-
});
|
|
1313
|
-
const reqOpts = ambassadorWixEcomV1Checkout.createOrder(payload);
|
|
1314
|
-
sideEffects?.onSiteCall?.();
|
|
1315
|
-
try {
|
|
1316
|
-
const result = await httpClient.request(reqOpts);
|
|
1317
|
-
sideEffects?.onSuccess?.(result);
|
|
1318
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
1319
|
-
}
|
|
1320
|
-
catch (err) {
|
|
1321
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1322
|
-
spreadPathsToArguments: {},
|
|
1323
|
-
explicitPathsToArguments: {
|
|
1324
|
-
id: '$[0]',
|
|
1325
|
-
savePaymentMethod: '$[1].savePaymentMethod',
|
|
1326
|
-
delayCapture: '$[1].delayCapture',
|
|
1327
|
-
},
|
|
1328
|
-
singleArgumentUnchanged: false,
|
|
1329
|
-
}, ['_id', 'options']);
|
|
1330
|
-
sideEffects?.onError?.(err);
|
|
1331
|
-
throw transformedError;
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
exports.createOrder = createOrder;
|
|
1335
|
-
/**
|
|
1336
|
-
* Deprecated (use createOrder instead)
|
|
1337
|
-
* @param _id - Checkout ID.
|
|
1338
|
-
* @internal
|
|
1339
|
-
* @documentationMaturity preview
|
|
1340
|
-
* @requiredField _id
|
|
1341
|
-
* @permissionId ECOM.CREATE_ORDER_FROM_CHECKOUT
|
|
1342
|
-
* @permissionScope Manage Stores - all permissions
|
|
1343
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1344
|
-
* @permissionScope Manage Stores
|
|
1345
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1346
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1347
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1348
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1349
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1350
|
-
* @permissionScope Manage Orders
|
|
1351
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1352
|
-
* @applicableIdentity APP
|
|
1353
|
-
* @applicableIdentity VISITOR
|
|
1354
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.CreateOrderAndCharge
|
|
1355
|
-
*/
|
|
1356
|
-
async function createOrderAndCharge(_id, options) {
|
|
1357
|
-
// @ts-ignore
|
|
1358
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1359
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1360
|
-
id: _id,
|
|
1361
|
-
paymentToken: options?.paymentToken,
|
|
1362
|
-
savePaymentMethod: options?.savePaymentMethod,
|
|
1363
|
-
delayCapture: options?.delayCapture,
|
|
1364
|
-
});
|
|
1365
|
-
const reqOpts = ambassadorWixEcomV1Checkout.createOrderAndCharge(payload);
|
|
1366
|
-
sideEffects?.onSiteCall?.();
|
|
1367
|
-
try {
|
|
1368
|
-
const result = await httpClient.request(reqOpts);
|
|
1369
|
-
sideEffects?.onSuccess?.(result);
|
|
1370
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
1371
|
-
}
|
|
1372
|
-
catch (err) {
|
|
1373
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1374
|
-
spreadPathsToArguments: {},
|
|
1375
|
-
explicitPathsToArguments: {
|
|
1376
|
-
id: '$[0]',
|
|
1377
|
-
paymentToken: '$[1].paymentToken',
|
|
1378
|
-
savePaymentMethod: '$[1].savePaymentMethod',
|
|
1379
|
-
delayCapture: '$[1].delayCapture',
|
|
1380
|
-
},
|
|
1381
|
-
singleArgumentUnchanged: false,
|
|
1382
|
-
}, ['_id', 'options']);
|
|
1383
|
-
sideEffects?.onError?.(err);
|
|
1384
|
-
throw transformedError;
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
exports.createOrderAndCharge = createOrderAndCharge;
|
|
1388
|
-
/**
|
|
1389
|
-
* Marks a checkout as completed and redirects to a specified URL.
|
|
1390
|
-
* @param token - Server-signed JWT token with required information to complete checkout
|
|
1391
|
-
* @public
|
|
1392
|
-
* @documentationMaturity preview
|
|
1393
|
-
* @requiredField token
|
|
1394
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
1395
|
-
* @permissionScope Manage Stores - all permissions
|
|
1396
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1397
|
-
* @permissionScope Manage Stores
|
|
1398
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1399
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1400
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1401
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1402
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1403
|
-
* @permissionScope Manage Orders
|
|
1404
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1405
|
-
* @applicableIdentity APP
|
|
1406
|
-
* @applicableIdentity VISITOR
|
|
1407
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.MarkCheckoutAsCompletedAndRedirectToUrl
|
|
1408
|
-
*/
|
|
1409
|
-
async function markCheckoutAsCompletedAndRedirectToUrl(token) {
|
|
1410
|
-
// @ts-ignore
|
|
1411
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1412
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ token: token });
|
|
1413
|
-
const reqOpts = ambassadorWixEcomV1Checkout.markCheckoutAsCompletedAndRedirectToUrl(payload);
|
|
1414
|
-
sideEffects?.onSiteCall?.();
|
|
1415
|
-
try {
|
|
1416
|
-
const result = await httpClient.request(reqOpts);
|
|
1417
|
-
sideEffects?.onSuccess?.(result);
|
|
1418
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
1419
|
-
}
|
|
1420
|
-
catch (err) {
|
|
1421
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1422
|
-
spreadPathsToArguments: {},
|
|
1423
|
-
explicitPathsToArguments: { token: '$[0]' },
|
|
1424
|
-
singleArgumentUnchanged: false,
|
|
1425
|
-
}, ['token']);
|
|
1426
|
-
sideEffects?.onError?.(err);
|
|
1427
|
-
throw transformedError;
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
exports.markCheckoutAsCompletedAndRedirectToUrl = markCheckoutAsCompletedAndRedirectToUrl;
|
|
1431
|
-
/**
|
|
1432
|
-
* Sets `completed` to `true` to mark a checkout as completed.
|
|
1433
|
-
*
|
|
1434
|
-
* When an order is completed through Wix, the `completed` field in the associated checkout object
|
|
1435
|
-
* will automatically be updated to `true`. If an order is completed through a separate system,
|
|
1436
|
-
* use this method to manually mark the checkout as completed.
|
|
1437
|
-
* @param _id - Checkout ID.
|
|
1438
|
-
* @public
|
|
1439
|
-
* @requiredField _id
|
|
1440
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
1441
|
-
* @permissionScope Manage Stores - all permissions
|
|
1442
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1443
|
-
* @permissionScope Manage Stores
|
|
1444
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1445
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1446
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1447
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1448
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1449
|
-
* @permissionScope Manage Orders
|
|
1450
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1451
|
-
* @applicableIdentity APP
|
|
1452
|
-
* @applicableIdentity VISITOR
|
|
1453
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.MarkCheckoutAsCompleted
|
|
1454
|
-
*/
|
|
1455
|
-
async function markCheckoutAsCompleted(_id) {
|
|
1456
|
-
// @ts-ignore
|
|
1457
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1458
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
1459
|
-
const reqOpts = ambassadorWixEcomV1Checkout.markCheckoutAsCompleted(payload);
|
|
1460
|
-
sideEffects?.onSiteCall?.();
|
|
1461
|
-
try {
|
|
1462
|
-
const result = await httpClient.request(reqOpts);
|
|
1463
|
-
sideEffects?.onSuccess?.(result);
|
|
1464
|
-
}
|
|
1465
|
-
catch (err) {
|
|
1466
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1467
|
-
spreadPathsToArguments: {},
|
|
1468
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1469
|
-
singleArgumentUnchanged: false,
|
|
1470
|
-
}, ['_id']);
|
|
1471
|
-
sideEffects?.onError?.(err);
|
|
1472
|
-
throw transformedError;
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
exports.markCheckoutAsCompleted = markCheckoutAsCompleted;
|
|
1476
|
-
/**
|
|
1477
|
-
* Updates the quantity of one or more line items in a checkout.
|
|
1478
|
-
*
|
|
1479
|
-
* This method is only for updating the quantity of line items. To entirely remove a line item from
|
|
1480
|
-
* the checkout, use the Remove Line Items method.
|
|
1481
|
-
* To add a new line item to the checkout, use the Add to Checkout method.
|
|
1482
|
-
*
|
|
1483
|
-
* This method checks the amount of stock remaining for this line item. If the specified `quantity`
|
|
1484
|
-
* is greater than the remaining stock, then the `quantity` returned in the response is the total amount
|
|
1485
|
-
* of remaining stock.
|
|
1486
|
-
* @param _id - Checkout ID.
|
|
1487
|
-
* @param lineItems - Line item info to update.
|
|
1488
|
-
* @public
|
|
1489
|
-
* @requiredField _id
|
|
1490
|
-
* @requiredField lineItems
|
|
1491
|
-
* @requiredField lineItems._id
|
|
1492
|
-
* @requiredField lineItems.quantity
|
|
1493
|
-
* @permissionId ECOM.MODIFY_CHECKOUTS
|
|
1494
|
-
* @permissionScope Manage Stores - all permissions
|
|
1495
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1496
|
-
* @permissionScope Manage Stores
|
|
1497
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
1498
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1499
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1500
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1501
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1502
|
-
* @permissionScope Manage Orders
|
|
1503
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1504
|
-
* @applicableIdentity APP
|
|
1505
|
-
* @applicableIdentity VISITOR
|
|
1506
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.UpdateLineItemsQuantity
|
|
1507
|
-
*/
|
|
1508
|
-
async function updateLineItemsQuantity(_id, lineItems) {
|
|
1509
|
-
// @ts-ignore
|
|
1510
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1511
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1512
|
-
id: _id,
|
|
1513
|
-
lineItems: lineItems,
|
|
1514
|
-
});
|
|
1515
|
-
const reqOpts = ambassadorWixEcomV1Checkout.updateLineItemsQuantity(payload);
|
|
1516
|
-
sideEffects?.onSiteCall?.();
|
|
1517
|
-
try {
|
|
1518
|
-
const result = await httpClient.request(reqOpts);
|
|
1519
|
-
sideEffects?.onSuccess?.(result);
|
|
1520
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1521
|
-
{
|
|
1522
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1523
|
-
paths: [{ path: 'checkout.lineItems.url' }],
|
|
1524
|
-
},
|
|
1525
|
-
{
|
|
1526
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1527
|
-
paths: [
|
|
1528
|
-
{ path: 'checkout.lineItems.media' },
|
|
1529
|
-
{ path: 'checkout.lineItems.catalogOverrideFields.image' },
|
|
1530
|
-
],
|
|
1531
|
-
},
|
|
1532
|
-
{
|
|
1533
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1534
|
-
paths: [
|
|
1535
|
-
{ path: 'checkout.billingInfo.address' },
|
|
1536
|
-
{ path: 'checkout.shippingInfo.shippingDestination.address' },
|
|
1537
|
-
{
|
|
1538
|
-
path: 'checkout.shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
1539
|
-
},
|
|
1540
|
-
{
|
|
1541
|
-
path: 'checkout.shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
1542
|
-
},
|
|
1543
|
-
],
|
|
1544
|
-
},
|
|
1545
|
-
]));
|
|
1546
|
-
}
|
|
1547
|
-
catch (err) {
|
|
1548
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1549
|
-
spreadPathsToArguments: {},
|
|
1550
|
-
explicitPathsToArguments: { id: '$[0]', lineItems: '$[1]' },
|
|
1551
|
-
singleArgumentUnchanged: false,
|
|
1552
|
-
}, ['_id', 'lineItems']);
|
|
1553
|
-
sideEffects?.onError?.(err);
|
|
1554
|
-
throw transformedError;
|
|
1555
|
-
}
|
|
1556
|
-
}
|
|
1557
|
-
exports.updateLineItemsQuantity = updateLineItemsQuantity;
|
|
1558
|
-
/** @param _id - Checkout ID.
|
|
1559
|
-
* @internal
|
|
1560
|
-
* @documentationMaturity preview
|
|
1561
|
-
* @requiredField _id
|
|
1562
|
-
* @permissionId ECOM.READ_PAYMENT_SETTINGS
|
|
1563
|
-
* @fqn com.wix.ecom.checkout.api.v1.CheckoutService.GetCheckoutPaymentSettings
|
|
1564
|
-
*/
|
|
1565
|
-
async function getCheckoutPaymentSettings(_id) {
|
|
1566
|
-
// @ts-ignore
|
|
1567
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1568
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
1569
|
-
const reqOpts = ambassadorWixEcomV1Checkout.getCheckoutPaymentSettings(payload);
|
|
1570
|
-
sideEffects?.onSiteCall?.();
|
|
1571
|
-
try {
|
|
1572
|
-
const result = await httpClient.request(reqOpts);
|
|
1573
|
-
sideEffects?.onSuccess?.(result);
|
|
1574
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
1575
|
-
}
|
|
1576
|
-
catch (err) {
|
|
1577
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1578
|
-
spreadPathsToArguments: {},
|
|
1579
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1580
|
-
singleArgumentUnchanged: false,
|
|
1581
|
-
}, ['_id']);
|
|
1582
|
-
sideEffects?.onError?.(err);
|
|
1583
|
-
throw transformedError;
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
exports.getCheckoutPaymentSettings = getCheckoutPaymentSettings;
|
|
1587
|
-
//# sourceMappingURL=ecom-v1-checkout-checkout.universal.js.map
|