chargebee 2.22.3 → 2.23.1
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 +33 -0
- package/README.md +18 -0
- package/lib/chargebee.js +8 -1
- package/lib/resources/api_endpoints.js +44 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
### v2.23.1 (2023-06-08)
|
|
2
|
+
* * *
|
|
3
|
+
|
|
4
|
+
#### New Feature:
|
|
5
|
+
* Added utiltity to retrieve the response headers and isIdempotencyReplayed key through response object.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### v2.23.0 (2023-05-31)
|
|
9
|
+
* * *
|
|
10
|
+
|
|
11
|
+
#### New endpoints:
|
|
12
|
+
* PaymentSource#CreateVoucherPaymentSource has been added to the PaymentSource resource.
|
|
13
|
+
* EventsRequest#HostedPage has been added to the PaymentSource resource.
|
|
14
|
+
|
|
15
|
+
#### New Resource:
|
|
16
|
+
* PaymentVoucher has been added.
|
|
17
|
+
|
|
18
|
+
#### New attributes:
|
|
19
|
+
* boleto and billing_address has been added to the PaymentSource resource.
|
|
20
|
+
* product_id has been added to the ItemPrice resource.
|
|
21
|
+
|
|
22
|
+
#### New Enum Class:
|
|
23
|
+
* EventNameEnum has been added.
|
|
24
|
+
* PaymentVoucherTypeEnum has been added.
|
|
25
|
+
* VoucherTypeEnum has been added.
|
|
26
|
+
|
|
27
|
+
#### New Enum values:
|
|
28
|
+
* product and variant has been added to EntityType enum.
|
|
29
|
+
* product_created, product_updated, product_deleted, variant_created, variant_updated and variant_deleted enums have been added in EventType enum.
|
|
30
|
+
* voucher_created, voucher_expired and voucher_create_failed have been added in EventType enum.
|
|
31
|
+
* boleto has been added in PaymentMethod and OfflinePaymentMethod and PaymentMethodTypeEnum#PaymentIntent.
|
|
32
|
+
|
|
33
|
+
|
|
1
34
|
### v2.22.0 (2023-05-16)
|
|
2
35
|
* * *
|
|
3
36
|
|
package/README.md
CHANGED
|
@@ -188,6 +188,24 @@ const result = await chargebee.customer
|
|
|
188
188
|
.setIdempotencyKey("safeKey")
|
|
189
189
|
.request();
|
|
190
190
|
const customer = result.customer;
|
|
191
|
+
const headers = result.headers;
|
|
192
|
+
const isIdempotencyReplayed = result.isIdempotencyReplayed;
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
OR
|
|
196
|
+
|
|
197
|
+
```js
|
|
198
|
+
chargebee.customer.create({ email: 'john@test.com', cf_host_url: 'http://xyz.com' })
|
|
199
|
+
.setIdempotencyKey("safeKey")
|
|
200
|
+
.request(function(error,result) {
|
|
201
|
+
if(error){
|
|
202
|
+
//handle error
|
|
203
|
+
}else{
|
|
204
|
+
const customer = result.customer;
|
|
205
|
+
const headers = result.headers;
|
|
206
|
+
const isIdempotencyReplayed = result.isIdempotencyReplayed;
|
|
207
|
+
}
|
|
208
|
+
});
|
|
191
209
|
```
|
|
192
210
|
|
|
193
211
|
### Processing Webhooks - API Version Check
|
package/lib/chargebee.js
CHANGED
|
@@ -4,13 +4,14 @@ var Q = require("q");
|
|
|
4
4
|
var os = require("os");
|
|
5
5
|
var Buffer = require("safer-buffer").Buffer;
|
|
6
6
|
const IDEMPOTENCY_HEADER = "chargebee-idempotency-key";
|
|
7
|
+
const IDEMPOTENCY_REPLAYED_HEADER = 'chargebee-idempotency-replayed';
|
|
7
8
|
|
|
8
9
|
ChargeBee._env = {
|
|
9
10
|
protocol: 'https',
|
|
10
11
|
hostSuffix: '.chargebee.com',
|
|
11
12
|
apiPath: '/api/v2',
|
|
12
13
|
timeout: 80000,
|
|
13
|
-
clientVersion: 'v2.
|
|
14
|
+
clientVersion: 'v2.23.1',
|
|
14
15
|
port: 443,
|
|
15
16
|
timemachineWaitInMillis: 3000,
|
|
16
17
|
exportWaitInMillis: 3000
|
|
@@ -235,6 +236,12 @@ ChargeBee._core = (function() {
|
|
|
235
236
|
response.http_status_code = res.statusCode;
|
|
236
237
|
callBack(response, null);
|
|
237
238
|
} else {
|
|
239
|
+
response.isIdempotencyReplayed = false;
|
|
240
|
+
if (ChargeBee._util.isNotUndefinedNEmpty(res.headers[IDEMPOTENCY_REPLAYED_HEADER])) {
|
|
241
|
+
response.isIdempotencyReplayed = res.headers[IDEMPOTENCY_REPLAYED_HEADER];
|
|
242
|
+
}
|
|
243
|
+
response.headers = res.headers;
|
|
244
|
+
|
|
238
245
|
callBack(null, response);
|
|
239
246
|
}
|
|
240
247
|
});
|
|
@@ -465,6 +465,13 @@ var _endpoints = {
|
|
|
465
465
|
"/create_using_payment_intent",
|
|
466
466
|
false
|
|
467
467
|
],
|
|
468
|
+
[
|
|
469
|
+
"create_voucher_payment_source",
|
|
470
|
+
"POST",
|
|
471
|
+
"/payment_sources",
|
|
472
|
+
"/create_voucher_payment_source",
|
|
473
|
+
false
|
|
474
|
+
],
|
|
468
475
|
[
|
|
469
476
|
"create_card",
|
|
470
477
|
"POST",
|
|
@@ -1403,6 +1410,13 @@ var _endpoints = {
|
|
|
1403
1410
|
"/hosted_pages",
|
|
1404
1411
|
"/pre_cancel",
|
|
1405
1412
|
false
|
|
1413
|
+
],
|
|
1414
|
+
[
|
|
1415
|
+
"events",
|
|
1416
|
+
"POST",
|
|
1417
|
+
"/hosted_pages",
|
|
1418
|
+
"/events",
|
|
1419
|
+
false
|
|
1406
1420
|
]
|
|
1407
1421
|
],
|
|
1408
1422
|
"estimate": [
|
|
@@ -2618,6 +2632,35 @@ var _endpoints = {
|
|
|
2618
2632
|
false
|
|
2619
2633
|
]
|
|
2620
2634
|
],
|
|
2621
|
-
"
|
|
2635
|
+
"payment_voucher": [
|
|
2636
|
+
[
|
|
2637
|
+
"create",
|
|
2638
|
+
"POST",
|
|
2639
|
+
"/payment_vouchers",
|
|
2640
|
+
null,
|
|
2641
|
+
false
|
|
2642
|
+
],
|
|
2643
|
+
[
|
|
2644
|
+
"retrieve",
|
|
2645
|
+
"GET",
|
|
2646
|
+
"/payment_vouchers",
|
|
2647
|
+
null,
|
|
2648
|
+
true
|
|
2649
|
+
],
|
|
2650
|
+
[
|
|
2651
|
+
"payment_vouchers_for_invoice",
|
|
2652
|
+
"GET",
|
|
2653
|
+
"/invoices",
|
|
2654
|
+
"/payment_vouchers",
|
|
2655
|
+
true
|
|
2656
|
+
],
|
|
2657
|
+
[
|
|
2658
|
+
"payment_vouchers_for_customer",
|
|
2659
|
+
"GET",
|
|
2660
|
+
"/customers",
|
|
2661
|
+
"/payment_vouchers",
|
|
2662
|
+
true
|
|
2663
|
+
]
|
|
2664
|
+
]
|
|
2622
2665
|
};
|
|
2623
2666
|
module.exports = _endpoints;
|