btrz-api-client 5.184.0 → 5.185.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.
@@ -126,17 +126,31 @@ function cartFactory(_ref) {
126
126
  method: "delete",
127
127
  headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
128
128
  });
129
- }
130
- };
131
-
132
- var taxExemptPaymentMethod = {
133
- post: function post(_ref10) {
129
+ },
130
+ put: function put(_ref10) {
134
131
  var token = _ref10.token,
135
132
  cartId = _ref10.cartId,
136
133
  jwtToken = _ref10.jwtToken,
137
134
  headers = _ref10.headers,
138
- _ref10$data = _ref10.data,
139
- data = _ref10$data === undefined ? {} : _ref10$data;
135
+ payment = _ref10.payment;
136
+
137
+ return client({
138
+ url: "/carts/" + cartId + "/payments",
139
+ method: "put",
140
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
141
+ data: payment
142
+ });
143
+ }
144
+ };
145
+
146
+ var taxExemptPaymentMethod = {
147
+ post: function post(_ref11) {
148
+ var token = _ref11.token,
149
+ cartId = _ref11.cartId,
150
+ jwtToken = _ref11.jwtToken,
151
+ headers = _ref11.headers,
152
+ _ref11$data = _ref11.data,
153
+ data = _ref11$data === undefined ? {} : _ref11$data;
140
154
 
141
155
  return client({
142
156
  url: "/carts/" + cartId + "/tax-exempt-payment-method",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "5.184.0",
3
+ "version": "5.185.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -76,6 +76,14 @@ function cartFactory({client, internalAuthTokenProvider}) {
76
76
  method: "delete",
77
77
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
78
78
  });
79
+ },
80
+ put({token, cartId, jwtToken, headers, payment}) {
81
+ return client({
82
+ url: `/carts/${cartId}/payments`,
83
+ method: "put",
84
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
85
+ data: payment
86
+ });
79
87
  }
80
88
  };
81
89
 
@@ -88,7 +96,7 @@ function cartFactory({client, internalAuthTokenProvider}) {
88
96
  data
89
97
  });
90
98
  }
91
- }
99
+ };
92
100
 
93
101
  return {
94
102
  get,
@@ -70,6 +70,12 @@ describe("sales/cart", () => {
70
70
  return api.sales.cart.payments.delete({jwtToken, token, cartId});
71
71
  });
72
72
 
73
+ it("should update payments from a cart", () => {
74
+ const cartId = "someCartId";
75
+ axiosMock.onPut(`/carts/${cartId}/payments`).reply(expectRequest({statusCode: 204, token, jwtToken}));
76
+ return api.sales.cart.payments.put({jwtToken, token, cartId});
77
+ });
78
+
73
79
  it("should post a mount with tax exempt from the payment method", () => {
74
80
  const cartId = "thisCartId";
75
81
  axiosMock.onPost(`/carts/${cartId}/tax-exempt-payment-method`).reply(expectRequest({statusCode: 200, token, jwtToken}));
package/types/client.d.ts CHANGED
@@ -2657,6 +2657,13 @@ export function createApiClient(options: {
2657
2657
  jwtToken: any;
2658
2658
  headers: any;
2659
2659
  }): any;
2660
+ put({ token, cartId, jwtToken, headers, payment }: {
2661
+ token: any;
2662
+ cartId: any;
2663
+ jwtToken: any;
2664
+ headers: any;
2665
+ payment: any;
2666
+ }): any;
2660
2667
  };
2661
2668
  taxExemptPaymentMethod: {
2662
2669
  post({ token, cartId, jwtToken, headers, data }: {
@@ -60,6 +60,13 @@ declare function cartFactory({ client, internalAuthTokenProvider }: {
60
60
  jwtToken: any;
61
61
  headers: any;
62
62
  }): any;
63
+ put({ token, cartId, jwtToken, headers, payment }: {
64
+ token: any;
65
+ cartId: any;
66
+ jwtToken: any;
67
+ headers: any;
68
+ payment: any;
69
+ }): any;
63
70
  };
64
71
  taxExemptPaymentMethod: {
65
72
  post({ token, cartId, jwtToken, headers, data }: {
@@ -2611,6 +2611,13 @@ declare const _exports: {
2611
2611
  jwtToken: any;
2612
2612
  headers: any;
2613
2613
  }): any;
2614
+ put({ token, cartId, jwtToken, headers, payment }: {
2615
+ token: any;
2616
+ cartId: any;
2617
+ jwtToken: any;
2618
+ headers: any;
2619
+ payment: any;
2620
+ }): any;
2614
2621
  };
2615
2622
  taxExemptPaymentMethod: {
2616
2623
  post({ token, cartId, jwtToken, headers, data }: {