btrz-api-client 5.195.0 → 5.196.0
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/lib/client-standalone-min.js +3 -3
- package/lib/endpoints/sales/cart.js +33 -1
- package/package.json +1 -1
- package/src/endpoints/sales/cart.js +22 -1
- package/test/endpoints/sales/cart.test.js +13 -0
- package/types/client.d.ts +15 -0
- package/types/endpoints/sales/cart.d.ts +15 -0
- package/types/initializedClient.d.ts +15 -0
|
@@ -161,6 +161,37 @@ function cartFactory(_ref) {
|
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
+
var financingCosts = {
|
|
165
|
+
create: function create(_ref12) {
|
|
166
|
+
var token = _ref12.token,
|
|
167
|
+
jwtToken = _ref12.jwtToken,
|
|
168
|
+
headers = _ref12.headers,
|
|
169
|
+
cartId = _ref12.cartId,
|
|
170
|
+
financingCost = _ref12.financingCost;
|
|
171
|
+
|
|
172
|
+
return client({
|
|
173
|
+
url: "/carts/" + cartId + "/financing-costs",
|
|
174
|
+
method: "POST",
|
|
175
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
176
|
+
data: {
|
|
177
|
+
financingcost: financingCost
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
},
|
|
181
|
+
delete: function _delete(_ref13) {
|
|
182
|
+
var token = _ref13.token,
|
|
183
|
+
jwtToken = _ref13.jwtToken,
|
|
184
|
+
headers = _ref13.headers,
|
|
185
|
+
cartId = _ref13.cartId;
|
|
186
|
+
|
|
187
|
+
return client({
|
|
188
|
+
url: "/carts/" + cartId + "/financing-costs",
|
|
189
|
+
method: "delete",
|
|
190
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
164
195
|
return {
|
|
165
196
|
get: get,
|
|
166
197
|
create: create,
|
|
@@ -170,7 +201,8 @@ function cartFactory(_ref) {
|
|
|
170
201
|
patch: patch,
|
|
171
202
|
partialDepositStatus: partialDepositStatus,
|
|
172
203
|
payments: payments,
|
|
173
|
-
taxExemptPaymentMethod: taxExemptPaymentMethod
|
|
204
|
+
taxExemptPaymentMethod: taxExemptPaymentMethod,
|
|
205
|
+
financingCosts: financingCosts
|
|
174
206
|
};
|
|
175
207
|
}
|
|
176
208
|
|
package/package.json
CHANGED
|
@@ -98,6 +98,26 @@ function cartFactory({client, internalAuthTokenProvider}) {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
const financingCosts = {
|
|
102
|
+
create({token, jwtToken, headers, cartId, financingCost}) {
|
|
103
|
+
return client({
|
|
104
|
+
url: `/carts/${cartId}/financing-costs`,
|
|
105
|
+
method: "POST",
|
|
106
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
107
|
+
data: {
|
|
108
|
+
financingcost: financingCost
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
delete({token, jwtToken, headers, cartId}) {
|
|
113
|
+
return client({
|
|
114
|
+
url: `/carts/${cartId}/financing-costs`,
|
|
115
|
+
method: "delete",
|
|
116
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
101
121
|
return {
|
|
102
122
|
get,
|
|
103
123
|
create,
|
|
@@ -107,7 +127,8 @@ function cartFactory({client, internalAuthTokenProvider}) {
|
|
|
107
127
|
patch,
|
|
108
128
|
partialDepositStatus,
|
|
109
129
|
payments,
|
|
110
|
-
taxExemptPaymentMethod
|
|
130
|
+
taxExemptPaymentMethod,
|
|
131
|
+
financingCosts
|
|
111
132
|
};
|
|
112
133
|
}
|
|
113
134
|
|
|
@@ -81,4 +81,17 @@ describe("sales/cart", () => {
|
|
|
81
81
|
axiosMock.onPost(`/carts/${cartId}/tax-exempt-payment-method`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
82
82
|
return api.sales.cart.taxExemptPaymentMethod.post({jwtToken, token, cartId});
|
|
83
83
|
});
|
|
84
|
+
|
|
85
|
+
it("should delete payments from a cart", () => {
|
|
86
|
+
const cartId = "someCartId";
|
|
87
|
+
axiosMock.onDelete(`/carts/${cartId}/financing-costs`).reply(expectRequest({statusCode: 200, token, jwtToken}));
|
|
88
|
+
return api.sales.cart.financingCosts.delete({jwtToken, token, cartId});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("should update payments from a cart", () => {
|
|
92
|
+
const cartId = "someCartId";
|
|
93
|
+
const financingCost = {_id: "123"};
|
|
94
|
+
axiosMock.onPost(`/carts/${cartId}/financing-costs`).reply(expectRequest({statusCode: 204, token, jwtToken}));
|
|
95
|
+
return api.sales.cart.financingCosts.create({jwtToken, token, cartId, financingCost});
|
|
96
|
+
});
|
|
84
97
|
});
|
package/types/client.d.ts
CHANGED
|
@@ -2783,6 +2783,21 @@ export function createApiClient(options: {
|
|
|
2783
2783
|
data?: {};
|
|
2784
2784
|
}): any;
|
|
2785
2785
|
};
|
|
2786
|
+
financingCosts: {
|
|
2787
|
+
create({ token, jwtToken, headers, cartId, financingCost }: {
|
|
2788
|
+
token: any;
|
|
2789
|
+
jwtToken: any;
|
|
2790
|
+
headers: any;
|
|
2791
|
+
cartId: any;
|
|
2792
|
+
financingCost: any;
|
|
2793
|
+
}): any;
|
|
2794
|
+
delete({ token, jwtToken, headers, cartId }: {
|
|
2795
|
+
token: any;
|
|
2796
|
+
jwtToken: any;
|
|
2797
|
+
headers: any;
|
|
2798
|
+
cartId: any;
|
|
2799
|
+
}): any;
|
|
2800
|
+
};
|
|
2786
2801
|
};
|
|
2787
2802
|
giftCertificates: {
|
|
2788
2803
|
get: ({ token, GCNumber, query, headers }: {
|
|
@@ -77,4 +77,19 @@ declare function cartFactory({ client, internalAuthTokenProvider }: {
|
|
|
77
77
|
data?: {};
|
|
78
78
|
}): any;
|
|
79
79
|
};
|
|
80
|
+
financingCosts: {
|
|
81
|
+
create({ token, jwtToken, headers, cartId, financingCost }: {
|
|
82
|
+
token: any;
|
|
83
|
+
jwtToken: any;
|
|
84
|
+
headers: any;
|
|
85
|
+
cartId: any;
|
|
86
|
+
financingCost: any;
|
|
87
|
+
}): any;
|
|
88
|
+
delete({ token, jwtToken, headers, cartId }: {
|
|
89
|
+
token: any;
|
|
90
|
+
jwtToken: any;
|
|
91
|
+
headers: any;
|
|
92
|
+
cartId: any;
|
|
93
|
+
}): any;
|
|
94
|
+
};
|
|
80
95
|
};
|
|
@@ -2737,6 +2737,21 @@ declare const _exports: {
|
|
|
2737
2737
|
data?: {};
|
|
2738
2738
|
}): any;
|
|
2739
2739
|
};
|
|
2740
|
+
financingCosts: {
|
|
2741
|
+
create({ token, jwtToken, headers, cartId, financingCost }: {
|
|
2742
|
+
token: any;
|
|
2743
|
+
jwtToken: any;
|
|
2744
|
+
headers: any;
|
|
2745
|
+
cartId: any;
|
|
2746
|
+
financingCost: any;
|
|
2747
|
+
}): any;
|
|
2748
|
+
delete({ token, jwtToken, headers, cartId }: {
|
|
2749
|
+
token: any;
|
|
2750
|
+
jwtToken: any;
|
|
2751
|
+
headers: any;
|
|
2752
|
+
cartId: any;
|
|
2753
|
+
}): any;
|
|
2754
|
+
};
|
|
2740
2755
|
};
|
|
2741
2756
|
giftCertificates: {
|
|
2742
2757
|
get: ({ token, GCNumber, query, headers }: {
|