chargebee 2.8.0 → 2.10.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/CHANGELOG.md CHANGED
@@ -1,3 +1,83 @@
1
+ ### v2.10.0 (2022-03-08)
2
+ * * *
3
+
4
+ ### Fixes:
5
+ * Fixed metadata for Product Catalog V2 resources, item and item_price.
6
+
7
+ #### New attributes:
8
+ * upi, mandates and their subresources have been added to the payment_source resource.
9
+
10
+ #### New Input parameters:
11
+ * bank_account[phone] have been added to customers#create_bank_account
12
+ * payment_intent[payment_method_type] have been added to customers#create_payment_intent, customers#collect_payment_intent
13
+ * payment_intent[payment_method_type] have been added to estimate#gift_subscription and estimate#gift_subscription_for_items.
14
+ * payment_intent[payment_method_type] have been added to gift#create_payment_intent and gift#create_gift_for_items_payment_intent.
15
+ * customer[is_einvoice_enabled], customer[entity_identifier_scheme], customer[entity_identifier_standard], entity_identifiers[id], entity_identifiers[scheme], entity_identifiers[value], entity_identifiers[operation], entity_identifiers[standard] have been added to hosted_page#checkout_onetime_for_items, hosted_page#checkout_new_for_items and hosted_page#checkout_existing_for_items.
16
+ * bank_account[phone] have been added to invoice#create_bank_account, invoice#create_bank_account_for_chargeitems_and_charges
17
+ * payment_intent[payment_method_type] have been added to invoice#create_payment_intent, invoice#create_payment_intent_for_chargeitems_and_charges
18
+ * bank_account[phone] have been added to payment_source#create_bank_account
19
+ * payment_intent[payment_method_type] have been added to payment_source#create_using_payment_intent
20
+ * subscription_id have been added to payment_source#list_payment_source
21
+ * bank_account[phone] have been added to subscription#create_bank_account
22
+ * payment_intent[payment_method_type] have been added to subscription#create_payment_intent, subscription#create_payment_intent_for_customer, subscription#create_payment_intent_with_items, subscription#update_payment_intent, subscription#update_payment_intent_for_items, subscription#reactivate_payment_intent, subscription#resume_payment_intent
23
+ * activated_at have been added to subscription#import_subscription, subscription#import_subscription_for_customer, subscription#import_subscription_for_items
24
+
25
+ #### New Enum values:
26
+ * upi, netbanking_emandates enum has been added in customer_payment_method_type subresource of customer resource
27
+ * current enum has been added in account_type.
28
+ * quickbooks, razorpay enum has been added in gateway.
29
+ * upi, netbanking_emandates enum has been added in payment_method,payment_method_type, type
30
+ * upi, netbanking_emandates, apple_pay enum has been added in payment_method_type subresource of payment_intent resource
31
+ * current enum has been added in bank_account_type subresource of payment_source.
32
+
33
+ #### Deprecated attributes:
34
+ * coupon attribute have been added and deprecated in hosted_page resource.
35
+
36
+ #### Deprecated enums:
37
+ * NetdPaymentDueReminder have been deprecated in event_type.
38
+
39
+
40
+ ### v2.9.0 (2022-01-21)
41
+ * * *
42
+
43
+ #### New endpoints:
44
+ * credit_notes#download_einvoice has been added to the credit_notes resource.
45
+ * invoice#download_einvoice has been added to the invoice resource.
46
+
47
+ #### New attributes:
48
+ * is_einvoice_enabled, entity_identifier_scheme, entity_identifier_standard and entity_identifiers[] have been added to the customer resource.
49
+ * einvoice has been added to the invoice resource.
50
+ * einvoice has been added to the credit_notes resource.
51
+ * mime_type has been added to the download resource.
52
+
53
+ #### New Input parameters:
54
+ * entity_identifier_scheme, entity_identifier_standard, is_einvoice_enabled, entity_identifiers[id][0..N], entity_identifiers[scheme][0..N], entity_identifiers[value][0..N], entity_identifiers[standard][0..N] have been added to customers#create_a_customer, customers#update_billing_info_for_a_customer apis.
55
+ * customer[entity_identifier_scheme], customer[entity_identifier_standard], customer[is_einvoice_enabled], entity_identifiers[id][0..N], entity_identifiers[scheme][0..N], entity_identifiers[value][0..N], entity_identifiers[standard][0..N] have been added to the subscriptions#create_a_subscription api.
56
+ * customer[entity_identifier_scheme], customer[entity_identifier_standard], customer[is_einvoice_enabled] have been added to subscriptions#update_a_subscription and subscriptions#update_subscription_for_items apis.
57
+
58
+ #### New Enum values:
59
+ * operation enum has been added.
60
+ * status enum has been added in credit_notes_einvoice subresource of credit_notes resource.
61
+
62
+ #### Deprecated attributes:
63
+ * user, type, payment_method and exchange_rate have been deprecated from TaxWithHeld resource.
64
+
65
+ #### Deprecated enums:
66
+ * type and payment_method have been deprecated in TaxWithHeld resource.
67
+
68
+ #### Updated parameters:
69
+ * hierarchy_operation_type has been made mandatory in customers#get_hierarchy api.
70
+
71
+ #### Removed Filter parameters:
72
+ * create_pending_invoices has been removed from subscriptions#list_subscriptions api.
73
+
74
+
75
+ ### v2.8.1 (2022-01-05)
76
+ * * *
77
+
78
+ ### Fixes:
79
+ * Improved error message for Invalid JSON response.
80
+
1
81
  ### v2.8.0 (2021-12-08)
