stripe 21.2.0.pre.alpha.1 → 21.2.0.pre.alpha.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 (137) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_operations/singleton_save.rb +4 -4
  3. data/lib/stripe/api_version.rb +1 -1
  4. data/lib/stripe/event_types.rb +22 -0
  5. data/lib/stripe/events/v2_money_management_dispute_adjustment_created_event.rb +44 -0
  6. data/lib/stripe/events/v2_money_management_dispute_created_event.rb +44 -0
  7. data/lib/stripe/events/v2_money_management_dispute_lost_event.rb +44 -0
  8. data/lib/stripe/events/v2_money_management_dispute_updated_event.rb +44 -0
  9. data/lib/stripe/events/v2_money_management_dispute_won_event.rb +44 -0
  10. data/lib/stripe/events/v2_risk_evaluation_outcome_delinquency_ready_event.rb +44 -0
  11. data/lib/stripe/object_types.rb +3 -0
  12. data/lib/stripe/params/balance_transaction_list_params.rb +2 -2
  13. data/lib/stripe/params/billing_portal/session_create_params.rb +13 -0
  14. data/lib/stripe/params/checkout/session_create_params.rb +208 -4
  15. data/lib/stripe/params/crypto/onramp_session_checkout_params.rb +37 -1
  16. data/lib/stripe/params/crypto/onramp_session_create_params.rb +4 -0
  17. data/lib/stripe/params/customer_create_params.rb +7 -1
  18. data/lib/stripe/params/customer_update_params.rb +7 -1
  19. data/lib/stripe/params/invoice_rendering_template_create_params.rb +14 -2
  20. data/lib/stripe/params/invoice_rendering_template_update_params.rb +14 -2
  21. data/lib/stripe/params/issuing/authorization_create_params.rb +1 -1
  22. data/lib/stripe/params/payment_intent_confirm_params.rb +96 -4
  23. data/lib/stripe/params/payment_intent_create_params.rb +96 -4
  24. data/lib/stripe/params/payment_intent_update_params.rb +96 -4
  25. data/lib/stripe/params/payment_method_configuration_create_params.rb +63 -0
  26. data/lib/stripe/params/payment_method_configuration_update_params.rb +63 -0
  27. data/lib/stripe/params/tax/calculation_create_params.rb +1 -1
  28. data/lib/stripe/params/terminal/configuration_create_params.rb +1 -1
  29. data/lib/stripe/params/terminal/configuration_update_params.rb +1 -1
  30. data/lib/stripe/params/terminal/reader_refund_payment_params.rb +15 -1
  31. data/lib/stripe/params/test_helpers/issuing/authorization_create_params.rb +1 -1
  32. data/lib/stripe/params/v2/billing/contract_create_params.rb +182 -9
  33. data/lib/stripe/params/v2/billing/contract_update_params.rb +328 -16
  34. data/lib/stripe/params/v2/core/account_create_params.rb +432 -3
  35. data/lib/stripe/params/v2/core/account_token_create_params.rb +4 -1
  36. data/lib/stripe/params/v2/core/account_update_params.rb +436 -4
  37. data/lib/stripe/params/v2/core/fee_batch_list_params.rb +7 -1
  38. data/lib/stripe/params/v2/money_management/dispute_adjustment_list_params.rb +23 -0
  39. data/lib/stripe/params/v2/money_management/dispute_adjustment_retrieve_params.rb +10 -0
  40. data/lib/stripe/params/v2/money_management/dispute_create_params.rb +37 -0
  41. data/lib/stripe/params/v2/money_management/dispute_list_params.rb +26 -0
  42. data/lib/stripe/params/v2/money_management/dispute_retrieve_params.rb +10 -0
  43. data/lib/stripe/params/v2/money_management/financial_account_update_params.rb +41 -1
  44. data/lib/stripe/params/v2/money_management/inbound_transfer_mandate_create_params.rb +24 -8
  45. data/lib/stripe/params/v2/money_management/spending_mandate_create_params.rb +51 -0
  46. data/lib/stripe/params/v2/money_management/spending_mandate_list_params.rb +4 -1
  47. data/lib/stripe/params/v2/money_management/spending_mandate_update_params.rb +39 -0
  48. data/lib/stripe/params/v2/money_management/test_helpers/financial_address_debit_params.rb +20 -1
  49. data/lib/stripe/params/v2/risk/evaluation_outcome_list_params.rb +34 -0
  50. data/lib/stripe/params/v2/risk/evaluation_outcome_retrieve_params.rb +10 -0
  51. data/lib/stripe/params/v2/test_helpers/money_management/inbound_transfer_fail_params.rb +19 -0
  52. data/lib/stripe/params/v2/test_helpers/money_management/inbound_transfer_succeed_params.rb +12 -0
  53. data/lib/stripe/params.rb +27 -5
  54. data/lib/stripe/resources/billing_portal/session.rb +16 -0
  55. data/lib/stripe/resources/cash_balance.rb +1 -1
  56. data/lib/stripe/resources/charge.rb +32 -0
  57. data/lib/stripe/resources/checkout/session.rb +65 -2
  58. data/lib/stripe/resources/confirmation_token.rb +54 -2
  59. data/lib/stripe/resources/customer.rb +4 -0
  60. data/lib/stripe/resources/customer_tax_exemption.rb +2 -0
  61. data/lib/stripe/resources/dispute.rb +4 -0
  62. data/lib/stripe/resources/identity/verification_report.rb +34 -0
  63. data/lib/stripe/resources/invoice.rb +0 -30
  64. data/lib/stripe/resources/invoice_rendering_template.rb +19 -1
  65. data/lib/stripe/resources/issuing/authorization.rb +18 -0
  66. data/lib/stripe/resources/issuing/card.rb +28 -0
  67. data/lib/stripe/resources/issuing/transaction.rb +18 -0
  68. data/lib/stripe/resources/mandate.rb +65 -0
  69. data/lib/stripe/resources/payment_attempt_record.rb +46 -0
  70. data/lib/stripe/resources/payment_intent.rb +113 -103
  71. data/lib/stripe/resources/payment_link.rb +2 -0
  72. data/lib/stripe/resources/payment_method.rb +53 -1
  73. data/lib/stripe/resources/payment_method_configuration.rb +102 -0
  74. data/lib/stripe/resources/payment_record.rb +46 -0
  75. data/lib/stripe/resources/quote_preview_invoice.rb +0 -30
  76. data/lib/stripe/resources/radar/account_evaluation.rb +36 -2
  77. data/lib/stripe/resources/reserve/plan.rb +1 -1
  78. data/lib/stripe/resources/risk/form.rb +44 -1
  79. data/lib/stripe/resources/setup_attempt.rb +91 -0
  80. data/lib/stripe/resources/setup_intent.rb +1 -1
  81. data/lib/stripe/resources/source.rb +2 -2
  82. data/lib/stripe/resources/subscription.rb +0 -20
  83. data/lib/stripe/resources/tax/calculation.rb +1 -1
  84. data/lib/stripe/resources/tax/form.rb +6 -0
  85. data/lib/stripe/resources/tax/transaction.rb +1 -1
  86. data/lib/stripe/resources/terminal/configuration.rb +1 -1
  87. data/lib/stripe/resources/terminal/onboarding_link.rb +2 -1
  88. data/lib/stripe/resources/terminal/reader.rb +17 -1
  89. data/lib/stripe/resources/test_helpers/test_clock.rb +1 -1
  90. data/lib/stripe/resources/three_d_secure/authentication.rb +1 -1
  91. data/lib/stripe/resources/v2/billing/contract.rb +285 -6
  92. data/lib/stripe/resources/v2/billing/contract_term.rb +133 -6
  93. data/lib/stripe/resources/v2/core/account.rb +2709 -322
  94. data/lib/stripe/resources/v2/core/fee_batch.rb +3 -0
  95. data/lib/stripe/resources/v2/core/fee_entry.rb +33 -3
  96. data/lib/stripe/resources/v2/money_management/dispute.rb +78 -0
  97. data/lib/stripe/resources/v2/money_management/dispute_adjustment.rb +53 -0
  98. data/lib/stripe/resources/v2/money_management/financial_account.rb +45 -0
  99. data/lib/stripe/resources/v2/money_management/inbound_transfer_mandate.rb +6 -4
  100. data/lib/stripe/resources/v2/money_management/received_debit.rb +27 -1
  101. data/lib/stripe/resources/v2/money_management/spending_mandate.rb +18 -2
  102. data/lib/stripe/resources/v2/money_management/transaction.rb +2 -0
  103. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +2 -0
  104. data/lib/stripe/resources/v2/risk/evaluation_outcome.rb +305 -0
  105. data/lib/stripe/resources/v2/signals/account_evaluation.rb +34 -0
  106. data/lib/stripe/resources/v2/signals/account_signal.rb +23 -0
  107. data/lib/stripe/resources.rb +30 -0
  108. data/lib/stripe/services/checkout/session_service.rb +1 -1
  109. data/lib/stripe/services/payment_intent_service.rb +0 -11
  110. data/lib/stripe/services/risk/form_service.rb +44 -1
  111. data/lib/stripe/services/subscription_service.rb +0 -11
  112. data/lib/stripe/services/terminal/onboarding_link_service.rb +1 -0
  113. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +1 -1
  114. data/lib/stripe/services/v2/core/fee_batch_service.rb +4 -1
  115. data/lib/stripe/services/v2/core/fee_entry_service.rb +3 -1
  116. data/lib/stripe/services/v2/money_management/debit_dispute_service.rb +1 -0
  117. data/lib/stripe/services/v2/money_management/dispute_adjustment_service.rb +32 -0
  118. data/lib/stripe/services/v2/money_management/dispute_service.rb +46 -0
  119. data/lib/stripe/services/v2/money_management/inbound_transfer_mandate_service.rb +6 -3
  120. data/lib/stripe/services/v2/money_management/spending_mandate_service.rb +26 -0
  121. data/lib/stripe/services/v2/money_management_service.rb +3 -1
  122. data/lib/stripe/services/v2/risk/evaluation_outcome_service.rb +32 -0
  123. data/lib/stripe/services/v2/risk_service.rb +2 -1
  124. data/lib/stripe/services/v2/test_helpers/money_management/inbound_transfer_service.rb +34 -0
  125. data/lib/stripe/services/v2/test_helpers/money_management_service.rb +8 -0
  126. data/lib/stripe/services.rb +11 -0
  127. data/lib/stripe/stripe_client.rb +1 -1
  128. data/lib/stripe/stripe_event_notification_handler.rb +24 -0
  129. data/lib/stripe/stripe_object.rb +14 -4
  130. data/lib/stripe/util.rb +21 -2
  131. data/lib/stripe/v2_type_coercion.rb +6 -2
  132. data/lib/stripe/version.rb +1 -1
  133. data/lib/stripe/webhook.rb +1 -0
  134. data/rbi/stripe.rbi +8211 -782
  135. metadata +26 -4
  136. data/lib/stripe/params/payment_intent_update_crypto_refund_address_params.rb +0 -19
  137. data/lib/stripe/params/subscription_attach_cadence_params.rb +0 -16
