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,180 +1,79 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
3
4
  declare module 'chargebee' {
4
5
  export interface SubscriptionEntitlement {
5
-
6
- /**
7
- * @description The &#x60;id&#x60; of the [subscription](/docs/api/subscriptions) to which this entitlement belongs.
8
-
9
- */
10
-
11
- subscription_id:string;
12
-
13
- /**
14
- * @description The &#x60;id&#x60; of the [feature](/docs/api/features) towards which this subscription entitlement has been granted.
15
-
16
- */
17
-
18
- feature_id?:string;
19
-
20
- /**
21
- * @description The [name of the feature](/docs/api/features#feature_name) towards which this subscription entitlement has been granted.
22
-
23
- */
24
-
25
- feature_name?:string;
26
-
27
- /**
28
- * @description [The unit of measure](/docs/api/features#feature_unit) for the feature when its &#x60;type&#x60; is either &#x60;quantity&#x60; or &#x60;range&#x60;.
29
-
30
- */
31
-
32
- feature_unit?:string;
33
-
34
- /**
35
- * @description The value denoting the effective entitlement level that the subscription has towards the feature. When &#x60;components.entitlement_override&#x60; is present, then this is the same as &#x60;components.entitlement_override.value&#x60;. Otherwise, it is &#x60;components.inherited_entitlements.value&#x60;.
36
-
37
- */
38
-
39
- value?:string;
40
-
41
- /**
42
- * @description The display name of the effective entitlement level. When &#x60;components.entitlement_override&#x60; is present, then this is the same as &#x60;components.entitlement_override.name&#x60;. Otherwise, it is derived based on the &#x60;type&#x60; of feature as follows:
43
-
44
- * When &#x60;feature.type&#x60; is &#x60;range&#x60; or &#x60;quantity&#x60;: the &#x60;name&#x60; is the space-separated concatenation of &#x60;inherited_entitlements.value&#x60; and the pluralized form of &#x60;feature_unit&#x60;. For example, if &#x60;value&#x60; is &#x60;20&#x60; and &#x60;feature_unit&#x60; is &#x60;user&#x60;, then &#x60;name&#x60; becomes &#x60;20 users&#x60;.
45
- * When &#x60;feature.type&#x60; is &#x60;custom&#x60;: the &#x60;name&#x60; is the same as &#x60;inherited_entitlements.value&#x60;.
46
- * When &#x60;feature.type&#x60; is &#x60;switch&#x60;: &#x60;name&#x60; is not applicable.
47
-
48
- */
49
-
50
- name?:string;
51
-
52
- /**
53
- * @description Indicates that &#x60;components.entitlement_overrides&#x60; exists.
54
-
55
- */
56
-
57
- is_overridden:boolean;
58
-
59
- /**
60
- * @description Indicates that &#x60;components.is_enabled&#x60; exists.
61
-
62
- */
63
-
64
- is_enabled:boolean;
65
-
66
- /**
67
- * @description Timestamp when the subscription entitlements are going to expire.
68
-
69
- */
70
- effective_from?:number;
71
-
72
- schedule_status?:'activated' | 'scheduled' | 'failed';
73
-
74
- expires_at?:number;
75
-
76
- /**
77
- * @description The component entitlements that constitute this &#x60;subscription_entitlement&#x60;. The effective entitlement [value](/docs/api/subscription_entitlements#subscription_entitlement_value) and [name](/docs/api/subscription_entitlements#subscription_entitlement_name) are determined from these component entitlements.
78
-
79
- */
80
-
81
- components?:SubscriptionEntitlement.Component;
82
- feature_type?:string;
6
+ subscription_id: string;
7
+ feature_id?: string;
8
+ feature_name?: string;
9
+ feature_unit?: string;
10
+ feature_type?: string;
11
+ value?: string;
12
+ name?: string;
13
+ is_overridden: boolean;
14
+ is_enabled: boolean;
15
+ effective_from?: number;
16
+ schedule_status?: 'activated' | 'scheduled' | 'failed';
17
+ expires_at?: number;
18
+ components?: SubscriptionEntitlement.Component;
83
19
  }
84
- export namespace SubscriptionEntitlement {
85
- export class SubscriptionEntitlementResource {
86
- /**
87
- * @description Retrieves the list of &#x60;subscription_entitlements&#x60; for the [subscription](/docs/api/subscriptions).
88
- **Note:**
89
-
90
- The &#x60;components&#x60; attribute is not returned for any of the &#x60;subscription_entitlements&#x60;. Use the retrieve operation(coming soon) to obtain the &#x60;components&#x60;.
91
20
 
92
- */
93
-
94
- subscription_entitlements_for_subscription(subscription_id:string, input?:SubscriptionEntitlementsForSubscriptionInputParam):ChargebeeRequest<SubscriptionEntitlementsForSubscriptionResponse>;
95
-
96
- /**
97
- * @description Enables or disables specific &#x60;subscription_entitlements&#x60; for a subscription.
98
-
99
- */
100
-
101
- set_subscription_entitlement_availability(subscription_id:string, input:SetSubscriptionEntitlementAvailabilityInputParam):ChargebeeRequest<SetSubscriptionEntitlementAvailabilityResponse>;
21
+ export namespace SubscriptionEntitlement {
22
+ export class SubscriptionEntitlementResource {
23
+ subscriptionEntitlementsForSubscription(
24
+ subscription_id: string,
25
+ input?: SubscriptionEntitlementsForSubscriptionInputParam,
26
+ headers?: ChargebeeRequestHeader,
27
+ ): Promise<
28
+ ChargebeeResponse<SubscriptionEntitlementsForSubscriptionResponse>
29
+ >;
30
+
31
+ setSubscriptionEntitlementAvailability(
32
+ subscription_id: string,
33
+ input: SetSubscriptionEntitlementAvailabilityInputParam,
34
+ headers?: ChargebeeRequestHeader,
35
+ ): Promise<
36
+ ChargebeeResponse<SetSubscriptionEntitlementAvailabilityResponse>
37
+ >;
102
38
  }
103
- export interface SubscriptionEntitlementsForSubscriptionResponse {
104
- /**
105
- * @description Retrieves the list of &#x60;subscription_entitlements&#x60; for the [subscription](/docs/api/subscriptions).
106
- **Note:**
107
39
 
108
- The &#x60;components&#x60; attribute is not returned for any of the &#x60;subscription_entitlements&#x60;. Use the retrieve operation(coming soon) to obtain the &#x60;components&#x60;.
109
-
110
- */
111
-
112
- list:{subscription_entitlement:SubscriptionEntitlement}[];
113
-
114
- /**
115
- * @description Retrieves the list of &#x60;subscription_entitlements&#x60; for the [subscription](/docs/api/subscriptions).
116
- **Note:**
40
+ export interface SubscriptionEntitlementsForSubscriptionResponse {
41
+ list: { subscription_entitlement: SubscriptionEntitlement }[];
42
+ next_offset?: string;
43
+ }
117
44
 
118
- The &#x60;components&#x60; attribute is not returned for any of the &#x60;subscription_entitlements&#x60;. Use the retrieve operation(coming soon) to obtain the &#x60;components&#x60;.
45
+ export interface SetSubscriptionEntitlementAvailabilityResponse {
46
+ subscription_entitlement: SubscriptionEntitlement;
47
+ }
119
48
 
120
- */
121
-
122
- next_offset?:string;
49
+ export interface Component {
50
+ entitlement_overrides?: EntitlementOverride;
123
51
  }
124
- export interface SubscriptionEntitlementsForSubscriptionInputParam {
125
- [key : string]: any;
126
- /**
127
- * @description Retrieves the list of &#x60;subscription_entitlements&#x60; for the [subscription](/docs/api/subscriptions).
128
- **Note:**
52
+ // REQUEST PARAMS
53
+ //---------------
129
54
 
130
- The &#x60;components&#x60; attribute is not returned for any of the &#x60;subscription_entitlements&#x60;. Use the retrieve operation(coming soon) to obtain the &#x60;components&#x60;.
55
+ export interface SubscriptionEntitlementsForSubscriptionInputParam {
56
+ limit?: number;
57
+ offset?: string /**
58
+ * @deprecated Please refer API docs to use other attributes
59
+ */;
131
60
 
132
- */
133
-
134
- limit?:number;
135
-
136
- /**
137
- * @description Retrieves the list of &#x60;subscription_entitlements&#x60; for the [subscription](/docs/api/subscriptions).
138
- **Note:**
61
+ include_drafts?: boolean /**
62
+ * @deprecated Please refer API docs to use other attributes
63
+ */;
139
64
 
140
- The &#x60;components&#x60; attribute is not returned for any of the &#x60;subscription_entitlements&#x60;. Use the retrieve operation(coming soon) to obtain the &#x60;components&#x60;.
65
+ embed?: string /**
66
+ * @deprecated Please refer API docs to use other attributes
67
+ */;
141
68
 
142
- */
143
-
144
- offset?:string;
145
-
146
- include_drafts?:boolean;
147
-
148
- embed?:string;
149
-
150
- include_scheduled_overrides?:boolean;
151
- }
152
- export interface SetSubscriptionEntitlementAvailabilityResponse {
153
- subscription_entitlement:SubscriptionEntitlement;
69
+ include_scheduled_overrides?: boolean;
154
70
  }
155
71
  export interface SetSubscriptionEntitlementAvailabilityInputParam {
156
-
157
- /**
158
- * @description Specifies whether the &#x60;subscription_entitlements&#x60; are to be enabled or disabled.
159
-
160
- */
161
-
162
- is_enabled:boolean;
163
-
164
- /**
165
- * @description Parameters for subscription_entitlements
166
-
167
- */
168
-
169
- subscription_entitlements:{feature_id:string}[];
72
+ is_enabled: boolean;
73
+ subscription_entitlements?: SubscriptionEntitlementsSetSubscriptionEntitlementAvailabilityInputParam[];
170
74
  }
171
- export interface Component {
172
- /**
173
- * @description When a subscription entitlement has been explicitly overridden, this object contains the details of said override. An &#x60;entitlement_override&#x60; can be [temporary](/docs/api/entitlement_overrides#entitlement_override_expires_at) such that it expires at some point in time and is no longer returned.
174
-
175
- */
176
-
177
- entitlement_overrides?:EntitlementOverride;
75
+ export interface SubscriptionEntitlementsSetSubscriptionEntitlementAvailabilityInputParam {
76
+ feature_id: string;
178
77
  }
179
78
  }
180
- }
79
+ }
@@ -1,83 +1,59 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface SubscriptionEstimate {
4
-
5
- id?:string;
6
-
7
- currency_code:string;
8
-
9
- status?:'in_trial' | 'paused' | 'transferred' | 'future' | 'active' | 'cancelled' | 'non_renewing';
10
-
11
- trial_end_action?:TrialEndAction;
12
-
13
- next_billing_at?:number;
14
-
15
- pause_date?:number;
16
-
17
- resume_date?:number;
18
-
19
- shipping_address?:SubscriptionEstimate.ShippingAddress;
20
-
21
- contract_term?:SubscriptionEstimate.ContractTerm;
6
+ id?: string;
7
+ currency_code: string;
8
+ status?:
9
+ | 'future'
10
+ | 'in_trial'
11
+ | 'active'
12
+ | 'non_renewing'
13
+ | 'paused'
14
+ | 'cancelled'
15
+ | 'transferred';
16
+ trial_end_action?: TrialEndAction;
17
+ next_billing_at?: number;
18
+ pause_date?: number;
19
+ resume_date?: number;
20
+ shipping_address?: SubscriptionEstimate.ShippingAddress;
21
+ contract_term?: SubscriptionEstimate.ContractTerm;
22
22
  }
23
+
23
24
  export namespace SubscriptionEstimate {
24
-
25
-
26
- export interface ShippingAddress {
27
- first_name?:string;
28
-
29
- last_name?:string;
30
-
31
- email?:string;
32
-
33
- company?:string;
34
-
35
- phone?:string;
36
-
37
- line1?:string;
38
-
39
- line2?:string;
40
-
41
- line3?:string;
42
-
43
- city?:string;
44
-
45
- state_code?:string;
46
-
47
- state?:string;
48
-
49
- country?:string;
50
-
51
- zip?:string;
52
-
53
- validation_status?:ValidationStatus;
54
-
55
- index:number;
25
+ export interface ShippingAddress {
26
+ first_name?: string;
27
+ last_name?: string;
28
+ email?: string;
29
+ company?: string;
30
+ phone?: string;
31
+ line1?: string;
32
+ line2?: string;
33
+ line3?: string;
34
+ city?: string;
35
+ state_code?: string;
36
+ state?: string;
37
+ country?: string;
38
+ zip?: string;
39
+ validation_status?: ValidationStatus;
40
+ index: number;
56
41
  }
57
- export interface ContractTerm {
58
- id:string;
59
-
60
- status:'active' | 'cancelled' | 'completed' | 'terminated';
61
-
62
- contract_start:number;
63
-
64
- contract_end:number;
65
-
66
- billing_cycle:number;
67
-
68
- action_at_term_end:'cancel' | 'renew_once' | 'renew' | 'evergreen';
69
-
70
- total_contract_value:number;
71
-
72
- total_contract_value_before_tax:number;
73
-
74
- cancellation_cutoff_period?:number;
75
-
76
- created_at:number;
77
-
78
- subscription_id:string;
79
-
80
- remaining_billing_cycles?:number;
42
+ export interface ContractTerm {
43
+ id: string;
44
+ status: 'active' | 'completed' | 'cancelled' | 'terminated';
45
+ contract_start: number;
46
+ contract_end: number;
47
+ billing_cycle: number;
48
+ action_at_term_end: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
49
+ total_contract_value: number;
50
+ total_contract_value_before_tax: number;
51
+ cancellation_cutoff_period?: number;
52
+ created_at: number;
53
+ subscription_id: string;
54
+ remaining_billing_cycles?: number;
81
55
  }
56
+ // REQUEST PARAMS
57
+ //---------------
82
58
  }
83
- }
59
+ }
@@ -1,44 +1,19 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface TaxWithheld {
4
-
5
- /**
6
- * @description An auto-generated unique identifier for the tax withheld. The value starts with the prefix &#x60;tax_wh_&#x60;. For example, &#x60;tax_wh_16BdDXSlbu4uV1Ee6&#x60;.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description A unique external reference number for the tax withheld. Typically, this is the reference number used by the system you are integrating the API with. Depending on your integration, this could be the reference number issued by the taxation authority to identify the customer or the specific tax transaction.
14
-
15
- */
16
-
17
- reference_number?:string;
18
-
19
- /**
20
- * @description The description for this tax withheld.
21
-
22
- */
23
-
24
- description?:string;
25
-
26
- /**
27
- * @description Date or time associated with the tax withheld.
28
-
29
- */
30
-
31
- date?:number;
32
-
33
- /**
34
- * @description The amount withheld by the customer as tax from the invoice. The unit depends on the [type of currency](/docs/api#md_disabled).
35
-
36
- */
37
-
38
- amount?:number;
39
-
40
- resource_version?:number;
41
-
42
- updated_at?:number;
6
+ id: string;
7
+ user?: string;
8
+ reference_number?: string;
9
+ description?: string;
10
+ type: 'payment' | 'refund';
11
+ payment_method: 'cash' | 'check' | 'chargeback' | 'bank_transfer' | 'other';
12
+ date?: number;
13
+ currency_code: string;
14
+ amount?: number;
15
+ resource_version?: number;
16
+ updated_at?: number;
17
+ exchange_rate?: number;
43
18
  }
44
- }
19
+ }
@@ -1,33 +1,11 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface ThirdPartyPaymentMethod {
4
-
5
- /**
6
- * @description Type of the payment method. \* direct_debit - Represents bank account for which the direct debit or ACH agreement/mandate is created. \* unionpay - Payments made via UnionPay. \* google_pay - Payments made via Google Pay. \* dotpay - Payments made via Dotpay. \* generic - Payments made via Generic Payment Method. \* giropay - Payments made via giropay. \* paypal_express_checkout - Payments made via PayPal Express Checkout. \* alipay - Payments made via Alipay. \* sofort - Payments made via Sofort. \* wechat_pay - Payments made via WeChat Pay. \* ideal - Payments made via iDEAL. \* netbanking_emandates - Netbanking (eMandates) Payments. \* upi - UPI Payments. \* bancontact - Payments made via Bancontact Card. \* card - Card based payment including credit cards and debit cards. Details about the card can be obtained from the card resource. \* amazon_payments - Payments made via Amazon Payments. \* apple_pay - Payments made via Apple Pay.
7
-
8
- */
9
-
10
- type:Type;
11
-
12
- /**
13
- * @description Name of the gateway this card is stored with. \* 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.
14
-
15
- */
16
-
17
- gateway:Gateway;
18
-
19
- /**
20
- * @description The gateway account this payment method is stored with.
21
-
22
- */
23
-
24
- gateway_account_id?:string;
25
-
26
- /**
27
- * @description Identifier provided by the gateway to reference that specific card.
28
-
29
- */
30
-
31
- reference_id:string;
6
+ type: Type;
7
+ gateway: Gateway;
8
+ gateway_account_id?: string;
9
+ reference_id: string;
32
10
  }
33
- }
11
+ }
@@ -1,111 +1,57 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface TimeMachine {
4
-
5
- /**
6
- * @description The name of the time machine. Currently only **delorean** is allowed
7
-
8
- */
9
-
10
- name:string;
11
-
12
- /**
13
- * @description The current status of time travel \* succeeded - Time travel has succeeded. \* not_enabled - Time travel has not been enabled for the site \* failed - Time travel has failed. Check the failure code and failure reason attributes for further details.
14
- **Note:** The time machine needs to be reset by starting afresh again. \* in_progress - Time travel is in progress
15
-
16
- */
17
-
18
- time_travel_status:'in_progress' | 'not_enabled' | 'failed' | 'succeeded';
19
-
20
- /**
21
- * @description The start time of the time machine. Specified when &#x27;starting afresh&#x27;
22
-
23
- */
24
-
25
- genesis_time:number;
26
-
27
- /**
28
- * @description The destination time to which the time machine is travelling (or has traveled)
29
-
30
- */
31
-
32
- destination_time:number;
33
-
34
- /**
35
- * @description The failure code. This will follow the api error code convention
36
-
37
- */
38
-
39
- failure_code?:string;
40
-
41
- /**
42
- * @description The more descriptive failure reason.
43
-
44
- */
45
-
46
- failure_reason?:string;
47
-
48
- /**
49
- * @description The failure details as error json.
50
-
51
- */
52
-
53
- error_json?:string;
6
+ name: string;
7
+ time_travel_status: 'not_enabled' | 'in_progress' | 'succeeded' | 'failed';
8
+ genesis_time: number;
9
+ destination_time: number;
10
+ failure_code?: string;
11
+ failure_reason?: string;
12
+ error_json?: string;
54
13
  }