2
82
  * * *
3
83
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2011-2021 ChargeBee, Inc.
3
+ Copyright (c) 2011-2022 ChargeBee, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person
6
6
  obtaining a copy of this software and associated documentation
package/lib/chargebee.js CHANGED
@@ -8,7 +8,7 @@ ChargeBee._env = {
8
8
  hostSuffix: '.chargebee.com',
9
9
  apiPath: '/api/v2',
10
10
  timeout: 80000,
11
- clientVersion: 'v2.8.0',
11
+ clientVersion: 'v2.10.0',
12
12
  port: 443,
13
13
  timemachineWaitInMillis: 3000,
14
14
  exportWaitInMillis: 3000
@@ -191,7 +191,36 @@ ChargeBee._core = (function() {
191
191
  try {
192
192
  response = JSON.parse(response);
193
193
  } catch (e) {
194
- throwError(callBack,'client_error', 500, 'invalid_json', 'invalid json in response. Probably not a ChargeBee response', e);
194
+ if (response.includes('503')) {
195
+ return throwError(
196
+ callBack,
197
+ 'internal_temporary_error',
198
+ 503,
199
+ 'internal_temporary_error',
200
+ 'Sorry, the server is currently unable to handle the request due to a temporary overload or scheduled maintenance. Please retry after sometime.',
201
+ e
202
+ );
203
+ }
204
+ else if(response.includes('504')) {
205
+ return throwError(
206
+ callBack,
207
+ 'gateway_timeout',
208
+ 504,
209
+ 'gateway_timeout',
210
+ 'The server did not receive a timely response from an upstream server, request aborted. If this problem persists, contact us at support@chargebee.com.',
211
+ e
212
+ );
213
+ }
214
+ else {
215
+ return throwError(
216
+ callBack,
217
+ 'internal_error',
218
+ 500,
219
+ 'internal_error',
220
+ 'Sorry, something went wrong when trying to process the request. If this problem persists, contact us at support@chargebee.com.',
221
+ e
222
+ );
223
+ }
195
224
  }
196
225
  if (res.statusCode < 200 || res.statusCode > 299) {
197
226
  response.http_status_code = res.statusCode;
@@ -299,7 +328,7 @@ ChargeBee._core = (function() {
299
328
  }
300
329
  }
301
330
  }
302
- } else if(key === "meta_data") {
331
+ } else if(["meta_data", "metadata"].indexOf(key) !== -1) {
303
332
  var attrVal="";
304
333
  if(value !== null) {
305
334
  attrVal = encodeURIComponent(Object.prototype.toString.call(value) === "[object String]" ? ChargeBee._util.trim(value) : JSON.stringify(value));
@@ -746,6 +746,13 @@ var _endpoints = {
746
746
  "/pdf",
747
747
  true
748
748
  ],
749
+ [
750
+ "download_einvoice",
751
+ "GET",
752
+ "/invoices",
753
+ "/download_einvoice",
754
+ true
755
+ ],
749
756
  [
750
757
  "add_charge",
751
758
  "POST",
@@ -868,6 +875,13 @@ var _endpoints = {
868
875
  "/pdf",
869
876
  true
870
877
  ],
878
+ [
879
+ "download_einvoice",
880
+ "GET",
881
+ "/credit_notes",
882
+ "/download_einvoice",
883
+ true
884
+ ],
871
885
  [
872
886
  "refund",
873
887
  "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"chargebee",
3
- "version":"2.8.0",
3
+ "version":"2.10.0",
4
4
  "description":"A library for integrating with ChargeBee.",
5
5
  "keywords":[
6
6
  "payments",