@@ -0,0 +1,305 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Risk
7
+ # An immutable, point-in-time risk evaluation result that captures recommended controls and
8
+ # their expected impact. The type identifies the scenario evaluated and its corresponding details.
9
+ # Unavailable optional values are null.
10
+ class EvaluationOutcome < APIResource
11
+ OBJECT_NAME = "v2.risk.evaluation_outcome"
12
+ def self.object_name
13
+ "v2.risk.evaluation_outcome"
14
+ end
15
+
16
+ class AccountDetails < ::Stripe::StripeObject
17
+ class Data < ::Stripe::StripeObject
18
+ # Contact email supplied for the evaluation, or null when unavailable.
19
+ attr_reader :contact_email
20
+
21
+ def self.inner_class_types
22
+ @inner_class_types = {}
23
+ end
24
+
25
+ def self.field_remappings
26
+ @field_remappings = {}
27
+ end
28
+ end
29
+ # Connected account evaluated.
30
+ attr_reader :account
31
+ # Customer evaluated.
32
+ attr_reader :customer
33
+ # Inline subject data for an evaluation without a Stripe entity.
34
+ attr_reader :data
35
+
36
+ def self.inner_class_types
37
+ @inner_class_types = { data: Data }
38
+ end
39
+
40
+ def self.field_remappings
41
+ @field_remappings = {}
42
+ end
43
+ end
44
+
45
+ class Delinquency < ::Stripe::StripeObject
46
+ class BusinessObjective < ::Stripe::StripeObject
47
+ class BaselineOutcome < ::Stripe::StripeObject
48
+ # Expected financial loss from delinquency under this reserve configuration, expressed as a negative amount.
49
+ attr_reader :loss
50
+ # Expected financial result after accounting for revenue and losses. Can be negative.
51
+ attr_reader :profitability
52
+ # Expected revenue under this reserve configuration.
53
+ attr_reader :revenue
54
+
55
+ def self.inner_class_types
56
+ @inner_class_types = {}
57
+ end
58
+
59
+ def self.field_remappings
60
+ @field_remappings = {}
61
+ end
62
+ end
63
+
64
+ class ProjectedOutcome < ::Stripe::StripeObject
65
+ # Expected financial loss from delinquency under this reserve configuration, expressed as a negative amount.
66
+ attr_reader :loss
67
+ # Expected financial result after accounting for revenue and losses. Can be negative.
68
+ attr_reader :profitability
69
+ # Expected revenue under this reserve configuration.
70
+ attr_reader :revenue
71
+
72
+ def self.inner_class_types
73
+ @inner_class_types = {}
74
+ end
75
+
76
+ def self.field_remappings
77
+ @field_remappings = {}
78
+ end
79
+ end
80
+ # Expected profitability, revenue, and losses if the current reserve configuration remains unchanged.
81
+ # Provides a comparison for projected_outcome. Null when not reliably quantifiable.
82
+ attr_reader :baseline_outcome
83
+ # Expected profitability, revenue, and losses if the recommended controls are applied. Equals
84
+ # baseline_outcome when the recommendation maintains the current state. Null when not reliably quantifiable.
85
+ attr_reader :projected_outcome
86
+ # The financial objective the recommended controls are intended to improve.
87
+ attr_reader :type
88
+
89
+ def self.inner_class_types
90
+ @inner_class_types = {
91
+ baseline_outcome: BaselineOutcome,
92
+ projected_outcome: ProjectedOutcome,
93
+ }
94
+ end
95
+
96
+ def self.field_remappings
97
+ @field_remappings = {}
98
+ end
99
+ end
100
+
101
+ class Control < ::Stripe::StripeObject
102
+ class RiskReserve < ::Stripe::StripeObject
103
+ class Target < ::Stripe::StripeObject
104
+ # Integer percentage of funds to reserve.
105
+ attr_reader :percent
106
+ # Integer number of days after which reserved funds are released.
107
+ attr_reader :release_after_days
108
+ # How reserved funds are released.
109
+ attr_reader :release_type
110
+ # Whether to reserve already available funds as well as future funds.
111
+ attr_reader :sweep_available_funds
112
+
113
+ def self.inner_class_types
114
+ @inner_class_types = {}
115
+ end
116
+
117
+ def self.field_remappings
118
+ @field_remappings = {}
119
+ end
120
+ end
121
+ # Whether to update, maintain, or clear reserves.
122
+ attr_reader :action
123
+ # Recommended reserve configuration, specifying the percentage of funds to hold, when to release
124
+ # them, and whether to include available funds. Populated for update_reserve; null for
125
+ # maintain_current_state and clear_reserve.
126
+ attr_reader :target
127
+
128
+ def self.inner_class_types
129
+ @inner_class_types = { target: Target }
130
+ end
131
+
132
+ def self.field_remappings
133
+ @field_remappings = {}
134
+ end
135
+ end
136
+ # The recommended action for funds held in reserve, including a target configuration when
137
+ # updating reserves. Populated when type is risk_reserve; null otherwise.
138
+ attr_reader :risk_reserve
139
+ # The kind of control recommended to manage risk.
140
+ attr_reader :type
141
+
142
+ def self.inner_class_types
143
+ @inner_class_types = { risk_reserve: RiskReserve }
144
+ end
145
+
146
+ def self.field_remappings
147
+ @field_remappings = {}
148
+ end
149
+ end
150
+
151
+ class RiskAppetite < ::Stripe::StripeObject
152
+ # How the recommendation prioritizes protection from losses relative to revenue.
153
+ attr_reader :mode
154
+
155
+ def self.inner_class_types
156
+ @inner_class_types = {}
157
+ end
158
+
159
+ def self.field_remappings
160
+ @field_remappings = {}
161
+ end
162
+ end
163
+
164
+ class SupportingSignals < ::Stripe::StripeObject
165
+ class MerchantDelinquency < ::Stripe::StripeObject
166
+ # Time the signal was evaluated.
167
+ attr_reader :evaluated_at
168
+ # Probability of delinquency, represented as a decimal string. Null when the risk level is
169
+ # unknown or the account signal does not include a numeric score.
170
+ attr_reader :probability
171
+ # Assessed risk level.
172
+ attr_reader :risk_level
173
+ # ID of the supporting account signal.
174
+ attr_reader :signal
175
+
176
+ def self.inner_class_types
177
+ @inner_class_types = {}
178
+ end
179
+
180
+ def self.field_remappings
181
+ @field_remappings = {}
182
+ end
183
+
184
+ def self.field_encodings
185
+ @field_encodings = { probability: :decimal_string }
186
+ end
187
+ end
188
+
189
+ class PaymentDelinquencyExposure < ::Stripe::StripeObject
190
+ # Time the signal was evaluated.
191
+ attr_reader :evaluated_at
192
+ # Exposure if the account becomes delinquent.
193
+ attr_reader :exposure_amount
194
+ # ID of the supporting account signal.
195
+ attr_reader :signal
196
+
197
+ def self.inner_class_types
198
+ @inner_class_types = {}
199
+ end
200
+
201
+ def self.field_remappings
202
+ @field_remappings = {}
203
+ end
204
+ end
205
+ # The account's assessed probability and level of delinquency risk. Null when unavailable.
206
+ attr_reader :merchant_delinquency
207
+ # The account's assessed financial exposure if it becomes delinquent. Null when unavailable.
208
+ attr_reader :payment_delinquency_exposure
209
+
210
+ def self.inner_class_types
211
+ @inner_class_types = {
212
+ merchant_delinquency: MerchantDelinquency,
213
+ payment_delinquency_exposure: PaymentDelinquencyExposure,
214
+ }
215
+ end
216
+
217
+ def self.field_remappings
218
+ @field_remappings = {}
219
+ end
220
+
221
+ def self.field_encodings
222
+ @field_encodings = {
223
+ merchant_delinquency: { kind: :object, fields: { probability: :decimal_string } },
224
+ }
225
+ end
226
+ end
227
+ # The objective of the recommendation, with expected financial outcomes for the recommended
228
+ # controls and the current configuration when those outcomes can be quantified.
229
+ attr_reader :business_objective
230
+ # Risk controls recommended to manage the account's delinquency risk.
231
+ attr_reader :controls
232
+ # The balance between loss protection and revenue used to generate this recommendation.
233
+ attr_reader :risk_appetite
234
+ # Signals that informed this evaluation, with their values at evaluation time. Null when unavailable.
235
+ attr_reader :supporting_signals
236
+
237
+ def self.inner_class_types
238
+ @inner_class_types = {
239
+ business_objective: BusinessObjective,
240
+ controls: Control,
241
+ risk_appetite: RiskAppetite,
242
+ supporting_signals: SupportingSignals,
243
+ }
244
+ end
245
+
246
+ def self.field_remappings
247
+ @field_remappings = {}
248
+ end
249
+
250
+ def self.field_encodings
251
+ @field_encodings = {
252
+ supporting_signals: {
253
+ kind: :object,
254
+ fields: {
255
+ merchant_delinquency: { kind: :object, fields: { probability: :decimal_string } },
256
+ },
257
+ },
258
+ }
259
+ end
260
+ end
261
+ # Subject of the evaluation. Exactly one of account, customer, or data is provided.
262
+ attr_reader :account_details
263
+ # Timestamp when the evaluation was created.
264
+ attr_reader :created
265
+ # Recommended controls, expected financial impact, and supporting signals for a delinquency
266
+ # evaluation. Populated when type is delinquency; null otherwise.
267
+ attr_reader :delinquency
268
+ # Unique identifier for the evaluation outcome, prefixed with evalout_.
269
+ attr_reader :id
270
+ # Whether the evaluation outcome is in live mode.
271
+ attr_reader :livemode
272
+ # String representing the object's type. Objects of the same type share the same value of the object field.
273
+ attr_reader :object
274
+ # How the outcome was generated.
275
+ attr_reader :origin
276
+ # Scenario evaluated; determines which type-specific payload is provided.
277
+ attr_reader :type
278
+
279
+ def self.inner_class_types
280
+ @inner_class_types = { account_details: AccountDetails, delinquency: Delinquency }
281
+ end
282
+
283
+ def self.field_remappings
284
+ @field_remappings = {}
285
+ end
286
+
287
+ def self.field_encodings
288
+ @field_encodings = {
289
+ delinquency: {
290
+ kind: :object,
291
+ fields: {
292
+ supporting_signals: {
293
+ kind: :object,
294
+ fields: {
295
+ merchant_delinquency: { kind: :object, fields: { probability: :decimal_string } },
296
+ },
297
+ },
298
+ },
299
+ },
300
+ }
301
+ end
302
+ end
303
+ end
304
+ end
305
+ end
@@ -193,6 +193,29 @@ module Stripe
193
193
  end
