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,447 +1,169 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface Card {
4
-
5
- /**
6
- * @description Identifier of the payment source
7
-
8
- */
9
-
10
- payment_source_id:string;
11
-
12
- /**
13
- * @description Current status of the card. \* valid - A valid and active credit card \* expiring - A card which is expiring in the current month. \* expired - An expired card
14
-
15
- */
16
-
17
- status:'valid' | 'expiring' | 'expired';
18
-
19
- /**
20
- * @description Name of the gateway this payment source is stored with. \* bluesnap - BlueSnap is a payment gateway. \* tco - 2Checkout is a payment gateway. \* bluepay - BluePay is a payment gateway. \* paypal_express_checkout - PayPal Express Checkout is a payment gateway. \* 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. \* not_applicable - Indicates that payment gateway is not applicable for this resource. \* 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. \* worldpay - WorldPay 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 \* stripe - Stripe is a payment gateway. \* moneris - Moneris is a payment gateway. \* chargebee - Chargebee test gateway. \* cybersource - CyberSource is a payment gateway. \* ecentric - Ecentric provides a seamless payment processing service in South Africa specializing on omnichannel capabilities. \* first_data_global - First Data Global Gateway Virtual Terminal Account \* exact - Exact Payments 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. \* amazon_payments - Amazon Payments is a payment service provider. \* windcave - Windcave provides an end to end payment processing solution in ANZ and other leading global markets. \* quickbooks - Intuit QuickBooks Payments gateway \* wepay - WePay 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. \* 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. \* vantiv - Vantiv is a payment gateway. \* bank_of_america - Bank of America 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 \* ebanx - EBANX is a payment gateway, enabling businesses to accept diverse local payment methods from various countries for increased market reach and conversion.
21
-
22
- */
23
-
24
- gateway:Gateway;
25
-
26
- /**
27
- * @description The gateway account to which this payment source is stored with.
28
-
29
- */
30
-
31
- gateway_account_id?:string;
32
-
33
- /**
34
- * @description Reference transaction id which used for transactions
35
-
36
- */
37
-
38
- ref_tx_id?:string;
39
-
40
- /**
41
- * @description Cardholder&#x27;s first name
42
-
43
- */
44
-
45
- first_name?:string;
46
-
47
- /**
48
- * @description Cardholder&#x27;s last name
49
-
50
- */
51
-
52
- last_name?:string;
53
-
54
- /**
55
- * @description The Issuer Identification Number, i.e. the first six digits of the card number
56
-
57
- */
58
-
59
- iin:string;
60
-
61
- /**
62
- * @description Last four digits of the card number
63
-
64
- */
65
-
66
- last4:string;
67
-
68
- /**
69
- * @description Card type \* bancontact - A Bancontact card. \* american_express - An American Express card. \* not_applicable - Used for offline entries in transactions. Not applicable for cards \* diners_club - A Diner&#x27;s Club card. \* discover - A Discover card. \* other - Card belonging to types other than those listed above. \* mastercard - A MasterCard. \* jcb - A JCB card. \* visa - A Visa card.
70
-
71
- */
72
-
73
- card_type?:'discover' | 'other' | 'argencard' | 'jcb' | 'mastercard' | 'elo' | 'cencosud' | 'cmr_falabella' | 'american_express' | 'cabal' | 'nativa' | 'bancontact' | 'tarjeta_naranja' | 'carnet' | 'visa' | 'diners_club' | 'rupay' | 'not_applicable' | 'hipercard' | 'maestro';
74
-
75
- /**
76
- * @description Card Funding type \* credit - A credit card. \* prepaid - A prepaid card. \* debit - A debit card. \* not_applicable - Used for ACH. Not applicable for cards \* not_known - An unknown card.
77
-
78
- */
79
-
80
- funding_type:'not_known' | 'prepaid' | 'not_applicable' | 'credit' | 'debit';
81
-
82
- /**
83
- * @description Card expiry month.
84
-
85
- */
86
-
87
- expiry_month:number;
88
-
89
- /**
90
- * @description Card expiry year.
91
-
92
- */
93
-
94
- expiry_year:number;
95
-
96
- /**
97
- * @description [two-letter(alpha2)](https://www.iso.org/iso-3166-country-codes.html) ISO country code.
98
-
99
- */
100
-
101
- issuing_country?:string;
102
-
103
- /**
104
- * @description Address line 1, as available in card billing address.
105
-
106
- */
107
-
108
- billing_addr1?:string;
109
-
110
- /**
111
- * @description Address line 2, as available in card billing address.
112
-
113
- */
114
-
115
- billing_addr2?:string;
116
-
117
- /**
118
- * @description City, as available in card billing address.
119
-
120
- */
121
-
122
- billing_city?:string;
123
-
124
- /**
125
- * @description The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set &#x60;state_code&#x60; as &#x60;AZ&#x60; (not &#x60;US-AZ&#x60;). For Tamil Nadu (India), set as &#x60;TN&#x60; (not &#x60;IN-TN&#x60;). For British Columbia (Canada), set as &#x60;BC&#x60; (not &#x60;CA-BC&#x60;).
126
-
127
- */
128
-
129
- billing_state_code?:string;
130
-
131
- /**
132
- * @description The state/province name.
133
-
134
- */
135
-
136
- billing_state?:string;
137
-
138
- /**
139
- * @description The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html).
140
-
141
- **Note** : If you enter an invalid country code, the system will return an error.
142
-
143
- **Brexit**
144
-
145
-
146
- If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then &#x60;XI&#x60; (the code for **United Kingdom -- Northern Ireland**) is available as an option.
147
-
148
- */
149
-
150
- billing_country?:string;
151
-
152
- /**
153
- * @description Postal or Zip code, as available in card billing address.
154
-
155
- */
156
-
157
- billing_zip?:string;
158
-
159
- /**
160
- * @description Timestamp indicating when this card resource is created.
161
-
162
- */
163
-
164
- created_at:number;
165
-
166
- /**
167
- * @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.
168
-
169
- */
170
-
171
- resource_version?:number;
172
-
173
- /**
174
- * @description Timestamp indicating when this credit card resource was last updated.
175
-
176
- */
177
-
178
- updated_at?:number;
179
-
180
- /**
181
- * @description The IP address of the customer. Used primarily for referral integration and EU VAT validation.
182
-
183
- */
184
-
185
- ip_address?:string;
186
-
187
- /**
188
- * @description Card is powered by payment method. \* card - card \* ideal - ideal \* sofort - sofort \* bancontact - bancontact \* giropay - giropay \* latam_local_card - latam_local_card \* not_applicable - not_applicable
189
-
190
- */
191
-
192
- powered_by?:'giropay' | 'bancontact' | 'ideal' | 'latam_local_card' | 'not_applicable' | 'sofort' | 'card';
193
-
194
- /**
195
- * @description Identifier of the customer.
196
-
197
- */
198
-
199
- customer_id:string;
200
-
201
- /**
202
- * @description Masked credit card number that is safe to show.
203
-
204
- */
205
-
206
- masked_number?:string;
6
+ payment_source_id: string;
7
+ status: 'valid' | 'expiring' | 'expired';
8
+ gateway: Gateway;
9
+ gateway_account_id?: string;
10
+ ref_tx_id?: string;
11
+ first_name?: string;
12
+ last_name?: string;
13
+ iin: string;
14
+ last4: string;
15
+ card_type?:
16
+ | 'visa'
17
+ | 'mastercard'
18
+ | 'american_express'
19
+ | 'discover'
20
+ | 'jcb'
21
+ | 'diners_club'
22
+ | 'bancontact'
23
+ | 'cmr_falabella'
24
+ | 'tarjeta_naranja'
25
+ | 'nativa'
26
+ | 'cencosud'
27
+ | 'cabal'
28
+ | 'argencard'
29
+ | 'elo'
30
+ | 'hipercard'
31
+ | 'carnet'
32
+ | 'rupay'
33
+ | 'maestro'
34
+ | 'other'
35
+ | 'not_applicable';
36
+ funding_type:
37
+ | 'credit'
38
+ | 'debit'
39
+ | 'prepaid'
40
+ | 'not_known'
41
+ | 'not_applicable';
42
+ expiry_month: number;
43
+ expiry_year: number;
44
+ issuing_country?: string;
45
+ billing_addr1?: string;
46
+ billing_addr2?: string;
47
+ billing_city?: string;
48
+ billing_state_code?: string;
49
+ billing_state?: string;
50
+ billing_country?: string;
51
+ billing_zip?: string;
52
+ created_at: number;
53
+ resource_version?: number;
54
+ updated_at?: number;
55
+ ip_address?: string;
56
+ powered_by?:
57
+ | 'ideal'
58
+ | 'sofort'
59
+ | 'bancontact'
60
+ | 'giropay'
61
+ | 'card'
62
+ | 'latam_local_card'
63
+ | 'not_applicable';
64
+ customer_id: string;
65
+ masked_number?: string;
207
66
  }
