@wix/auto_sdk_ecom_cart-v-2 1.0.8 → 1.0.10
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/cjs/index.d.ts +123 -107
- package/build/cjs/index.js +41 -51
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +34 -44
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +106 -100
- package/build/cjs/meta.js +20 -20
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +123 -107
- package/build/es/index.mjs +39 -48
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +32 -41
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +106 -100
- package/build/es/meta.mjs +18 -18
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +24 -28
- package/build/internal/cjs/index.js +41 -51
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +142 -130
- package/build/internal/cjs/index.typings.js +34 -44
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +106 -100
- package/build/internal/cjs/meta.js +20 -20
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +24 -28
- package/build/internal/es/index.mjs +39 -48
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +142 -130
- package/build/internal/es/index.typings.mjs +32 -41
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +106 -100
- package/build/internal/es/meta.mjs +18 -18
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/es/meta.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateCartRequest as CreateCartRequest$1, CreateCartResponse as CreateCartResponse$1, GetCartRequest as GetCartRequest$1, GetCartResponse as GetCartResponse$1, UpdateCartRequest as UpdateCartRequest$1, UpdateCartResponse as UpdateCartResponse$1, DeleteCartRequest as DeleteCartRequest$1, DeleteCartResponse as DeleteCartResponse$1, RefreshCartRequest as RefreshCartRequest$1, RefreshCartResponse as RefreshCartResponse$1, CalculateCartRequest as CalculateCartRequest$1, CalculateCartResponse as CalculateCartResponse$1, GetCheckoutURLRequest as GetCheckoutURLRequest$1, GetCheckoutURLResponse as GetCheckoutURLResponse$1, PlaceOrderRequest as PlaceOrderRequest$1, PlaceOrderResponse as PlaceOrderResponse$1, AddLineItemsRequest as AddLineItemsRequest$1, AddLineItemsResponse as AddLineItemsResponse$1, RemoveLineItemsRequest as RemoveLineItemsRequest$1, RemoveLineItemsResponse as RemoveLineItemsResponse$1, UpdateLineItemsRequest as UpdateLineItemsRequest$1, UpdateLineItemsResponse as UpdateLineItemsResponse$1,
|
|
1
|
+
import { CreateCartRequest as CreateCartRequest$1, CreateCartResponse as CreateCartResponse$1, GetCartRequest as GetCartRequest$1, GetCartResponse as GetCartResponse$1, UpdateCartRequest as UpdateCartRequest$1, UpdateCartResponse as UpdateCartResponse$1, DeleteCartRequest as DeleteCartRequest$1, DeleteCartResponse as DeleteCartResponse$1, RefreshCartRequest as RefreshCartRequest$1, RefreshCartResponse as RefreshCartResponse$1, CalculateCartRequest as CalculateCartRequest$1, CalculateCartResponse as CalculateCartResponse$1, GetCheckoutURLRequest as GetCheckoutURLRequest$1, GetCheckoutURLResponse as GetCheckoutURLResponse$1, PlaceOrderRequest as PlaceOrderRequest$1, PlaceOrderResponse as PlaceOrderResponse$1, AddLineItemsRequest as AddLineItemsRequest$1, AddLineItemsResponse as AddLineItemsResponse$1, RemoveLineItemsRequest as RemoveLineItemsRequest$1, RemoveLineItemsResponse as RemoveLineItemsResponse$1, UpdateLineItemsRequest as UpdateLineItemsRequest$1, UpdateLineItemsResponse as UpdateLineItemsResponse$1, AddCouponRequest as AddCouponRequest$1, AddCouponResponse as AddCouponResponse$1, RemoveCouponRequest as RemoveCouponRequest$1, RemoveCouponResponse as RemoveCouponResponse$1, AddGiftCardRequest as AddGiftCardRequest$1, AddGiftCardResponse as AddGiftCardResponse$1, RemoveGiftCardRequest as RemoveGiftCardRequest$1, RemoveGiftCardResponse as RemoveGiftCardResponse$1, MarkCartAsCompletedRequest as MarkCartAsCompletedRequest$1, MarkCartAsCompletedResponse as MarkCartAsCompletedResponse$1, HandleAsyncCheckoutCompletionRequest as HandleAsyncCheckoutCompletionRequest$1, RawHttpResponse as RawHttpResponse$1 } from './index.mjs';
|
|
2
2
|
|
|
3
3
|
interface Cart {
|
|
4
4
|
/**
|
|
@@ -39,13 +39,11 @@ interface Cart {
|
|
|
39
39
|
*/
|
|
40
40
|
note?: string | null;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @maxSize 100
|
|
46
|
-
* @readonly
|
|
42
|
+
* List of coupons added to the Cart.
|
|
43
|
+
* Currently, only one coupon code is supported.
|
|
44
|
+
* @maxSize 1
|
|
47
45
|
*/
|
|
48
|
-
|
|
46
|
+
coupons?: Coupon[];
|
|
49
47
|
/** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
|
|
50
48
|
source?: CartSource;
|
|
51
49
|
/** Information about the site from which the Cart's line items were added. */
|
|
@@ -140,6 +138,11 @@ interface V2LineItem {
|
|
|
140
138
|
* @maxSize 25
|
|
141
139
|
*/
|
|
142
140
|
modifierGroups?: ModifierGroup[];
|
|
141
|
+
/**
|
|
142
|
+
* List of discounts applied to this line item.
|
|
143
|
+
* @maxSize 100
|
|
144
|
+
*/
|
|
145
|
+
discounts?: ItemDiscount[];
|
|
143
146
|
/**
|
|
144
147
|
* Whether the line item is a custom line item.
|
|
145
148
|
* Custom line items don't trigger the Catalog service plugin.
|
|
@@ -753,6 +756,11 @@ interface SelectedMembership {
|
|
|
753
756
|
* @format GUID
|
|
754
757
|
*/
|
|
755
758
|
appId?: string;
|
|
759
|
+
/**
|
|
760
|
+
* Name of the selected membership.
|
|
761
|
+
* @readonly
|
|
762
|
+
*/
|
|
763
|
+
name?: TranslatableString;
|
|
756
764
|
}
|
|
757
765
|
declare enum ItemStatus {
|
|
758
766
|
UNKNOWN_ITEM_STATUS = "UNKNOWN_ITEM_STATUS",
|
|
@@ -853,95 +861,29 @@ interface ItemModifier {
|
|
|
853
861
|
/** The price of the modifier. */
|
|
854
862
|
price?: MultiCurrencyPrice;
|
|
855
863
|
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
id?: string;
|
|
864
|
+
/**
|
|
865
|
+
* Currently, only automatic discounts are applied to line items.
|
|
866
|
+
* In the future, coupon discounts will be supported as well.
|
|
867
|
+
*/
|
|
868
|
+
interface ItemDiscount {
|
|
862
869
|
/** The display name of the discount. */
|
|
863
870
|
name?: TranslatableString;
|
|
864
|
-
/** The
|
|
865
|
-
|
|
866
|
-
/** The component in the Cart that the discount applies to. */
|
|
867
|
-
scope?: DiscountScopeWithLiterals;
|
|
868
|
-
/**
|
|
869
|
-
* List of benefits provided by the discount.
|
|
870
|
-
* @minSize 1
|
|
871
|
-
* @maxSize 100
|
|
872
|
-
*/
|
|
873
|
-
benefits?: DiscountBenefit[];
|
|
874
|
-
/**
|
|
875
|
-
* The current status of the discount.
|
|
876
|
-
* TODO: remodel.
|
|
877
|
-
*/
|
|
878
|
-
status?: DiscountStatusWithLiterals;
|
|
879
|
-
/**
|
|
880
|
-
* Number of subscription cycles this discount applies to.
|
|
881
|
-
* If unset, the discount applies to all billing cycles.
|
|
882
|
-
* @min 1
|
|
883
|
-
* @max 1000
|
|
884
|
-
*/
|
|
885
|
-
subscriptionCycles?: number | null;
|
|
871
|
+
/** The amount discounted from the item's sale price (per unit). */
|
|
872
|
+
amountOff?: MultiCurrencyPrice;
|
|
886
873
|
}
|
|
887
|
-
interface
|
|
888
|
-
/** The type of the discount source. */
|
|
889
|
-
sourceType?: DiscountSourceTypeWithLiterals;
|
|
874
|
+
interface Coupon {
|
|
890
875
|
/**
|
|
891
|
-
*
|
|
892
|
-
*
|
|
893
|
-
* @maxLength 50
|
|
876
|
+
* ID of the coupon in the Cart.
|
|
877
|
+
* @format GUID
|
|
894
878
|
*/
|
|
895
|
-
|
|
896
|
-
}
|
|
897
|
-
declare enum DiscountSourceType {
|
|
898
|
-
UNKNOWN_DISCOUNT_SOURCE_TYPE = "UNKNOWN_DISCOUNT_SOURCE_TYPE",
|
|
899
|
-
/** The discount was applied automatically by a rule. */
|
|
900
|
-
AUTOMATIC_RULE = "AUTOMATIC_RULE",
|
|
901
|
-
/** The discount was applied by a coupon code. */
|
|
902
|
-
COUPON = "COUPON"
|
|
903
|
-
}
|
|
904
|
-
/** @enumType */
|
|
905
|
-
type DiscountSourceTypeWithLiterals = DiscountSourceType | 'UNKNOWN_DISCOUNT_SOURCE_TYPE' | 'AUTOMATIC_RULE' | 'COUPON';
|
|
906
|
-
declare enum DiscountScope {
|
|
907
|
-
UNKNOWN_DISCOUNT_SCOPE = "UNKNOWN_DISCOUNT_SCOPE",
|
|
908
|
-
/** The discount applies to the cart's subtotal. */
|
|
909
|
-
CART_SUBTOTAL = "CART_SUBTOTAL",
|
|
910
|
-
/** The discount applies to a specific line item. */
|
|
911
|
-
LINE_ITEM = "LINE_ITEM",
|
|
912
|
-
/** The discount applies to the delivery price. */
|
|
913
|
-
DELIVERY = "DELIVERY"
|
|
914
|
-
}
|
|
915
|
-
/** @enumType */
|
|
916
|
-
type DiscountScopeWithLiterals = DiscountScope | 'UNKNOWN_DISCOUNT_SCOPE' | 'CART_SUBTOTAL' | 'LINE_ITEM' | 'DELIVERY';
|
|
917
|
-
interface DiscountBenefit extends DiscountBenefitValueOneOf {
|
|
918
|
-
/** A specific monetary value deducted from the total cost. */
|
|
919
|
-
amountOff?: MultiCurrencyPrice;
|
|
879
|
+
id?: string;
|
|
920
880
|
/**
|
|
921
|
-
*
|
|
922
|
-
*
|
|
923
|
-
* @
|
|
881
|
+
* Coupon code.
|
|
882
|
+
* @minLength 1
|
|
883
|
+
* @maxLength 50
|
|
924
884
|
*/
|
|
925
|
-
|
|
926
|
-
}
|
|
927
|
-
/** @oneof */
|
|
928
|
-
interface DiscountBenefitValueOneOf {
|
|
929
|
-
/** A specific monetary value deducted from the total cost. */
|
|
930
|
-
amountOff?: MultiCurrencyPrice;
|
|
931
|
-
}
|
|
932
|
-
declare enum DiscountStatus {
|
|
933
|
-
UNKNOWN_DISCOUNT_STATUS = "UNKNOWN_DISCOUNT_STATUS",
|
|
934
|
-
/** The discount is active and valid. */
|
|
935
|
-
ACTIVE = "ACTIVE",
|
|
936
|
-
/** The discount has expired. */
|
|
937
|
-
EXPIRED = "EXPIRED",
|
|
938
|
-
/** The discount was deleted from the system. */
|
|
939
|
-
DELETED = "DELETED",
|
|
940
|
-
/** The discount reached the maximum number of uses. */
|
|
941
|
-
MAX_USAGE_REACHED = "MAX_USAGE_REACHED"
|
|
885
|
+
code?: string;
|
|
942
886
|
}
|
|
943
|
-
/** @enumType */
|
|
944
|
-
type DiscountStatusWithLiterals = DiscountStatus | 'UNKNOWN_DISCOUNT_STATUS' | 'ACTIVE' | 'EXPIRED' | 'DELETED' | 'MAX_USAGE_REACHED';
|
|
945
887
|
interface CartSource {
|
|
946
888
|
/**
|
|
947
889
|
* Sales channel that created the Cart.
|
|
@@ -1420,6 +1362,72 @@ interface CartSettings {
|
|
|
1420
1362
|
*/
|
|
1421
1363
|
manualPaymentDisabled?: boolean;
|
|
1422
1364
|
}
|
|
1365
|
+
interface Discount {
|
|
1366
|
+
/** The display name of the discount. */
|
|
1367
|
+
name?: TranslatableString;
|
|
1368
|
+
/** The source of the discount, indicating how it was applied. */
|
|
1369
|
+
source?: DiscountSource;
|
|
1370
|
+
/** The component in the Cart that the discount applies to. */
|
|
1371
|
+
scope?: DiscountScopeWithLiterals;
|
|
1372
|
+
/**
|
|
1373
|
+
* List of benefits provided by the discount.
|
|
1374
|
+
* @minSize 1
|
|
1375
|
+
* @maxSize 100
|
|
1376
|
+
*/
|
|
1377
|
+
benefits?: DiscountBenefit[];
|
|
1378
|
+
/**
|
|
1379
|
+
* Number of subscription cycles this discount applies to.
|
|
1380
|
+
* If unset, the discount applies to all billing cycles.
|
|
1381
|
+
* @min 1
|
|
1382
|
+
* @max 1000
|
|
1383
|
+
*/
|
|
1384
|
+
subscriptionCycles?: number | null;
|
|
1385
|
+
}
|
|
1386
|
+
interface DiscountSource {
|
|
1387
|
+
/** The type of the discount source. */
|
|
1388
|
+
sourceType?: DiscountSourceTypeWithLiterals;
|
|
1389
|
+
/**
|
|
1390
|
+
* Coupon code that triggered the discount.
|
|
1391
|
+
* Relevant for coupon discounts only.
|
|
1392
|
+
* @maxLength 50
|
|
1393
|
+
*/
|
|
1394
|
+
couponCode?: string | null;
|
|
1395
|
+
}
|
|
1396
|
+
declare enum DiscountSourceType {
|
|
1397
|
+
UNKNOWN_DISCOUNT_SOURCE_TYPE = "UNKNOWN_DISCOUNT_SOURCE_TYPE",
|
|
1398
|
+
/** The discount was applied automatically by a rule. */
|
|
1399
|
+
AUTOMATIC_RULE = "AUTOMATIC_RULE",
|
|
1400
|
+
/** The discount was applied by a coupon code. */
|
|
1401
|
+
COUPON = "COUPON"
|
|
1402
|
+
}
|
|
1403
|
+
/** @enumType */
|
|
1404
|
+
type DiscountSourceTypeWithLiterals = DiscountSourceType | 'UNKNOWN_DISCOUNT_SOURCE_TYPE' | 'AUTOMATIC_RULE' | 'COUPON';
|
|
1405
|
+
declare enum DiscountScope {
|
|
1406
|
+
UNKNOWN_DISCOUNT_SCOPE = "UNKNOWN_DISCOUNT_SCOPE",
|
|
1407
|
+
/** The discount applies to the cart's subtotal. */
|
|
1408
|
+
CART_SUBTOTAL = "CART_SUBTOTAL",
|
|
1409
|
+
/** The discount applies to a specific line item. */
|
|
1410
|
+
LINE_ITEM = "LINE_ITEM",
|
|
1411
|
+
/** The discount applies to the delivery price. */
|
|
1412
|
+
DELIVERY = "DELIVERY"
|
|
1413
|
+
}
|
|
1414
|
+
/** @enumType */
|
|
1415
|
+
type DiscountScopeWithLiterals = DiscountScope | 'UNKNOWN_DISCOUNT_SCOPE' | 'CART_SUBTOTAL' | 'LINE_ITEM' | 'DELIVERY';
|
|
1416
|
+
interface DiscountBenefit extends DiscountBenefitValueOneOf {
|
|
1417
|
+
/** A specific monetary value deducted from the total cost. */
|
|
1418
|
+
amountOff?: MultiCurrencyPrice;
|
|
1419
|
+
/**
|
|
1420
|
+
* The ID of line item that the discount applies to.
|
|
1421
|
+
* Relevant for item-level discounts only.
|
|
1422
|
+
* @format GUID
|
|
1423
|
+
*/
|
|
1424
|
+
lineItemId?: string | null;
|
|
1425
|
+
}
|
|
1426
|
+
/** @oneof */
|
|
1427
|
+
interface DiscountBenefitValueOneOf {
|
|
1428
|
+
/** A specific monetary value deducted from the total cost. */
|
|
1429
|
+
amountOff?: MultiCurrencyPrice;
|
|
1430
|
+
}
|
|
1423
1431
|
interface CartSummary {
|
|
1424
1432
|
/**
|
|
1425
1433
|
* The Cart ID.
|
|
@@ -1688,8 +1696,6 @@ interface Membership {
|
|
|
1688
1696
|
* @maxLength 100
|
|
1689
1697
|
*/
|
|
1690
1698
|
lineItemIds?: string[];
|
|
1691
|
-
/** The name of this membership. */
|
|
1692
|
-
name?: TranslatableString;
|
|
1693
1699
|
}
|
|
1694
1700
|
interface SubscriptionCharges {
|
|
1695
1701
|
/**
|
|
@@ -2278,7 +2284,7 @@ interface UpdateLineItemsResponse {
|
|
|
2278
2284
|
/** Updated Cart. */
|
|
2279
2285
|
cart?: Cart;
|
|
2280
2286
|
}
|
|
2281
|
-
interface
|
|
2287
|
+
interface AddCouponRequest {
|
|
2282
2288
|
/**
|
|
2283
2289
|
* Cart ID.
|
|
2284
2290
|
* @format GUID
|
|
@@ -2293,11 +2299,11 @@ interface AddDiscountRequest {
|
|
|
2293
2299
|
*/
|
|
2294
2300
|
couponCode: string;
|
|
2295
2301
|
}
|
|
2296
|
-
interface
|
|
2302
|
+
interface AddCouponResponse {
|
|
2297
2303
|
/** Updated Cart. */
|
|
2298
2304
|
cart?: Cart;
|
|
2299
2305
|
}
|
|
2300
|
-
interface
|
|
2306
|
+
interface RemoveCouponRequest {
|
|
2301
2307
|
/**
|
|
2302
2308
|
* Cart ID.
|
|
2303
2309
|
* @format GUID
|
|
@@ -2307,9 +2313,9 @@ interface RemoveDiscountRequest {
|
|
|
2307
2313
|
* Discount ID.
|
|
2308
2314
|
* @format GUID
|
|
2309
2315
|
*/
|
|
2310
|
-
|
|
2316
|
+
couponId: string;
|
|
2311
2317
|
}
|
|
2312
|
-
interface
|
|
2318
|
+
interface RemoveCouponResponse {
|
|
2313
2319
|
/** Updated Cart. */
|
|
2314
2320
|
cart?: Cart;
|
|
2315
2321
|
}
|
|
@@ -2421,12 +2427,12 @@ declare function removeLineItems(): __PublicMethodMetaInfo<'POST', {
|
|
|
2421
2427
|
declare function updateLineItems(): __PublicMethodMetaInfo<'POST', {
|
|
2422
2428
|
cartId: string;
|
|
2423
2429
|
}, UpdateLineItemsRequest$1, UpdateLineItemsRequest, UpdateLineItemsResponse$1, UpdateLineItemsResponse>;
|
|
2424
|
-
declare function
|
|
2430
|
+
declare function addCoupon(): __PublicMethodMetaInfo<'POST', {
|
|
2425
2431
|
cartId: string;
|
|
2426
|
-
},
|
|
2427
|
-
declare function
|
|
2432
|
+
}, AddCouponRequest$1, AddCouponRequest, AddCouponResponse$1, AddCouponResponse>;
|
|
2433
|
+
declare function removeCoupon(): __PublicMethodMetaInfo<'POST', {
|
|
2428
2434
|
cartId: string;
|
|
2429
|
-
},
|
|
2435
|
+
}, RemoveCouponRequest$1, RemoveCouponRequest, RemoveCouponResponse$1, RemoveCouponResponse>;
|
|
2430
2436
|
declare function addGiftCard(): __PublicMethodMetaInfo<'POST', {
|
|
2431
2437
|
cartId: string;
|
|
2432
2438
|
}, AddGiftCardRequest$1, AddGiftCardRequest, AddGiftCardResponse$1, AddGiftCardResponse>;
|
|
@@ -2438,4 +2444,4 @@ declare function markCartAsCompleted(): __PublicMethodMetaInfo<'POST', {
|
|
|
2438
2444
|
}, MarkCartAsCompletedRequest$1, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse$1, MarkCartAsCompletedResponse>;
|
|
2439
2445
|
declare function handleAsyncCheckoutCompletion(): __PublicMethodMetaInfo<'POST', {}, HandleAsyncCheckoutCompletionRequest$1, HandleAsyncCheckoutCompletionRequest, RawHttpResponse$1, RawHttpResponse>;
|
|
2440
2446
|
|
|
2441
|
-
export { type __PublicMethodMetaInfo,
|
|
2447
|
+
export { type __PublicMethodMetaInfo, addCoupon, addGiftCard, addLineItems, calculateCart, createCart, deleteCart, getCart, getCheckoutUrl, handleAsyncCheckoutCompletion, markCartAsCompleted, placeOrder, refreshCart, removeCoupon, removeGiftCard, removeLineItems, updateCart, updateLineItems };
|
package/build/es/meta.mjs
CHANGED
|
@@ -655,15 +655,15 @@ function updateLineItems(payload) {
|
|
|
655
655
|
}
|
|
656
656
|
return __updateLineItems;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
function
|
|
658
|
+
function addCoupon(payload) {
|
|
659
|
+
function __addCoupon({ host }) {
|
|
660
660
|
const metadata = {
|
|
661
661
|
entityFqdn: "wix.ecom.v2.cart",
|
|
662
662
|
method: "POST",
|
|
663
|
-
methodFqn: "wix.ecom.cart.v2.CartService.
|
|
663
|
+
methodFqn: "wix.ecom.cart.v2.CartService.AddCoupon",
|
|
664
664
|
packageName: PACKAGE_NAME,
|
|
665
665
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
666
|
-
protoPath: "/v2/carts/{cartId}/add-
|
|
666
|
+
protoPath: "/v2/carts/{cartId}/add-coupon",
|
|
667
667
|
data: payload,
|
|
668
668
|
host
|
|
669
669
|
}),
|
|
@@ -703,17 +703,17 @@ function addDiscount(payload) {
|
|
|
703
703
|
};
|
|
704
704
|
return metadata;
|
|
705
705
|
}
|
|
706
|
-
return
|
|
706
|
+
return __addCoupon;
|
|
707
707
|
}
|
|
708
|
-
function
|
|
709
|
-
function
|
|
708
|
+
function removeCoupon(payload) {
|
|
709
|
+
function __removeCoupon({ host }) {
|
|
710
710
|
const metadata = {
|
|
711
711
|
entityFqdn: "wix.ecom.v2.cart",
|
|
712
712
|
method: "POST",
|
|
713
|
-
methodFqn: "wix.ecom.cart.v2.CartService.
|
|
713
|
+
methodFqn: "wix.ecom.cart.v2.CartService.RemoveCoupon",
|
|
714
714
|
packageName: PACKAGE_NAME,
|
|
715
715
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
716
|
-
protoPath: "/v2/carts/{cartId}/remove-
|
|
716
|
+
protoPath: "/v2/carts/{cartId}/remove-coupon",
|
|
717
717
|
data: payload,
|
|
718
718
|
host
|
|
719
719
|
}),
|
|
@@ -753,7 +753,7 @@ function removeDiscount(payload) {
|
|
|
753
753
|
};
|
|
754
754
|
return metadata;
|
|
755
755
|
}
|
|
756
|
-
return
|
|
756
|
+
return __removeCoupon;
|
|
757
757
|
}
|
|
758
758
|
function addGiftCard(payload) {
|
|
759
759
|
function __addGiftCard({ host }) {
|
|
@@ -1129,9 +1129,9 @@ function updateLineItems2() {
|
|
|
1129
1129
|
__originalResponseType: null
|
|
1130
1130
|
};
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1132
|
+
function addCoupon2() {
|
|
1133
1133
|
const payload = { cartId: ":cartId" };
|
|
1134
|
-
const getRequestOptions =
|
|
1134
|
+
const getRequestOptions = addCoupon(payload);
|
|
1135
1135
|
const getUrl = (context) => {
|
|
1136
1136
|
const { url } = getRequestOptions(context);
|
|
1137
1137
|
return url;
|
|
@@ -1139,7 +1139,7 @@ function addDiscount2() {
|
|
|
1139
1139
|
return {
|
|
1140
1140
|
getUrl,
|
|
1141
1141
|
httpMethod: "POST",
|
|
1142
|
-
path: "/v2/carts/{cartId}/add-
|
|
1142
|
+
path: "/v2/carts/{cartId}/add-coupon",
|
|
1143
1143
|
pathParams: { cartId: "cartId" },
|
|
1144
1144
|
__requestType: null,
|
|
1145
1145
|
__originalRequestType: null,
|
|
@@ -1147,9 +1147,9 @@ function addDiscount2() {
|
|
|
1147
1147
|
__originalResponseType: null
|
|
1148
1148
|
};
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1150
|
+
function removeCoupon2() {
|
|
1151
1151
|
const payload = { cartId: ":cartId" };
|
|
1152
|
-
const getRequestOptions =
|
|
1152
|
+
const getRequestOptions = removeCoupon(payload);
|
|
1153
1153
|
const getUrl = (context) => {
|
|
1154
1154
|
const { url } = getRequestOptions(context);
|
|
1155
1155
|
return url;
|
|
@@ -1157,7 +1157,7 @@ function removeDiscount2() {
|
|
|
1157
1157
|
return {
|
|
1158
1158
|
getUrl,
|
|
1159
1159
|
httpMethod: "POST",
|
|
1160
|
-
path: "/v2/carts/{cartId}/remove-
|
|
1160
|
+
path: "/v2/carts/{cartId}/remove-coupon",
|
|
1161
1161
|
pathParams: { cartId: "cartId" },
|
|
1162
1162
|
__requestType: null,
|
|
1163
1163
|
__originalRequestType: null,
|
|
@@ -1238,7 +1238,7 @@ function handleAsyncCheckoutCompletion2() {
|
|
|
1238
1238
|
};
|
|
1239
1239
|
}
|
|
1240
1240
|
export {
|
|
1241
|
-
|
|
1241
|
+
addCoupon2 as addCoupon,
|
|
1242
1242
|
addGiftCard2 as addGiftCard,
|
|
1243
1243
|
addLineItems2 as addLineItems,
|
|
1244
1244
|
calculateCart2 as calculateCart,
|
|
@@ -1250,7 +1250,7 @@ export {
|
|
|
1250
1250
|
markCartAsCompleted2 as markCartAsCompleted,
|
|
1251
1251
|
placeOrder2 as placeOrder,
|
|
1252
1252
|
refreshCart2 as refreshCart,
|
|
1253
|
-
|
|
1253
|
+
removeCoupon2 as removeCoupon,
|
|
1254
1254
|
removeGiftCard2 as removeGiftCard,
|
|
1255
1255
|
removeLineItems2 as removeLineItems,
|
|
1256
1256
|
updateCart2 as updateCart,
|