194
194
  end
195
195
 
196
+ class UserBuyerClassification < ::Stripe::StripeObject
197
+ # Predicted type of buyer behind the user.
198
+ attr_reader :buyer_type
199
+ # The score for the predicted buyer type, between 0.00 and 100.00. Absent when buyer_type is unknown.
200
+ attr_reader :buyer_type_score
201
+ # Timestamp at which the signal was evaluated.
202
+ attr_reader :evaluated_at
203
+ # The account signal ID containing the full user buyer classification signal result.
204
+ attr_reader :signal
205
+
206
+ def self.inner_class_types
207
+ @inner_class_types = {}
208
+ end
209
+
210
+ def self.field_remappings
211
+ @field_remappings = {}
212
+ end
213
+
214
+ def self.field_encodings
215
+ @field_encodings = { buyer_type_score: :decimal_string }
216
+ end
217
+ end
218
+
196
219
  class UserMultiAccounting < ::Stripe::StripeObject
197
220
  # Timestamp at which the signal was evaluated.
198
221
  attr_reader :evaluated_at
@@ -223,6 +246,8 @@ module Stripe
223
246
  attr_reader :user_account_sharing
224
247
  # User affinity result for the evaluation, when available.
225
248
  attr_reader :user_affinity
249
+ # User buyer classification result for the evaluation, when available.
250
+ attr_reader :user_buyer_classification
226
251
  # User multi-accounting result for the evaluation, when available.