208
- export namespace Card {
209
- export class CardResource {
210
- /**
211
- * @description #### Deprecated
212
-
213
- This operation is obsoleted by the [Retrieve a payment source API](/docs/api/payment_sources#retrieve_a_payment_source).
214
-
215
- Retrieves the credit card for the customer id.
216
-
217
- */
218
-
219
- retrieve(customer_id:string):ChargebeeRequest<RetrieveResponse>;
220
-
221
- /**
222
- * @description #### Deprecated
223
-
224
- The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the [Cards APIs](/docs/api/cards). This operation is obsoleted by the following:
225
-
226
- * [Create using temporary token](/docs/api/payment_sources#create_using_temporary_token)
227
- * [Create using permanent token](/docs/api/payment_sources#create_using_permanent_token)
228
- * [Create a card payment source](/docs/api/payment_sources#create_a_card_payment_source)
229
-
230
- Adds or replaces card details of a customer. Updating card details replaces the present payment method.
231
-
232
- Passing credit card details to this API involves PCI liability at your end as sensitive card info passes through your servers. If you wish to avoid that, you can use one of the following integration methodologies if applicable
233
-
234
- * If you are using Stripe gateway, you can use [Stripe.js](https://stripe.com/docs/stripe.js) with your card update form.
235
- * If you are using Braintree gateway, you can use [Braintree.js](https://www.braintreepayments.com/docs/javascript) with your card update form.
236
- * If you are using Authorize.Net gateway, you use [Accept.js](https://developer.authorize.net/api/reference/features/acceptjs.html) with your card update form.
237
- * In case you are using the Adyen gateway, you will have to use the Adyen&#x27;s [Client Side Encryption](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/cse-integration-ecommerce) to encrypt sensitive cardholder data. Once the cardholder data is encrypted, pass the value in adyen.encrypted.data as temp token in this API.
238
- * You can also use our [Hosted Pages](https://www.chargebee.com/docs/hosted_pages.html) based integration. Use our [Hosted Page - Update Card](/docs/api/hosted_pages#update_card) API to generate a &#x27;Update Card&#x27; Hosted Page link.
239
-
240
-
241
-
242
- **Legacy behavior:**
243
-
244
- * **For [sites](https://www.chargebee.com/docs/sites-intro.html) created before March 1st, 2014:** On making this request, the &#x60;billing_address&#x60; and &#x60;vat_number&#x60; of the customer are **deleted** and replaced by the values passed with this request. Ensure that you pass the [billing address parameters](/docs/api/subscriptions?prod_cat_ver&#x3D;1#create_a_subscription_card_billing_addr1) and the &#x60;vat_number&#x60; parameters each time you make this request, to avoid losing the same information at the customer-level.
245
- * **For [sites](https://www.chargebee.com/docs/sites-intro.html) created on or after March 1st, 2014:** This request does not alter the &#x60;billing_address&#x60; and &#x60;vat_number&#x60; of the customer.
246
-
247
- */
248
-
249
- update_card_for_customer(customer_id:string, input:UpdateCardForCustomerInputParam):ChargebeeRequest<UpdateCardForCustomerResponse>;
250
-
251
- /**
252
- * @description #### Deprecated
253
-
254
- This request is obsoleted by the [Switch gateway account API](/docs/api/payment_sources#switch_gateway_account) for Payment Sources.
255
-
256
- Switches the gateway in which customer&#x27;s card information is stored. This is applicable only if the payment method is &#x60;card&#x60;.
257
67
 
258
- **Limitation**
259
- This request does not support switching between Braintree and Stripe payment gateways. Contact [Chargebee Support](https://chargebee.freshdesk.com/support/home) to perform those actions.
260
-
261
- */
262
-
263
- switch_gateway_for_customer(customer_id:string, input:SwitchGatewayForCustomerInputParam):ChargebeeRequest<SwitchGatewayForCustomerResponse>;
264
-
265
- /**
266
- * @description #### deprecated
267
-
268
- The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the Cards APIs. This request is obsoleted by the [Export payment source API](/docs/api/payment_sources#export_payment_source).
269
-
270
- Copies the customer&#x27;s card information to another payment gateway. This is useful if you want to port your customer&#x27;s card details to another gateway.
271
-
272
- **Limitation**
273
- This request does not support copying of cards between Braintree and Stripe payment gateways. Contact [Chargebee Support](https://chargebee.freshdesk.com/support/home) to perform those actions.
274
-
275
- */
276
-
277
- copy_card_for_customer(customer_id:string, input:CopyCardForCustomerInputParam):ChargebeeRequest<CopyCardForCustomerResponse>;
278
-
279
- /**
280
- * @description #### deprecated
281
-
282
- The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the Cards APIs. This request is obsoleted by the [Delete a payment source API](/docs/api/payment_sources#delete_a_payment_source).
283
-
284
- Deletes the card for a customer. Upon successful deletion the &#x60;auto_collection&#x60; attribute for the customer is set to &#x60;off&#x60; and a &#x60;card_deleted&#x60; event is triggered. If there is no card found at the gateway for the customer, this API returns without errors.
285
-
286
- */
287
-
288
- delete_card_for_customer(customer_id:string):ChargebeeRequest<DeleteCardForCustomerResponse>;
289
- }
290
- export interface RetrieveResponse {
291
- card:Card;
292
- }
293
-
294
- export interface UpdateCardForCustomerResponse {
295
- customer:Customer;
296
-
297
- card:Card;
68
+ export namespace Card {
69
+ export class CardResource {
70
+ retrieve(
71
+ customer_id: string,
72
+ headers?: ChargebeeRequestHeader,
73
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
74
+
75
+ updateCardForCustomer(
76
+ customer_id: string,
77
+ input: UpdateCardForCustomerInputParam,
78
+ headers?: ChargebeeRequestHeader,
79
+ ): Promise<ChargebeeResponse<UpdateCardForCustomerResponse>>;
80
+
81
+ switchGatewayForCustomer(
82
+ customer_id: string,
83
+ input: SwitchGatewayForCustomerInputParam,
84
+ headers?: ChargebeeRequestHeader,
85
+ ): Promise<ChargebeeResponse<SwitchGatewayForCustomerResponse>>;
86
+
87
+ copyCardForCustomer(
88
+ customer_id: string,
89
+ input: CopyCardForCustomerInputParam,
90
+ headers?: ChargebeeRequestHeader,
91
+ ): Promise<ChargebeeResponse<CopyCardForCustomerResponse>>;
92
+
93
+ deleteCardForCustomer(
94
+ customer_id: string,
95
+ headers?: ChargebeeRequestHeader,
96
+ ): Promise<ChargebeeResponse<DeleteCardForCustomerResponse>>;
298
97
  }
299
- export interface UpdateCardForCustomerInputParam {
300
-
301
- /**
302
- * @description The gateway account in which this payment source is stored.
303
-
304
- */
305
-
306
- gateway_account_id?:string;
307
-
308
- /**
309
- * @description The single-use card token returned by vaults like Stripe/Braintree which act as a substitute for your card details. Before calling this API, you should have submitted your card details to the gateway and gotten this token in return.
310
- **Note:** Supported only for Stripe, Braintree and Authorize.Net. If this value is specified, there is no need to specify other card details (like number, cvv, etc).
311
98
 
312
- */
313
-
314
- tmp_token?:string;
315
-
316
- /**
317
- * @description Cardholder&#x27;s first name.
318
-
319
- */
320
-
321
- first_name?:string;
322
-
323
- /**
324
- * @description Cardholder&#x27;s last name.
325
-
326
- */
327
-
328
- last_name?:string;
329
-
330
- /**
331
- * @description The credit card number without any format. If you are using [Braintree.js](https://developer.paypal.com/braintree/docs/guides/client-sdk/setup/javascript/v2#getting-braintree.js), you can specify the Braintree encrypted card number here.
332
-
333
- */
334
-
335
- number:string;
336
-
337
- /**
338
- * @description Card expiry month.
339
-
340
- */
341
-
342
- expiry_month:number;
343
-
344
- /**
345
- * @description Card expiry year.
346
-
347
- */
348
-
349
- expiry_year:number;
350
-
351
- /**
352
- * @description The card verification value (CVV). If you are using [Braintree.js](https://developer.paypal.com/braintree/docs/guides/client-sdk/setup/javascript/v2#getting-braintree.js), you can specify the Braintree encrypted CVV here.
99
+ export interface RetrieveResponse {
100
+ card: Card;
101
+ }
353
102
 
354
- */
355
-
356
- cvv?:string;
357
-
358
- /**
359
- * @description Address line 1, as available in card billing address.
103
+ export interface UpdateCardForCustomerResponse {
104
+ customer: Customer;
105
+ card: Card;
106
+ }
360
107
 
361
- */
362
-
363
- billing_addr1?:string;
364
-
365
- /**
366
- * @description Address line 2, as available in card billing address.
108
+ export interface SwitchGatewayForCustomerResponse {
109
+ customer: Customer;
110
+ card: Card;
111
+ }
367
112
 
368
- */
369
-
370
- billing_addr2?:string;
371
-
372
- /**
373
- * @description City, as available in card billing address.
113
+ export interface CopyCardForCustomerResponse {
114
+ third_party_payment_method: ThirdPartyPaymentMethod;
115
+ }
374
116
 
375
- */
376
-
377
- billing_city?:string;
378
-
379
- /**
380
- * @description The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search/code) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set &#x60;state_code&#x60; as &#x60;AZ&#x60; (not &#x60;US-AZ&#x60;). For Tamil Nadu (India), set as &#x60;TN&#x60; (not &#x60;IN-TN&#x60;). For British Columbia (Canada), set as &#x60;BC&#x60; (not &#x60;CA-BC&#x60;).
117
+ export interface DeleteCardForCustomerResponse {
118
+ customer: Customer;
119
+ }
381
120
 
382
- */
383
-
384
- billing_state_code?:string;
385
-
386
- /**
387
- * @description The state/province name. Is set by Chargebee automatically for US, Canada and India If &#x60;state_code&#x60; is provided.
121
+ // REQUEST PARAMS
122
+ //---------------
388
123
 
389
- */
390
-
391
- billing_state?:string;
392
-
393
- /**
394
- * @description Postal or Zip code, as available in card billing address.
395
-
396
- */
397
-
398
- billing_zip?:string;
399
-
124
+ export interface UpdateCardForCustomerInputParam {
400
125
  /**
401
- * @description The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html).
402
-
403
- **Note** : If you enter an invalid country code, the system will return an error.
404
-
405
- **Brexit**
406
-
407
-
408
- If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then &#x60;XI&#x60; (the code for **United Kingdom -- Northern Ireland**) is available as an option.
409
- .
410
-
411
- */
412
-
413
- billing_country?:string;
414
- }
415
- export interface SwitchGatewayForCustomerResponse {
416
- customer:Customer;
417
-
418
- card:Card;
126
+ * @deprecated Please refer API docs to use other attributes
127
+ */
128
+
129
+ gateway?: Gateway;
130
+ gateway_account_id?: string;
131
+ tmp_token?: string;
132
+ first_name?: string;
133
+ last_name?: string;
134
+ number: string;
135
+ expiry_month: number;
136
+ expiry_year: number;
137
+ cvv?: string;
138
+ billing_addr1?: string;
139
+ billing_addr2?: string;
140
+ billing_city?: string;
141
+ billing_state_code?: string;
142
+ billing_state?: string;
143
+ billing_zip?: string;
144
+ billing_country?: string /**
145
+ * @deprecated Please refer API docs to use other attributes
146
+ */;
147
+
148
+ ip_address?: string;
149
+ customer?: CustomerUpdateCardForCustomerInputParam;
419
150
  }
420
151
  export interface SwitchGatewayForCustomerInputParam {
421
-
422
152
  /**
423
- * @description The gateway account you want to switch to.
153
+ * @deprecated Please refer API docs to use other attributes
154
+ */
424
155
 
425
- */
426
-
427
- gateway_account_id:string;
428
- }
429
- export interface CopyCardForCustomerResponse {
430
- third_party_payment_method:ThirdPartyPaymentMethod;
156
+ gateway?: Gateway;
157
+ gateway_account_id: string;
431
158
  }
432
159
  export interface CopyCardForCustomerInputParam {
433
-
434
- /**
435
- * @description The gateway account you want to copy the card.
436
-
437
- */
438
-
439
- gateway_account_id:string;
160
+ gateway_account_id: string;
440
161
  }
441
- export interface DeleteCardForCustomerResponse {
442
- customer:Customer;
162
+ export interface CustomerUpdateCardForCustomerInputParam {
163
+ /**
164
+ * @deprecated Please refer API docs to use other attributes
165
+ */
166
+ vat_number?: string;
443
167
  }
444
-
445
-
446
168
  }
447
- }
169
+ }