55
- export namespace TimeMachine {
56
- export class TimeMachineResource {
57
- /**
58
- * @description Retrieves the time machine. Currently only one time machine is available per site and is named &#x27;delorean&#x27;.
59
-
60
- */
61
-
62
- retrieve(time_machine_name:string):ChargebeeRequest<RetrieveResponse>;
63
-
64
- /**
65
- * @description Restart the time machine. This will clear the &quot;customer&quot; data like customer details, subscriptions, invoices, transactions. Also a time travel is initiated to travel back to specified genesis time.
66
14
 
67
- **Note:** This API call is asynchronous. You need to check if the &quot;start afresh&quot; operation has completed by checking if the time travel status is **successful** by retrieving the time machine in a loop with a minimum delay of 3 secs between two retrieve requests. In case you are using any of the client libraries, use the **wait for time travel completion** function provided as a instance method in the library. Use method **waitForTimeTravelCompletion()** on the returned **time_machine** resource which will block until the time travel completes. Use method **waitForTimeTravelCompletion()** on the returned **time_machine** resource which will block until the time travel completes. Use method **wait_for_time_travel_completion** on the returned **time_machine** resource which will block until the time travel completes. Use method **wait_for_time_travel_completion** on the returned **time_machine** resource which will block until the time travel completes. Use method **WaitForTimeTravelCompletion** on the returned **time_machine** resource which will block until the time travel completes. Use method **wait_for_time_travel_completion** on the returned **time_machine** resource which will block until the time travel completes. Use method **waitForTimeTravelCompletion** on the returned **time_machine** resource which will block until the time travel completes. Use method **wait_for_time_travel_completion** on the returned **time_machine** resource which will block until the time travel completes.
68
-
69
- */
70
-
71
- start_afresh(time_machine_name:string, input?:StartAfreshInputParam):ChargebeeRequest<StartAfreshResponse>;
72
-
73
- /**
74
- * @description Travel forward in time. This operation is **asynchronous** . You need to check if the &quot;start afresh&quot; operation has completed by checking if the time travel status is **successful** by retrieving the time machine in a loop with a minimum delay of 3 secs between two retrieve requests. Use method **waitForTimeTravelCompletion()** on the returned time_machine resource which will block until the time travel completes.
75
-
76
- */
77
-
78
- travel_forward(time_machine_name:string, input?:TravelForwardInputParam):ChargebeeRequest<TravelForwardResponse>;
15
+ export namespace TimeMachine {
16
+ export class TimeMachineResource {
17
+ retrieve(
18
+ time_machine_name: string,
19
+ headers?: ChargebeeRequestHeader,
20
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
21
+
22
+ startAfresh(
23
+ time_machine_name: string,
24
+ input?: StartAfreshInputParam,
25
+ headers?: ChargebeeRequestHeader,
26
+ ): Promise<ChargebeeResponse<StartAfreshResponse>>;
27
+
28
+ travelForward(
29
+ time_machine_name: string,
30
+ input?: TravelForwardInputParam,
31
+ headers?: ChargebeeRequestHeader,
32
+ ): Promise<ChargebeeResponse<TravelForwardResponse>>;
79
33
  }
80
- export interface RetrieveResponse {
81
- time_machine:TimeMachine;
34
+
35
+ export interface RetrieveResponse {
36
+ time_machine: TimeMachine;
82
37
  }
83
-
84
- export interface StartAfreshResponse {
85
- time_machine:TimeMachine;
38
+
39
+ export interface StartAfreshResponse {
40
+ time_machine: TimeMachine;
86
41
  }
87
- export interface StartAfreshInputParam {
88
-
89
- /**
90
- * @description The genesis time to travel back as part of the reset operation. If not provided, then the travel is set to 6 months in the past.
91
- **Note:** Can only be in the past.
92
42
 
93
- */
94
-
95
- genesis_time?:number;
43
+ export interface TravelForwardResponse {
44
+ time_machine: TimeMachine;
96
45
  }
97
- export interface TravelForwardResponse {
98
- time_machine:TimeMachine;
46
+
47
+ // REQUEST PARAMS
48
+ //---------------
49
+
50
+ export interface StartAfreshInputParam {
51
+ genesis_time?: number;
99
52
  }
100
53
  export interface TravelForwardInputParam {
101
-
102
- /**
103
- * @description The **time** to travel to. Should be between the &#x27;current&#x27; destination time of the time machine and present time.
104
-
105
- */
106
-
107
- destination_time?:number;
54
+ destination_time?: number;
108
55
  }
109
-
110
56
  }
111
- }
57
+ }