227
252
  attr_reader :user_multi_accounting
228
253
 
@@ -232,6 +257,7 @@ module Stripe
232
257
  fraudulent_website: FraudulentWebsite,
233
258
  user_account_sharing: UserAccountSharing,
234
259
  user_affinity: UserAffinity,
260
+ user_buyer_classification: UserBuyerClassification,
235
261
  user_multi_accounting: UserMultiAccounting,
236
262
  }
237
263
  end
@@ -244,6 +270,10 @@ module Stripe
244
270
  @field_encodings = {
245
271
  user_account_sharing: { kind: :object, fields: { score: :decimal_string } },
246
272
  user_affinity: { kind: :object, fields: { score: :decimal_string } },
273
+ user_buyer_classification: {
274
+ kind: :object,
275
+ fields: { buyer_type_score: :decimal_string },
276
+ },
247
277
  user_multi_accounting: { kind: :object, fields: { score: :decimal_string } },
248
278
  }
249
279
  end
@@ -286,6 +316,10 @@ module Stripe
286
316
  fields: {
287
317
  user_account_sharing: { kind: :object, fields: { score: :decimal_string } },
288
318
  user_affinity: { kind: :object, fields: { score: :decimal_string } },
319
+ user_buyer_classification: {
320
+ kind: :object,
321
+ fields: { buyer_type_score: :decimal_string },
322
+ },
289
323
  user_multi_accounting: { kind: :object, fields: { score: :decimal_string } },
290
324
  },
