stripe 17.4.0-beta.1 → 17.4.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 (78) hide show
  1. package/CHANGELOG.md +69 -36
  2. package/VERSION +1 -1
  3. package/cjs/resources/Issuing/FraudLiabilityDebits.js +17 -0
  4. package/cjs/resources/PaymentAttemptRecords.js +17 -0
  5. package/cjs/resources/PaymentRecords.js +29 -0
  6. package/cjs/resources.js +28 -6
  7. package/cjs/stripe.core.js +1 -1
  8. package/esm/resources/Issuing/FraudLiabilityDebits.js +14 -0
  9. package/esm/resources/PaymentAttemptRecords.js +14 -0
  10. package/esm/resources/PaymentRecords.js +26 -0
  11. package/esm/resources.js +22 -1
  12. package/esm/stripe.core.js +1 -1
  13. package/package.json +1 -1
  14. package/types/AccountSessions.d.ts +5 -5
  15. package/types/AccountSessionsResource.d.ts +29 -6
  16. package/types/Accounts.d.ts +38 -4
  17. package/types/Billing/CreditBalanceSummaryResource.d.ts +1 -1
  18. package/types/Billing/CreditGrants.d.ts +5 -6
  19. package/types/Billing/CreditGrantsResource.d.ts +11 -11
  20. package/types/Billing/MeterEventsResource.d.ts +1 -1
  21. package/types/Charges.d.ts +5 -5
  22. package/types/Checkout/Sessions.d.ts +59 -2
  23. package/types/Checkout/SessionsResource.d.ts +90 -4
  24. package/types/ConfirmationTokens.d.ts +4 -4
  25. package/types/CustomersResource.d.ts +4 -2
  26. package/types/Disputes.d.ts +1 -1
  27. package/types/EventTypes.d.ts +34 -0
  28. package/types/Events.d.ts +2 -0
  29. package/types/FundingInstructions.d.ts +28 -0
  30. package/types/Identity/VerificationReports.d.ts +1 -1
  31. package/types/Identity/VerificationSessions.d.ts +1 -1
  32. package/types/Identity/VerificationSessionsResource.d.ts +1 -1
  33. package/types/InvoicePayments.d.ts +10 -35
  34. package/types/Invoices.d.ts +8 -1
  35. package/types/InvoicesResource.d.ts +21 -8
  36. package/types/Issuing/Authorizations.d.ts +1 -1
  37. package/types/Issuing/Cards.d.ts +1 -1
  38. package/types/Issuing/FraudLiabilityDebits.d.ts +52 -0
  39. package/types/Issuing/FraudLiabilityDebitsResource.d.ts +52 -0
  40. package/types/Orders.d.ts +2 -1
  41. package/types/OrdersResource.d.ts +4 -2
  42. package/types/PaymentAttemptRecords.d.ts +242 -0
  43. package/types/PaymentAttemptRecordsResource.d.ts +47 -0
  44. package/types/PaymentIntents.d.ts +30 -1
  45. package/types/PaymentIntentsResource.d.ts +6 -3
  46. package/types/PaymentLinksResource.d.ts +9 -2
  47. package/types/PaymentMethods.d.ts +4 -4
  48. package/types/PaymentRecords.d.ts +259 -0
  49. package/types/PaymentRecordsResource.d.ts +455 -0
  50. package/types/QuotePreviewInvoices.d.ts +8 -1
  51. package/types/SetupAttempts.d.ts +2 -2
  52. package/types/SetupIntents.d.ts +2 -1
  53. package/types/SetupIntentsResource.d.ts +7 -4
  54. package/types/Subscriptions.d.ts +2 -0
  55. package/types/SubscriptionsResource.d.ts +4 -0
  56. package/types/Tax/CalculationLineItems.d.ts +1 -0
  57. package/types/Tax/Calculations.d.ts +4 -1
  58. package/types/Tax/CalculationsResource.d.ts +2 -1
  59. package/types/Tax/Transactions.d.ts +3 -1
  60. package/types/TaxIds.d.ts +2 -1
  61. package/types/TaxIdsResource.d.ts +2 -1
  62. package/types/TaxRates.d.ts +1 -0
  63. package/types/TaxRatesResource.d.ts +2 -0
  64. package/types/TestHelpers/Issuing/AuthorizationsResource.d.ts +14 -4
  65. package/types/Treasury/InboundTransfers.d.ts +1 -1
  66. package/types/WebhookEndpointsResource.d.ts +4 -0
  67. package/types/index.d.ts +21 -4
  68. package/types/lib.d.ts +1 -1
  69. package/types/test/typescriptTest.ts +3 -3
  70. package/cjs/resources/V2/Billing.js +0 -18
  71. package/cjs/resources/V2/Core.js +0 -14
  72. package/cjs/resources/V2.js +0 -14
  73. package/esm/resources/V2/Billing.js +0 -15
  74. package/esm/resources/V2/Core.js +0 -11
  75. package/esm/resources/V2.js +0 -11
  76. package/types/V2/BillingResource.d.ts +0 -14
  77. package/types/V2/CoreResource.d.ts +0 -12
  78. package/types/V2Resource.d.ts +0 -10
