chargebee 2.41.0 → 3.0.0-beta.2

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.
Files changed (118) hide show
  1. package/CHANGELOG.md +11 -15
  2. package/LICENSE +1 -1
  3. package/README.md +90 -170
  4. package/cjs/RequestWrapper.js +84 -0
  5. package/cjs/asyncApiSupport.js +39 -0
  6. package/cjs/chargebee.cjs.js +13 -0
  7. package/cjs/chargebee.cjs.worker.js +9 -0
  8. package/cjs/chargebeeError.js +17 -0
  9. package/cjs/coreCommon.js +72 -0
  10. package/cjs/createChargebee.js +92 -0
  11. package/cjs/environment.js +18 -0
  12. package/cjs/filter.js +1 -0
  13. package/cjs/net/ClientInterface.js +40 -0
  14. package/cjs/net/FetchClient.js +86 -0
  15. package/cjs/net/NodeClient.js +61 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/resources/api_endpoints.js +1086 -0
  18. package/cjs/util.js +218 -0
  19. package/esm/RequestWrapper.js +80 -0
  20. package/esm/asyncApiSupport.js +35 -0
  21. package/esm/chargebee.esm.js +9 -0
  22. package/esm/chargebee.esm.worker.js +5 -0
  23. package/esm/chargebeeError.js +13 -0
  24. package/esm/coreCommon.js +67 -0
  25. package/esm/createChargebee.js +88 -0
  26. package/esm/environment.js +15 -0
  27. package/esm/filter.js +1 -0
  28. package/esm/net/ClientInterface.js +35 -0
  29. package/esm/net/FetchClient.js +81 -0
  30. package/esm/net/NodeClient.js +56 -0
  31. package/esm/package.json +1 -0
  32. package/esm/resources/api_endpoints.js +1083 -0
  33. package/esm/util.js +202 -0
  34. package/package.json +69 -38
  35. package/types/core.d.ts +558 -89
  36. package/types/index.d.ts +90 -55
  37. package/types/resources/Address.d.ts +57 -272
  38. package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
  39. package/types/resources/AttachedItem.d.ts +91 -329
  40. package/types/resources/Attribute.d.ts +5 -5
  41. package/types/resources/BusinessEntity.d.ts +49 -69
  42. package/types/resources/BusinessEntityTransfer.d.ts +11 -17
  43. package/types/resources/Card.d.ts +146 -424
  44. package/types/resources/Comment.d.ts +72 -189
  45. package/types/resources/Contact.d.ts +12 -64
  46. package/types/resources/ContractTerm.d.ts +15 -96
  47. package/types/resources/Coupon.d.ts +282 -758
  48. package/types/resources/CouponCode.d.ts +56 -52
  49. package/types/resources/CouponSet.d.ts +92 -234
  50. package/types/resources/CreditNote.d.ts +588 -1758
  51. package/types/resources/CreditNoteEstimate.d.ts +131 -157
  52. package/types/resources/Currency.d.ts +75 -62
  53. package/types/resources/Customer.d.ts +892 -835
  54. package/types/resources/CustomerEntitlement.d.ts +24 -35
  55. package/types/resources/DifferentialPrice.d.ts +116 -314
  56. package/types/resources/Discount.d.ts +20 -125
  57. package/types/resources/Download.d.ts +6 -22
  58. package/types/resources/Entitlement.d.ts +51 -160
  59. package/types/resources/EntitlementOverride.d.ts +58 -139
  60. package/types/resources/Estimate.d.ts +1178 -527
  61. package/types/resources/Event.d.ts +67 -178
  62. package/types/resources/Export.d.ts +563 -723
  63. package/types/resources/Feature.d.ts +117 -433
  64. package/types/resources/GatewayErrorDetail.d.ts +16 -72
  65. package/types/resources/Gift.d.ts +265 -432
  66. package/types/resources/Hierarchy.d.ts +8 -36
  67. package/types/resources/HostedPage.d.ts +1017 -1153
  68. package/types/resources/ImpactedItem.d.ts +13 -50
  69. package/types/resources/ImpactedItemPrice.d.ts +13 -15
  70. package/types/resources/ImpactedSubscription.d.ts +13 -45
  71. package/types/resources/InAppSubscription.d.ts +93 -389
  72. package/types/resources/Installment.d.ts +35 -110
  73. package/types/resources/InstallmentConfig.d.ts +54 -155
  74. package/types/resources/InstallmentDetail.d.ts +19 -27
  75. package/types/resources/Invoice.d.ts +1574 -3157
  76. package/types/resources/InvoiceEstimate.d.ts +131 -161
  77. package/types/resources/Item.d.ts +133 -611
  78. package/types/resources/ItemEntitlement.d.ts +78 -215
  79. package/types/resources/ItemFamily.d.ts +69 -178
  80. package/types/resources/ItemPrice.d.ts +291 -1203
  81. package/types/resources/Metadata.d.ts +3 -5
  82. package/types/resources/Order.d.ts +538 -1471
  83. package/types/resources/PaymentIntent.d.ts +163 -347
  84. package/types/resources/PaymentReferenceNumber.d.ts +7 -29
  85. package/types/resources/PaymentSource.d.ts +476 -1272
  86. package/types/resources/PaymentVoucher.d.ts +87 -306
  87. package/types/resources/PortalSession.d.ts +71 -207
  88. package/types/resources/PriceVariant.d.ts +91 -279
  89. package/types/resources/PricingPageSession.d.ts +92 -41
  90. package/types/resources/PromotionalCredit.d.ts +90 -346
  91. package/types/resources/Purchase.d.ts +185 -315
  92. package/types/resources/Quote.d.ts +1406 -887
  93. package/types/resources/QuoteLineGroup.d.ts +125 -452
  94. package/types/resources/QuotedCharge.d.ts +45 -274
  95. package/types/resources/QuotedSubscription.d.ts +100 -488
  96. package/types/resources/Ramp.d.ts +230 -747
  97. package/types/resources/ResourceMigration.d.ts +25 -80
  98. package/types/resources/SiteMigrationDetail.d.ts +34 -112
  99. package/types/resources/Subscription.d.ts +2390 -4336
  100. package/types/resources/SubscriptionEntitlement.d.ts +59 -160
  101. package/types/resources/SubscriptionEstimate.d.ts +51 -75
  102. package/types/resources/TaxWithheld.d.ts +15 -40
  103. package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
  104. package/types/resources/TimeMachine.d.ts +43 -97
  105. package/types/resources/Token.d.ts +15 -85
  106. package/types/resources/Transaction.d.ts +276 -911
  107. package/types/resources/UnbilledCharge.d.ts +189 -164
  108. package/types/resources/Usage.d.ts +89 -279
  109. package/types/resources/VirtualBankAccount.d.ts +103 -255
  110. package/types/resources/filter.d.ts +52 -0
  111. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
  112. package/.github/ISSUE_TEMPLATE/config.yml +0 -6
  113. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
  114. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  115. package/lib/chargebee.js +0 -512
  116. package/lib/resources/api_endpoints.js +0 -2935
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,326 +1,107 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
2
4
  declare module 'chargebee' {
3
5
  export interface PaymentVoucher {
4
-
5
- /**
6
- * @description Uniquely identifies the payment voucher.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description The id with which this voucher is referred in gateway.
14
-
15
- */
16
-
17
- id_at_gateway?:string;
18
-
19
- /**
20
- * @description Type of the payment source. \* boleto - Boleto
21
-
22
- */
23
-
24
- payment_voucher_type:PaymentVoucherType;
25
-
26
- /**
27
- * @description Timestamp indicating when the Voucher will expire if left unconsumed.
28
-
29
- */
30
-
31
- expires_at?:number;
32
-
33
- /**
34
- * @description Current status of the payment voucher. \* consumed - Consumed for a transaction and cannot be used again \* expired - Expired before consumed and cannot be used again \* active - Active and ready to be consumed \* failure - Failed to create the voucher due to gateway rejection
35
-
36
- */
37
-
38
- status?:'consumed' | 'expired' | 'failure' | 'active';
39
-
40
- /**
41
- * @description Identifier of the subscription for which this payment voucher is made.
42
-
43
- */
44
-
45
- subscription_id?:string;
46
-
47
- /**
48
- * @description The currency code (ISO 4217 format) for the voucher.
49
-
50
- */
51
-
52
- currency_code:string;
53
-
54
- /**
55
- * @description Amount for this payment voucher.
56
-
57
- */
58
-
59
- amount?:number;
60
-
61
- /**
62
- * @description The gateway account used for this voucher
63
-
64
- */
65
-
66
- gateway_account_id?:string;
67
-
68
- /**
69
- * @description Identifier of the payment source for which this payment voucher is created
70
-
71
- */
72
-
73
- payment_source_id?:string;
74
-
75
- /**
76
- * @description The gateway through which this payment voucher was created.
77
- **Note** : Note: Currently, &#x60;stripe&#x60; is the only supported gateway through which you can create the payment voucher. \* ecentric - Ecentric provides a seamless payment processing service in South Africa specializing on omnichannel capabilities. \* bluesnap - BlueSnap is a payment gateway. \* tco - 2Checkout is a payment gateway. \* first_data_global - First Data Global Gateway Virtual Terminal Account \* exact - Exact Payments is a payment gateway. \* bluepay - BluePay is a payment gateway. \* paypal_express_checkout - PayPal Express Checkout is a payment gateway. \* eway - eWAY Account is a payment gateway. \* metrics_global - Metrics global is a leading payment service provider providing unified payment services in the US. \* paypal_payflow_pro - PayPal Payflow Pro is a payment gateway. \* razorpay - Razorpay is a fast growing payment service provider in India working with all leading banks and support for major local payment methods including Netbanking, UPI etc. \* global_payments - Global Payments is a payment service provider. \* amazon_payments - Amazon Payments is a payment service provider. \* not_applicable - Indicates that payment gateway is not applicable for this resource. \* windcave - Windcave provides an end to end payment processing solution in ANZ and other leading global markets. \* checkout_com - Checkout.com is a payment gateway. \* adyen - Adyen is a payment gateway. \* braintree - Braintree is a payment gateway. \* nmi - NMI is a payment gateway. \* quickbooks - Intuit QuickBooks Payments gateway \* wepay - WePay is a payment gateway. \* worldpay - WorldPay is a payment gateway \* wirecard - WireCard Account is a payment service provider. \* chargebee_payments - Chargebee Payments gateway \* sage_pay - Sage Pay is a payment gateway. \* moneris_us - Moneris USA is a payment gateway. \* pin - Pin is a payment gateway \* authorize_net - Authorize.net is a payment gateway \* elavon - Elavon Virtual Merchant is a payment solution. \* paypal_pro - PayPal Pro Account is a payment gateway. \* orbital - Chase Paymentech(Orbital) is a payment gateway. \* paypal - PayPal Commerce is a payment gateway. \* beanstream - Bambora(formerly known as Beanstream) is a payment gateway. \* hdfc - HDFC Account is a payment gateway. \* ingenico_direct - Worldline Online Payments is a payment gateway. \* ogone - Ingenico ePayments (formerly known as Ogone) is a payment gateway. \* migs - MasterCard Internet Gateway Service payment gateway. \* stripe - Stripe is a payment gateway. \* vantiv - Vantiv is a payment gateway. \* moneris - Moneris is a payment gateway. \* bank_of_america - Bank of America Gateway \* chargebee - Chargebee test gateway. \* eway_rapid - eWAY Rapid is a payment gateway. \* gocardless - GoCardless is a payment service provider. \* mollie - Mollie is a payment gateway. \* paymill - PAYMILL is a payment gateway. \* balanced_payments - Balanced is a payment gateway \* cybersource - CyberSource is a payment gateway. \* ebanx - EBANX is a payment gateway, enabling businesses to accept diverse local payment methods from various countries for increased market reach and conversion.
78
-
79
- */
80
-
81
- gateway:Gateway;
82
-
83
- /**
84
- * @description Payload from the gateway response with voucher details
85
-
86
- */
87
-
88
- payload?:string;
89
-
90
- /**
91
- * @description Error code received from the payment gateway on failure.
92
-
93
- */
94
-
95
- error_code?:string;
96
-
97
- /**
98
- * @description Error message received from the payment gateway on failure.
99
-
100
- */
101
-
102
- error_text?:string;
103
-
104
- /**
105
- * @description Chargebee Hosted Page url for payment voucher
106
-
107
- */
108
-
109
- url?:string;
110
-
111
- /**
112
- * @description Indicates when this payment voucher occurred date.
113
-
114
- */
115
-
116
- date?:number;
117
-
118
- /**
119
- * @description Version number of this resource. The &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
120
-
121
- */
122
-
123
- resource_version?:number;
124
-
125
- /**
126
- * @description Timestamp indicating when this voucher was last updated.
127
-
128
- */
129
-
130
- updated_at?:number;
131
-
132
- /**
133
- * @description The unique identifier of the customer.
134
-
135
- */
136
-
137
- customer_id:string;
138
-
139
- /**
140
- * @description Invoices related to the generated voucher
141
-
142
- */
143
-
144
- linked_invoices?:PaymentVoucher.InvoicePaymentVoucher[];
6
+ id: string;
7
+ id_at_gateway?: string;
8
+ payment_voucher_type: PaymentVoucherType;
9
+ expires_at?: number;
10
+ status?: 'active' | 'consumed' | 'expired' | 'failure';
11
+ subscription_id?: string;
12
+ currency_code: string;
13
+ amount?: number;
14
+ gateway_account_id?: string;
15
+ payment_source_id?: string;
16
+ gateway: Gateway;
17
+ payload?: string;
18
+ error_code?: string;
19
+ error_text?: string;
20
+ url?: string;
21
+ date?: number;
22
+ resource_version?: number;
23
+ updated_at?: number;
24
+ customer_id: string;
25
+ linked_invoices?: PaymentVoucher.LinkedInvoice[];
145
26
  }
146
- export namespace PaymentVoucher {
147
- export class PaymentVoucherResource {
148
- /**
149
- * @description Creates a voucher type payment source. If you create this voucher type payment source using customer details, like tax ID, you can then generate a voucher with that payment source.
150
-
151
- */
152
-
153
- create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
154
-
155
- /**
156
- * @description Retrieves a voucher using the unique &#x60;payment_voucher_id&#x60;.
157
-
158
- */
159
-
160
- retrieve(payment_voucher_id:string):ChargebeeRequest<RetrieveResponse>;
161
-
162
- /**
163
- * @description Retrieves vouchers for an invoice in reverse chronological order.
164
27
 
165
- */
166
-
167
- payment_vouchers_for_invoice(invoice_id:string, input?:Payment_vouchersForInvoiceInputParam):ChargebeeRequest<Payment_vouchersForInvoiceResponse>;
168
-
169
- /**
170
- * @description Retrieves vouchers for a customer in reverse chronological order.
171
-
172
- */
173
-
174
- payment_vouchers_for_customer(customer_id:string, input?:Payment_vouchersForCustomerInputParam):ChargebeeRequest<Payment_vouchersForCustomerResponse>;
175
- }
176
- export interface CreateResponse {
177
- payment_voucher:PaymentVoucher;
28
+ export namespace PaymentVoucher {
29
+ export class PaymentVoucherResource {
30
+ create(
31
+ input: CreateInputParam,
32
+ headers?: ChargebeeRequestHeader,
33
+ ): Promise<ChargebeeResponse<CreateResponse>>;
34
+
35
+ retrieve(
36
+ payment_voucher_id: string,
37
+ headers?: ChargebeeRequestHeader,
38
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
39
+
40
+ payment_vouchersForInvoice(
41
+ invoice_id: string,
42
+ input?: PaymentVouchersForInvoiceInputParam,
43
+ headers?: ChargebeeRequestHeader,
44
+ ): Promise<ChargebeeResponse<Payment_vouchersForInvoiceResponse>>;
45
+
46
+ payment_vouchersForCustomer(
47
+ customer_id: string,
48
+ input?: PaymentVouchersForCustomerInputParam,
49
+ headers?: ChargebeeRequestHeader,
50
+ ): Promise<ChargebeeResponse<Payment_vouchersForCustomerResponse>>;
178
51
  }
179
- export interface CreateInputParam {
180
-
181
- /**
182
- * @description The unique identifier of the customer for whom you want to create the voucher.
183
-
184
- */
185
-
186
- customer_id:string;
187
-
188
- /**
189
- * @description The identifier of the payment source used for generating the voucher.
190
-
191
- */
192
-
193
- payment_source_id?:string;
194
-
195
- /**
196
- * @description Parameters for voucher_payment_source
197
52
 
198
- */
199
-
200
- voucher_payment_source:{voucher_type:VoucherType};
201
-
202
- /**
203
- * @description Parameters for &#x60;invoice_allocations&#x60;
204
-
205
- */
206
-
207
- invoice_allocations:{invoice_id:string}[];
208
- }
209
- export interface RetrieveResponse {
210
- payment_voucher:PaymentVoucher;
53
+ export interface CreateResponse {
54
+ payment_voucher: PaymentVoucher;
211
55
  }
212
-
213
- export interface Payment_vouchersForInvoiceResponse {
214
- /**
215
- * @description Retrieves vouchers for an invoice in reverse chronological order.
216
-
217
- */
218
-
219
- list:{payment_voucher:PaymentVoucher}[];
220
-
221
- /**
222
- * @description Retrieves vouchers for an invoice in reverse chronological order.
223
56
 
224
- */
225
-
226
- next_offset?:string;
57
+ export interface RetrieveResponse {
58
+ payment_voucher: PaymentVoucher;
227
59
  }
228
- export interface Payment_vouchersForInvoiceInputParam {
229
- [key : string]: any;
230
- /**
231
- * @description Retrieves vouchers for an invoice in reverse chronological order.
232
-
233
- */
234
-
235
- limit?:number;
236
-
237
- /**
238
- * @description Retrieves vouchers for an invoice in reverse chronological order.
239
-
240
- */
241
-
242
- offset?:string;
243
-
244
- /**
245
- * @description Retrieves vouchers for an invoice in reverse chronological order.
246
60
 
247
- */
248
-
249
- status?:{in?:string,is?:'consumed' | 'expired' | 'failure' | 'active',is_not?:'consumed' | 'expired' | 'failure' | 'active',not_in?:string};
250
-
251
- /**
252
- * @description Retrieves vouchers for an invoice in reverse chronological order.
253
-
254
- */
255
-
256
- sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
61
+ export interface Payment_vouchersForInvoiceResponse {
62
+ list: { payment_voucher: PaymentVoucher }[];
63
+ next_offset?: string;
257
64
  }
258
- export interface Payment_vouchersForCustomerResponse {
259
- /**
260
- * @description Retrieves vouchers for a customer in reverse chronological order.
261
-
262
- */
263
-
264
- list:{payment_voucher:PaymentVoucher}[];
265
-
266
- /**
267
- * @description Retrieves vouchers for a customer in reverse chronological order.
268
65
 
269
- */
270
-
271
- next_offset?:string;
66
+ export interface Payment_vouchersForCustomerResponse {
67
+ list: { payment_voucher: PaymentVoucher }[];
68
+ next_offset?: string;
272
69
  }
273
- export interface Payment_vouchersForCustomerInputParam {
274
- [key : string]: any;
275
- /**
276
- * @description Retrieves vouchers for a customer in reverse chronological order.
277
-
278
- */
279
-
280
- limit?:number;
281
-
282
- /**
283
- * @description Retrieves vouchers for a customer in reverse chronological order.
284
70
 
285
- */
286
-
287
- offset?:string;
288
-
289
- /**
290
- * @description Retrieves vouchers for a customer in reverse chronological order.
291
-
292
- */
293
-
294
- status?:{in?:string,is?:'consumed' | 'expired' | 'failure' | 'active',is_not?:'consumed' | 'expired' | 'failure' | 'active',not_in?:string};
295
-
296
- /**
297
- * @description Retrieves vouchers for a customer in reverse chronological order.
298
-
299
- */
300
-
301
- sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
71
+ export interface LinkedInvoice {
72
+ invoice_id: string;
73
+ txn_id: string;
74
+ applied_at: number;
302
75
  }
303
- export interface InvoicePaymentVoucher {
304
- /**
305
- * @description Identifier for the invoice.
306
-
307
- */
308
-
309
- invoice_id:string;
310
-
311
- /**
312
- * @description Uniquely identifies the payment voucher.
76
+ // REQUEST PARAMS
77
+ //---------------
313
78
 
314
- */
315
-
316
- txn_id:string;
317
-
318
- /**
319
- * @description Timestamp at which the transaction is applied.
79
+ export interface CreateInputParam {
80
+ customer_id: string;
81
+ payment_source_id?: string;
82
+ voucher_payment_source?: VoucherPaymentSourceCreateInputParam;
83
+ invoice_allocations?: InvoiceAllocationsCreateInputParam[];
84
+ }
85
+ export interface PaymentVouchersForInvoiceInputParam {
86
+ limit?: number;
87
+ offset?: string;
88
+ status?: filter.Enum;
89
+ 'sort_by[asc]'?: string;
90
+ 'sort_by[desc]'?: string;
91
+ }
92
+ export interface PaymentVouchersForCustomerInputParam {
93
+ limit?: number;
94
+ offset?: string;
95
+ status?: filter.Enum;
96
+ 'sort_by[asc]'?: string;
97
+ 'sort_by[desc]'?: string;
98
+ }
99
+ export interface VoucherPaymentSourceCreateInputParam {
100
+ voucher_type: VoucherType;
101
+ }
320
102
 
321
- */
322
-
323
- applied_at:number;
103
+ export interface InvoiceAllocationsCreateInputParam {
104
+ invoice_id: string;
324
105
  }
325
106
  }
326
- }
107
+ }