291
325
  },
@@ -324,6 +324,25 @@ module Stripe
324
324
  end
325
325
  end
326
326
 
327
+ class UserBuyerClassification < ::Stripe::StripeObject
328
+ # Predicted type of buyer behind the user.
329
+ attr_reader :buyer_type
330
+ # The score for the predicted buyer type, between 0.00 and 100.00. Absent when buyer_type is unknown.
331
+ attr_reader :buyer_type_score
332
+
333
+ def self.inner_class_types
334
+ @inner_class_types = {}
335
+ end
336
+
337
+ def self.field_remappings
338
+ @field_remappings = {}
339
+ end
340
+
341
+ def self.field_encodings
342
+ @field_encodings = { buyer_type_score: :decimal_string }
343
+ end
344
+ end
345
+
327
346
  class UserMultiAccounting < ::Stripe::StripeObject
328
347
  # Categorical assessment of the multi-accounting risk.
329
348
  attr_reader :risk_level
@@ -373,6 +392,8 @@ module Stripe
373
392
  attr_reader :user_account_sharing
374
393
  # Data for the user affinity signal. Present only when type is user_affinity.
375
394
  attr_reader :user_affinity
395
+ # Data for the user buyer classification signal. Present only when type is user_buyer_classification.
396
+ attr_reader :user_buyer_classification
376
397
  # Data for the user multi-accounting signal. Present only when type is user_multi_accounting.