@@ -0,0 +1,242 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ /**
6
+ * A Payment Attempt Record represents an individual attempt at making a payment, on or off Stripe.
7
+ * Each payment attempt tries to collect a fixed amount of money from a fixed customer and payment
8
+ * method. Payment Attempt Records are attached to Payment Records. Only one attempt per Payment Record
9
+ * can have guaranteed funds.
10
+ */
11
+ interface PaymentAttemptRecord {
12
+ /**
13
+ * Unique identifier for the object.
14
+ */
15
+ id: string;
16
+
17
+ /**
18
+ * String representing the object's type. Objects of the same type share the same value.
19
+ */
20
+ object: 'payment_attempt_record';
21
+
22
+ /**
23
+ * A representation of an amount of money, consisting of an amount and a currency.
24
+ */
25
+ amount_canceled: PaymentAttemptRecord.AmountCanceled;
26
+
27
+ /**
28
+ * A representation of an amount of money, consisting of an amount and a currency.
29
+ */
30
+ amount_failed: PaymentAttemptRecord.AmountFailed;
31
+
32
+ /**
33
+ * A representation of an amount of money, consisting of an amount and a currency.
34
+ */
35
+ amount_guaranteed: PaymentAttemptRecord.AmountGuaranteed;
36
+
37
+ /**
38
+ * A representation of an amount of money, consisting of an amount and a currency.
39
+ */
40
+ amount_requested: PaymentAttemptRecord.AmountRequested;
41
+
42
+ /**
43
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
44
+ */
45
+ created: number;
46
+
47
+ /**
48
+ * Customer information for this payment.
49
+ */
50
+ customer_details: PaymentAttemptRecord.CustomerDetails | null;
51
+
52
+ /**
53
+ * Indicates whether the customer was present in your checkout flow during this payment.
54
+ */
55
+ customer_presence: PaymentAttemptRecord.CustomerPresence | null;
56
+
57
+ /**
58
+ * An arbitrary string attached to the object. Often useful for displaying to users.
59
+ */
60
+ description: string | null;
61
+
62
+ /**
63
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
64
+ */
65
+ livemode: boolean;
66
+
67
+ /**
68
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
69
+ */
70
+ metadata: Stripe.Metadata | null;
71
+
72
+ /**
73
+ * Information about the Payment Method debited for this payment.
74
+ */
75
+ payment_method_details: PaymentAttemptRecord.PaymentMethodDetails | null;
76
+
77
+ /**
78
+ * ID of the Payment Record this Payment Attempt Record belongs to.
79
+ */
80
+ payment_record: string;
81
+
82
+ /**
83
+ * An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID.
84
+ */
85
+ payment_reference: string | null;
86
+
87
+ /**
88
+ * Shipping information for this payment.
89
+ */
90
+ shipping_details: PaymentAttemptRecord.ShippingDetails | null;
91
+ }
92
+
93
+ namespace PaymentAttemptRecord {
94
+ interface AmountCanceled {
95
+ /**
96
+ * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
97
+ */
98
+ currency: string;
99
+
100
+ /**
101
+ * A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency).
102
+ */
103
+ value: number;
104
+ }
105
+
106
+ interface AmountFailed {
107
+ /**
108
+ * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
109
+ */
110
+ currency: string;
111
+
112
+ /**
113
+ * A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency).
114
+ */
115
+ value: number;
116
+ }
117
+
118
+ interface AmountGuaranteed {
119
+ /**
120
+ * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
121
+ */
122
+ currency: string;
123
+
124
+ /**
125
+ * A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency).
126
+ */
127
+ value: number;
128
+ }
129
+
130
+ interface AmountRequested {
131
+ /**
132
+ * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
133
+ */
134
+ currency: string;
135
+
136
+ /**
137
+ * A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency).
138
+ */
139
+ value: number;
140
+ }
141
+
142
+ interface CustomerDetails {
143
+ /**
144
+ * ID of the Stripe Customer associated with this payment.
145
+ */
146
+ customer: string | null;
147
+
148
+ /**
149
+ * The customer's email address.
150
+ */
151
+ email: string | null;
152
+
153
+ /**
154
+ * The customer's name.
155
+ */
156
+ name: string | null;
157
+
158
+ /**
159
+ * The customer's phone number.
160
+ */
161
+ phone: string | null;
162
+ }
163
+
164
+ type CustomerPresence = 'off_session' | 'on_session';
165
+
166
+ interface PaymentMethodDetails {
167
+ /**
168
+ * The billing details associated with the method of payment.
169
+ */
170
+ billing_details: PaymentMethodDetails.BillingDetails | null;
171
+
172
+ /**
173
+ * Information about the custom (user-defined) payment method used to make this payment.
174
+ */
175
+ custom: PaymentMethodDetails.Custom | null;
176
+
177
+ /**
178
+ * ID of the Stripe PaymentMethod used to make this payment.
179
+ */
180
+ payment_method: string | null;
181
+
182
+ /**
183
+ * The type of Payment Method used for this payment attempt.
184
+ */
185
+ type: 'custom';
186
+ }
187
+
188
+ namespace PaymentMethodDetails {
189
+ interface BillingDetails {
190
+ /**
191
+ * A representation of a physical address.
192
+ */
193
+ address: Stripe.Address;
194
+
195
+ /**
196
+ * The billing email associated with the method of payment.
197
+ */
198
+ email: string | null;
199
+
200
+ /**
201
+ * The billing name associated with the method of payment.
202
+ */
203
+ name: string | null;
204
+
205
+ /**
206
+ * The billing phone number associated with the method of payment.
207
+ */
208
+ phone: string | null;
209
+ }
210
+
211
+ interface Custom {
212
+ /**
213
+ * Display name for the custom (user-defined) payment method type used to make this payment.
214
+ */
215
+ display_name: string;
216
+
217
+ /**
218
+ * The custom payment method type associated with this payment.
219
+ */
220
+ type: string | null;
221
+ }
222
+ }
223
+
224
+ interface ShippingDetails {
225
+ /**
226
+ * A representation of a physical address.
227
+ */
228
+ address: Stripe.Address;
229
+
230
+ /**
231
+ * The shipping recipient's name.
232
+ */
233
+ name: string | null;
234
+
235
+ /**
236
+ * The shipping recipient's phone number.
237
+ */
238
+ phone: string | null;
239
+ }
240
+ }
241
+ }
242
+ }
@@ -0,0 +1,47 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ interface PaymentAttemptRecordRetrieveParams {
6
+ /**
7
+ * Specifies which fields in the response should be expanded.
8
+ */
9
+ expand?: Array<string>;
10
+ }
11
+
12
+ interface PaymentAttemptRecordListParams {
13
+ /**
14
+ * The ID of the Payment Record.
15
+ */
16
+ payment_record: string;
17
+
18
+ /**
19
+ * Specifies which fields in the response should be expanded.
20
+ */
21
+ expand?: Array<string>;
22
+ }
23
+
24
+ class PaymentAttemptRecordsResource {
25
+ /**
26
+ * Retrieves a Payment Attempt Record with the given ID
27
+ */
28
+ retrieve(
29
+ id: string,
30
+ params?: PaymentAttemptRecordRetrieveParams,
31
+ options?: RequestOptions
32
+ ): Promise<Stripe.Response<Stripe.PaymentAttemptRecord>>;
33
+ retrieve(
34
+ id: string,
35
+ options?: RequestOptions
36
+ ): Promise<Stripe.Response<Stripe.PaymentAttemptRecord>>;
37
+
38
+ /**
39
+ * List all the Payment Attempt Records attached to the specified Payment Record.
40
+ */
41
+ list(
42
+ params: PaymentAttemptRecordListParams,
43
+ options?: RequestOptions
44
+ ): ApiListPromise<Stripe.PaymentAttemptRecord>;
45
+ }
46
+ }
47
+ }
@@ -156,7 +156,7 @@ declare module 'stripe' {
156
156
  payment_method: string | Stripe.PaymentMethod | null;
157
157
 
158
158
  /**
159
- * Information about the payment method configuration used for this PaymentIntent.
159
+ * Information about the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) used for this PaymentIntent.
160
160
  */
161
161
  payment_method_configuration_details: PaymentIntent.PaymentMethodConfigurationDetails | null;
162
162
 
@@ -808,11 +808,25 @@ declare module 'stripe' {
808
808
 
809
809
  namespace FinancialAddress {
810
810
  interface Aba {
811
+ account_holder_address: Stripe.Address;
812
+
813
+ /**
814
+ * The account holder name
815
+ */
816
+ account_holder_name: string;
817
+
811
818
  /**
812
819
  * The ABA account number
813
820
  */
814
821
  account_number: string;
815
822
 
823
+ /**
824
+ * The account type
825
+ */
826
+ account_type: string;
827
+
828
+ bank_address: Stripe.Address;
829
+
816
830
  /**
817
831
  * The bank name
818
832
  */
@@ -891,11 +905,25 @@ declare module 'stripe' {
891
905
  | 'zengin';
892
906
 
893
907
  interface Swift {
908
+ account_holder_address: Stripe.Address;
909
+
910
+ /**
911
+ * The account holder name
912
+ */
913
+ account_holder_name: string;
914
+
894
915
  /**
895
916
  * The account number
896
917
  */
897
918
  account_number: string;
898
919
 
920
+ /**
921
+ * The account type
922
+ */
923
+ account_type: string;
924
+
925
+ bank_address: Stripe.Address;
926
+
899
927
  /**
900
928
  * The bank name
901
929
  */
@@ -2145,6 +2173,7 @@ declare module 'stripe' {
2145
2173
  | 'girocard'
2146
2174
  | 'interac'
2147
2175
  | 'jcb'
2176
+ | 'link'
2148
2177
  | 'mastercard'
2149
2178
  | 'unionpay'
2150
2179
  | 'unknown'
@@ -112,7 +112,7 @@ declare module 'stripe' {
112
112
  payment_method?: string;
113
113
 
114
114
  /**
115
- * The ID of the payment method configuration to use with this PaymentIntent.
115
+ * The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
116
116
  */
117
117
  payment_method_configuration?: string;
118
118
 
@@ -129,7 +129,7 @@ declare module 'stripe' {
129
129
  payment_method_options?: PaymentIntentCreateParams.PaymentMethodOptions;
130
130
 
131
131
  /**
132
- * The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, it defaults to ["card"]. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
132
+ * The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).
133
133
  */
134
134
  payment_method_types?: Array<string>;
135
135
 
@@ -2468,6 +2468,7 @@ declare module 'stripe' {
2468
2468
  | 'girocard'
2469
2469
  | 'interac'
2470
2470
  | 'jcb'
2471
+ | 'link'
2471
2472
  | 'mastercard'
2472
2473
  | 'unionpay'
2473
2474
  | 'unknown'
@@ -3920,7 +3921,7 @@ declare module 'stripe' {
3920
3921
  payment_method?: string;
3921
3922
 
3922
3923
  /**
3923
- * The ID of the payment method configuration to use with this PaymentIntent.
3924
+ * The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
3924
3925
  */
3925
3926
  payment_method_configuration?: string;
3926
3927
 
@@ -6223,6 +6224,7 @@ declare module 'stripe' {
6223
6224
  | 'girocard'
6224
6225
  | 'interac'
6225
6226
  | 'jcb'
6227
+ | 'link'
6226
6228
  | 'mastercard'
6227
6229
  | 'unionpay'
6228
6230
  | 'unknown'
@@ -10733,6 +10735,7 @@ declare module 'stripe' {
10733
10735
  | 'girocard'
10734
10736
  | 'interac'
10735
10737
  | 'jcb'
10738
+ | 'link'
10736
10739
  | 'mastercard'
10737
10740
  | 'unionpay'
10738
10741
  | 'unknown'
@@ -665,7 +665,7 @@ declare module 'stripe' {
665
665
  interface ShippingAddressCollection {
666
666
  /**
667
667
  * An array of two-letter ISO country codes representing which countries Checkout should provide as options for
668
- * shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.
668
+ * shipping locations.
669
669
  */
670
670
  allowed_countries: Array<ShippingAddressCollection.AllowedCountry>;
671
671
  }
@@ -1134,6 +1134,11 @@ declare module 'stripe' {
1134
1134
  PaymentLinkUpdateParams.ShippingAddressCollection
1135
1135
  >;
1136
1136
 
1137
+ /**
1138
+ * Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`).
1139
+ */
1140
+ submit_type?: PaymentLinkUpdateParams.SubmitType;
1141
+
1137
1142
  /**
1138
1143
  * When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.
1139
1144
  */
@@ -1589,7 +1594,7 @@ declare module 'stripe' {
1589
1594
  interface ShippingAddressCollection {
1590
1595
  /**
1591
1596
  * An array of two-letter ISO country codes representing which countries Checkout should provide as options for
1592
- * shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.
1597
+ * shipping locations.
1593
1598
  */
1594
1599
  allowed_countries: Array<ShippingAddressCollection.AllowedCountry>;
1595
1600
  }
@@ -1835,6 +1840,8 @@ declare module 'stripe' {
1835
1840
  | 'ZZ';
1836
1841
  }
1837
1842
 
1843
+ type SubmitType = 'auto' | 'book' | 'donate' | 'pay';
1844
+
1838
1845
  interface SubscriptionData {
1839
1846
  /**
1840
1847
  * All invoices will be billed using the specified settings.
@@ -271,7 +271,7 @@ declare module 'stripe' {
271
271
 
272
272
  interface Card {
273
273
  /**
274
- * Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
274
+ * Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
275
275
  */
276
276
  brand: string;
277
277
 
@@ -406,7 +406,7 @@ declare module 'stripe' {
406
406
  amount_authorized: number | null;
407
407
 
408
408
  /**
409
- * Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
409
+ * Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
410
410
  */
411
411
  brand: string | null;
412
412
 
@@ -488,7 +488,7 @@ declare module 'stripe' {
488
488
  last4: string | null;
489
489
 
490
490
  /**
491
- * Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
491
+ * Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
492
492
  */
493
493
  network: string | null;
494
494
 
@@ -731,7 +731,7 @@ declare module 'stripe' {
731
731
 
732
732
  interface CardPresent {
733
733
  /**
734
- * Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
734
+ * Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
735
735
  */
736
736
  brand: string | null;
737
737