@betterstore/sdk 0.3.6 → 0.3.8
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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -167,7 +167,7 @@ declare class Client {
|
|
|
167
167
|
/**
|
|
168
168
|
* Retrieve a checkout session by ID
|
|
169
169
|
*/
|
|
170
|
-
retrieveCheckout(checkoutId: string): Promise<CheckoutSession>;
|
|
170
|
+
retrieveCheckout(clientSecret: string, checkoutId: string): Promise<CheckoutSession>;
|
|
171
171
|
/**
|
|
172
172
|
* Update a checkout session
|
|
173
173
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -167,7 +167,7 @@ declare class Client {
|
|
|
167
167
|
/**
|
|
168
168
|
* Retrieve a checkout session by ID
|
|
169
169
|
*/
|
|
170
|
-
retrieveCheckout(checkoutId: string): Promise<CheckoutSession>;
|
|
170
|
+
retrieveCheckout(clientSecret: string, checkoutId: string): Promise<CheckoutSession>;
|
|
171
171
|
/**
|
|
172
172
|
* Update a checkout session
|
|
173
173
|
*/
|
package/dist/index.js
CHANGED
|
@@ -173,9 +173,9 @@ var Client = class {
|
|
|
173
173
|
/**
|
|
174
174
|
* Retrieve a checkout session by ID
|
|
175
175
|
*/
|
|
176
|
-
retrieveCheckout(checkoutId) {
|
|
176
|
+
retrieveCheckout(clientSecret, checkoutId) {
|
|
177
177
|
return __async(this, null, function* () {
|
|
178
|
-
const apiClient = createApiClient(
|
|
178
|
+
const apiClient = createApiClient(clientSecret, this.proxy);
|
|
179
179
|
const data = yield apiClient.get(
|
|
180
180
|
`/checkout/${checkoutId}`
|
|
181
181
|
);
|
|
@@ -268,7 +268,7 @@ var Customer = class {
|
|
|
268
268
|
*/
|
|
269
269
|
create(params) {
|
|
270
270
|
return __async(this, null, function* () {
|
|
271
|
-
const data = yield this.apiClient.post("/
|
|
271
|
+
const data = yield this.apiClient.post("/customer", params);
|
|
272
272
|
return data;
|
|
273
273
|
});
|
|
274
274
|
}
|
|
@@ -278,7 +278,7 @@ var Customer = class {
|
|
|
278
278
|
retrieve(idOrEmail) {
|
|
279
279
|
return __async(this, null, function* () {
|
|
280
280
|
const data = yield this.apiClient.get(
|
|
281
|
-
`/
|
|
281
|
+
`/customer/${idOrEmail}`
|
|
282
282
|
);
|
|
283
283
|
if (!data) {
|
|
284
284
|
throw new Error("Customer not found");
|
|
@@ -292,7 +292,7 @@ var Customer = class {
|
|
|
292
292
|
update(customerId, params) {
|
|
293
293
|
return __async(this, null, function* () {
|
|
294
294
|
const data = yield this.apiClient.put(
|
|
295
|
-
`/
|
|
295
|
+
`/customer/${customerId}`,
|
|
296
296
|
params
|
|
297
297
|
);
|
|
298
298
|
return data;
|
|
@@ -303,7 +303,7 @@ var Customer = class {
|
|
|
303
303
|
*/
|
|
304
304
|
delete(customerId) {
|
|
305
305
|
return __async(this, null, function* () {
|
|
306
|
-
yield this.apiClient.delete(`/
|
|
306
|
+
yield this.apiClient.delete(`/customer/${customerId}`);
|
|
307
307
|
});
|
|
308
308
|
}
|
|
309
309
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -136,9 +136,9 @@ var Client = class {
|
|
|
136
136
|
/**
|
|
137
137
|
* Retrieve a checkout session by ID
|
|
138
138
|
*/
|
|
139
|
-
retrieveCheckout(checkoutId) {
|
|
139
|
+
retrieveCheckout(clientSecret, checkoutId) {
|
|
140
140
|
return __async(this, null, function* () {
|
|
141
|
-
const apiClient = createApiClient(
|
|
141
|
+
const apiClient = createApiClient(clientSecret, this.proxy);
|
|
142
142
|
const data = yield apiClient.get(
|
|
143
143
|
`/checkout/${checkoutId}`
|
|
144
144
|
);
|
|
@@ -231,7 +231,7 @@ var Customer = class {
|
|
|
231
231
|
*/
|
|
232
232
|
create(params) {
|
|
233
233
|
return __async(this, null, function* () {
|
|
234
|
-
const data = yield this.apiClient.post("/
|
|
234
|
+
const data = yield this.apiClient.post("/customer", params);
|
|
235
235
|
return data;
|
|
236
236
|
});
|
|
237
237
|
}
|
|
@@ -241,7 +241,7 @@ var Customer = class {
|
|
|
241
241
|
retrieve(idOrEmail) {
|
|
242
242
|
return __async(this, null, function* () {
|
|
243
243
|
const data = yield this.apiClient.get(
|
|
244
|
-
`/
|
|
244
|
+
`/customer/${idOrEmail}`
|
|
245
245
|
);
|
|
246
246
|
if (!data) {
|
|
247
247
|
throw new Error("Customer not found");
|
|
@@ -255,7 +255,7 @@ var Customer = class {
|
|
|
255
255
|
update(customerId, params) {
|
|
256
256
|
return __async(this, null, function* () {
|
|
257
257
|
const data = yield this.apiClient.put(
|
|
258
|
-
`/
|
|
258
|
+
`/customer/${customerId}`,
|
|
259
259
|
params
|
|
260
260
|
);
|
|
261
261
|
return data;
|
|
@@ -266,7 +266,7 @@ var Customer = class {
|
|
|
266
266
|
*/
|
|
267
267
|
delete(customerId) {
|
|
268
268
|
return __async(this, null, function* () {
|
|
269
|
-
yield this.apiClient.delete(`/
|
|
269
|
+
yield this.apiClient.delete(`/customer/${customerId}`);
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
272
|
};
|