377
398
  attr_reader :user_multi_accounting
378
399
 
@@ -387,6 +408,7 @@ module Stripe
387
408
  payment_delinquency_exposure: PaymentDelinquencyExposure,
388
409
  user_account_sharing: UserAccountSharing,
389
410
  user_affinity: UserAffinity,
411
+ user_buyer_classification: UserBuyerClassification,
390
412
  user_multi_accounting: UserMultiAccounting,
391
413
  }
392
414
  end
@@ -411,6 +433,7 @@ module Stripe
411
433
  },
412
434
  user_account_sharing: { kind: :object, fields: { score: :decimal_string } },
413
435
  user_affinity: { kind: :object, fields: { score: :decimal_string } },
436
+ user_buyer_classification: { kind: :object, fields: { buyer_type_score: :decimal_string } },
414
437
  user_multi_accounting: { kind: :object, fields: { score: :decimal_string } },
415
438
  }
416
439
  end
@@ -1336,6 +1336,20 @@ module Stripe
1336
1336
  "stripe/events/v2_money_management_debit_dispute_succeeded_event"
1337
1337
  autoload :V2MoneyManagementDebitDisputeSucceededEventNotification,
1338
1338
  "stripe/events/v2_money_management_debit_dispute_succeeded_event"
1339
+ autoload :V2MoneyManagementDisputeAdjustmentCreatedEvent,
1340
+ "stripe/events/v2_money_management_dispute_adjustment_created_event"
1341
+ autoload :V2MoneyManagementDisputeAdjustmentCreatedEventNotification,
1342
+ "stripe/events/v2_money_management_dispute_adjustment_created_event"
1343
+ autoload :V2MoneyManagementDisputeCreatedEvent, "stripe/events/v2_money_management_dispute_created_event"
1344
+ autoload :V2MoneyManagementDisputeCreatedEventNotification,
1345
+ "stripe/events/v2_money_management_dispute_created_event"
1346
+ autoload :V2MoneyManagementDisputeLostEvent, "stripe/events/v2_money_management_dispute_lost_event"
1347
+ autoload :V2MoneyManagementDisputeLostEventNotification, "stripe/events/v2_money_management_dispute_lost_event"
1348
+ autoload :V2MoneyManagementDisputeUpdatedEvent, "stripe/events/v2_money_management_dispute_updated_event"
1349
+ autoload :V2MoneyManagementDisputeUpdatedEventNotification,
1350
+ "stripe/events/v2_money_management_dispute_updated_event"
1351
+ autoload :V2MoneyManagementDisputeWonEvent, "stripe/events/v2_money_management_dispute_won_event"
1352
+ autoload :V2MoneyManagementDisputeWonEventNotification, "stripe/events/v2_money_management_dispute_won_event"
1339
1353
  autoload :V2MoneyManagementEarnedCreditSucceededEvent,
1340
1354
  "stripe/events/v2_money_management_earned_credit_succeeded_event"
1341
1355
  autoload :V2MoneyManagementEarnedCreditSucceededEventNotification,
@@ -1769,6 +1783,10 @@ module Stripe
1769
1783
  autoload :V2ReportingReportRunSucceededEventNotification, "stripe/events/v2_reporting_report_run_succeeded_event"
1770
1784
  autoload :V2ReportingReportRunUpdatedEvent, "stripe/events/v2_reporting_report_run_updated_event"
1771
1785
  autoload :V2ReportingReportRunUpdatedEventNotification, "stripe/events/v2_reporting_report_run_updated_event"
1786
+ autoload :V2RiskEvaluationOutcomeDelinquencyReadyEvent,
1787
+ "stripe/events/v2_risk_evaluation_outcome_delinquency_ready_event"
1788
+ autoload :V2RiskEvaluationOutcomeDelinquencyReadyEventNotification,
1789
+ "stripe/events/v2_risk_evaluation_outcome_delinquency_ready_event"
1772
1790
  autoload :V2SignalsAccountEvaluationCompleteEvent, "stripe/events/v2_signals_account_evaluation_complete_event"
1773
1791
  autoload :V2SignalsAccountEvaluationCompleteEventNotification,
1774
1792
  "stripe/events/v2_signals_account_evaluation_complete_event"
@@ -2060,6 +2078,8 @@ module Stripe
2060
2078
  autoload :Adjustment, "stripe/resources/v2/money_management/adjustment"
2061
2079
  autoload :CurrencyConversion, "stripe/resources/v2/money_management/currency_conversion"
2062
2080
  autoload :DebitDispute, "stripe/resources/v2/money_management/debit_dispute"
2081
+ autoload :Dispute, "stripe/resources/v2/money_management/dispute"
2082
+ autoload :DisputeAdjustment, "stripe/resources/v2/money_management/dispute_adjustment"
2063
2083
  autoload :EarnedCredit, "stripe/resources/v2/money_management/earned_credit"
2064
2084
  autoload :EarnedCreditSimulation, "stripe/resources/v2/money_management/earned_credit_simulation"
2065
2085
  autoload :FinancialAccount, "stripe/resources/v2/money_management/financial_account"
@@ -2131,6 +2151,7 @@ module Stripe
2131
2151
  end
2132
2152
 
2133
2153
  module Risk
2154
+ autoload :EvaluationOutcome, "stripe/resources/v2/risk/evaluation_outcome"
2134
2155
  autoload :Form, "stripe/resources/v2/risk/form"
2135
2156
  end
2136
2157
 
@@ -2437,6 +2458,8 @@ module Stripe
2437
2458
  stripe/resources/v2/money_management/adjustment
2438
2459
  stripe/resources/v2/money_management/currency_conversion
2439
2460
  stripe/resources/v2/money_management/debit_dispute
2461
+ stripe/resources/v2/money_management/dispute
2462
+ stripe/resources/v2/money_management/dispute_adjustment
2440
2463
  stripe/resources/v2/money_management/earned_credit
2441
2464
  stripe/resources/v2/money_management/earned_credit_simulation
2442
2465
  stripe/resources/v2/money_management/financial_account
@@ -2486,6 +2509,7 @@ module Stripe
2486
2509
  stripe/resources/v2/provisioning/resource_access_configuration
2487
2510
  stripe/resources/v2/reporting/report
2488
2511
  stripe/resources/v2/reporting/report_run
2512
+ stripe/resources/v2/risk/evaluation_outcome
2489
2513
  stripe/resources/v2/risk/form
2490
2514
  stripe/resources/v2/signals/account_activity
2491
2515
  stripe/resources/v2/signals/account_evaluation
@@ -2934,6 +2958,11 @@ module Stripe
2934
2958
  stripe/events/v2_money_management_debit_dispute_failed_event
2935
2959
  stripe/events/v2_money_management_debit_dispute_submitted_event
2936
2960
  stripe/events/v2_money_management_debit_dispute_succeeded_event
2961
+ stripe/events/v2_money_management_dispute_adjustment_created_event
2962
+ stripe/events/v2_money_management_dispute_created_event
2963
+ stripe/events/v2_money_management_dispute_lost_event
2964
+ stripe/events/v2_money_management_dispute_updated_event
2965
+ stripe/events/v2_money_management_dispute_won_event
2937
2966
  stripe/events/v2_money_management_earned_credit_succeeded_event
2938
2967
  stripe/events/v2_money_management_financial_account_created_event
2939
2968
  stripe/events/v2_money_management_financial_account_statement_created_event
@@ -3048,6 +3077,7 @@ module Stripe
3048
3077
  stripe/events/v2_reporting_report_run_failed_event
3049
3078
  stripe/events/v2_reporting_report_run_succeeded_event
3050
3079
  stripe/events/v2_reporting_report_run_updated_event
3080
+ stripe/events/v2_risk_evaluation_outcome_delinquency_ready_event
3051
3081
  stripe/events/v2_signals_account_evaluation_complete_event
3052
3082
  stripe/events/v2_signals_account_signal_customer_risk_ready_event
3053
3083
  stripe/events/v2_signals_account_signal_fraudulent_merchant_ready_event
@@ -76,7 +76,7 @@ module Stripe
76
76
 
77
77
  # Updates a Checkout Session object.
78
78
  #
79
- # Related guide: [Dynamically update a Checkout Session](https://docs.stripe.com/payments/advanced/dynamic-updates)
79
+ # Related guide: [Dynamically update a Checkout Session](https://docs.stripe.com/payments/checkout/dynamic-updates)
80
80
  def update(session, params = {}, opts = {})
81
81
  unless params.is_a?(Stripe::RequestParams)
82
82
  params = ::Stripe::Checkout::SessionUpdateParams.coerce_params(params)
@@ -259,17 +259,6 @@ module Stripe
259
259
  )
260
260
  end
261
261
 
262
- # Updates the refund address for a static crypto deposit PaymentIntent on the specified network.
263
- def update_crypto_refund_address(intent, params = {}, opts = {})
264
- request(
265
- method: :post,
266
- path: format("/v1/payment_intents/%<intent>s/update_crypto_refund_address", { intent: CGI.escape(intent) }),
267
- params: params,
268
- opts: opts,
269
- base_address: :api
270
- )
271
- end
272
-
273
262
  # Verifies microdeposits on a PaymentIntent object.
274
263
  def verify_microdeposits(intent, params = {}, opts = {})
275
264
  request(
@@ -29,10 +29,53 @@ module Stripe
29
29
  # | — | — | — |
30
30
  # | form_not_found | 400 | No Form matches the supplied ID. |
31
31
  # | form_closed | 400 | The Form is closed and cannot accept updates. |
32
- # | invalid_field_for_form_type | 400 | A submitted field is not supported by this Form type. |
32
+ # | invalid_field_for_form_type | 400 | Submitted fields contain invalid values. |
33
33
  # | form_field_already_submitted | 400 | A submitted field has already been submitted. |
34
34
  # | form_insufficient_fields | 400 | Required fields are missing for this Form type. |
35
35
  # | resource_missing | 404 | A submitted file does not exist or is not accessible to the requesting account. |
36
+ #
37
+ # Validation errors include a summary in message. Missing required properties use
38
+ # form_insufficient_fields and include missing_fields, an array of public dotted paths.
39
+ # Missing required properties take precedence over value violations.
40
+ #
41
+ # Invalid values use invalid_field_for_form_type and include violations. Each violation
42
+ # has a public dotted field path and a reason of missing_value or invalid_value.
43
+ # Reviewed-field violations include a corrective message; corrective messages for other
44
+ # Form types are omitted. For an array member, target identifies the member's field path.
45
+ # For a scalar value, target is explicitly null.
46
+ #
47
+ # For example, a reviewed-fields submission with an out-of-date timestamp and an omitted
48
+ # requested member returns both violations:
49
+ #
50
+ # json
51
+ # {
52
+ # "error": {
53
+ # "type": "invalid_request_error",
54
+ # "code": "invalid_field_for_form_type",
55
+ # "message": "Submitted fields are invalid for Form type reviewed_fields. See violations for details and corrective actions for these fields: 'reviewed_fields.attestation.attested_at', 'reviewed_fields.attestation.fields'.",
56
+ # "violations": [
57
+ # {
58
+ # "field": "reviewed_fields.attestation.attested_at",
59
+ # "reason": "invalid_value",
60
+ # "message": "The attestation timestamp is out of date. Review and attest the requested information again, then provide the new attestation timestamp.",
61
+ # "target": null
62
+ # },
63
+ # {
64
+ # "field": "reviewed_fields.attestation.fields",
65
+ # "reason": "missing_value",
66
+ # "message": "'defaults.profile.product_description' is required by subject.fields_to_review but is missing from reviewed_fields.attestation.fields. Review this information, then include its path in the attestation.",
67
+ # "target": "defaults.profile.product_description"
68
+ # }
69
+ # ]
70
+ # }
71
+ # }
72
+ #
73
+ #
74
+ # A v1 request with no extracted field submissions is rejected before the Form is loaded,
75
+ # including for reviewed-fields Forms. This early error uses form_insufficient_fields
76
+ # and omits missing_fields,
77
+ # violations, and param. Partially populated reviewed-fields requests use structured
78
+ # missing-property validation.
36
79
  def update(id, params = {}, opts = {})
37
80
  request(
38
81
  method: :post,
@@ -3,17 +3,6 @@
3
3
 
4
4
  module Stripe
5
5
  class SubscriptionService < StripeService
6
- # Attach a Billing Cadence to an existing subscription. When attached, the subscription is billed by the Billing Cadence, potentially sharing invoices with the other subscriptions linked to the Billing Cadence.
7
- def attach_cadence(subscription, params = {}, opts = {})
8
- request(
9
- method: :post,
10
- path: format("/v1/subscriptions/%<subscription>s/attach_cadence", { subscription: CGI.escape(subscription) }),
11
- params: params,
12
- opts: opts,
13
- base_address: :api
14
- )
15
- end
16
-
17
6
  # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details.
18
7
  #
19
8
  # Pending invoice items are included on a final invoice if you generate one. Otherwise, they remain pending and can be billed on another invoice for the customer. To prevent billing, manually [delete](https://docs.stripe.com/api/invoiceitems/delete) them. If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false.
@@ -5,6 +5,7 @@ module Stripe
5
5
  module Terminal
6
6
  class OnboardingLinkService < StripeService
7
7
  # Creates a new OnboardingLink object that contains a redirect_url used for onboarding onto Tap to Pay on iPhone.
8
+ # The returned URL expires 30 minutes after creation.
8
9
  def create(params = {}, opts = {})
9
10
  request(
10
11
  method: :post,
@@ -4,7 +4,7 @@
4
4
  module Stripe
5
5
  module TestHelpers
6
6
  class ConfirmationTokenService < StripeService
7
- # Creates a test mode Confirmation Token server side for your integration tests.
7
+ # Creates a test Confirmation Token server side for your integration tests.
8
8
  def create(params = {}, opts = {})
9
9
  request(
10
10
  method: :post,
@@ -5,7 +5,10 @@ module Stripe
5
5
  module V2
6
6
  module Core
7
7
  class FeeBatchService < StripeService
8
- # List FeeBatches optionally filtered by collection_record.
8
+ # Lists FeeBatches, optionally filtered by `collection_record`, `statuses`, or
9
+ # creation time. If `statuses` is omitted or empty, only pending and billed
10
+ # FeeBatches are returned. Canceled FeeBatches are returned only when explicitly
11
+ # requested.
9
12
  def list(params = {}, opts = {})
10
13
  request(
11
14
  method: :get,
@@ -5,7 +5,9 @@ module Stripe
5
5
  module V2
6
6
  module Core
7
7
  class FeeEntryService < StripeService
8
- # List FeeEntries optionally filtered by incurred_by, fee_batch, or collection_record (at most one filter at a time).
8
+ # Lists FeeEntries, optionally filtered by `incurred_by`, `fee_batch`, or
9
+ # `collection_record`. When filtering by `fee_batch`, results reflect current
10
+ # membership; historical membership is unavailable.
9
11
  def list(params = {}, opts = {})
10
12
  request(
11
13
  method: :get,
@@ -5,6 +5,7 @@ module Stripe
5
5
  module V2
6
6
  module MoneyManagement
7
7
  class DebitDisputeService < StripeService
8
+ # Deprecated: Use CreateDispute to create a Dispute instead.
8
9
  # Creates a new DebitDispute for a ReceivedDebit.
9
10
  def create(params = {}, opts = {})
10
11
  request(