stripe 15.0.0 → 15.3.0

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 (320) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -0
  3. data/CHANGELOG.md +129 -44
  4. data/CONTRIBUTING.md +25 -0
  5. data/Gemfile +1 -1
  6. data/OPENAPI_VERSION +1 -1
  7. data/README.md +28 -55
  8. data/VERSION +1 -1
  9. data/lib/stripe/api_operations/nested_resource.rb +35 -35
  10. data/lib/stripe/api_requestor.rb +1 -1
  11. data/lib/stripe/api_version.rb +2 -1
  12. data/lib/stripe/connection_manager.rb +1 -3
  13. data/lib/stripe/event_types.rb +1 -0
  14. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +1 -1
  15. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +1 -1
  16. data/lib/stripe/events/v2_core_event_destination_ping_event.rb +21 -0
  17. data/lib/stripe/oauth.rb +1 -1
  18. data/lib/stripe/resources/account.rb +198 -28
  19. data/lib/stripe/resources/account_session.rb +176 -72
  20. data/lib/stripe/resources/apple_pay_domain.rb +1 -2
  21. data/lib/stripe/resources/balance.rb +42 -0
  22. data/lib/stripe/resources/balance_transaction.rb +2 -0
  23. data/lib/stripe/resources/bank_account.rb +2 -2
  24. data/lib/stripe/resources/billing_portal/session.rb +3 -3
  25. data/lib/stripe/resources/capability.rb +1 -1
  26. data/lib/stripe/resources/charge.rb +43 -20
  27. data/lib/stripe/resources/checkout/session.rb +120 -19
  28. data/lib/stripe/resources/confirmation_token.rb +119 -100
  29. data/lib/stripe/resources/country_spec.rb +1 -1
  30. data/lib/stripe/resources/coupon.rb +2 -3
  31. data/lib/stripe/resources/credit_note.rb +21 -18
  32. data/lib/stripe/resources/customer.rb +4 -6
  33. data/lib/stripe/resources/customer_session.rb +5 -5
  34. data/lib/stripe/resources/dispute.rb +2 -2
  35. data/lib/stripe/resources/event.rb +3 -1
  36. data/lib/stripe/resources/file.rb +1 -1
  37. data/lib/stripe/resources/funding_instructions.rb +1 -1
  38. data/lib/stripe/resources/identity/verification_report.rb +6 -0
  39. data/lib/stripe/resources/identity/verification_session.rb +51 -11
  40. data/lib/stripe/resources/invoice.rb +146 -32
  41. data/lib/stripe/resources/invoice_item.rb +3 -7
  42. data/lib/stripe/resources/invoice_line_item.rb +1 -1
  43. data/lib/stripe/resources/invoice_payment.rb +9 -2
  44. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  45. data/lib/stripe/resources/issuing/card.rb +1 -1
  46. data/lib/stripe/resources/issuing/dispute.rb +3 -3
  47. data/lib/stripe/resources/login_link.rb +2 -1
  48. data/lib/stripe/resources/mandate.rb +3 -0
  49. data/lib/stripe/resources/payment_intent.rb +602 -325
  50. data/lib/stripe/resources/payment_method.rb +76 -117
  51. data/lib/stripe/resources/payment_method_configuration.rb +356 -2
  52. data/lib/stripe/resources/payment_method_domain.rb +15 -2
  53. data/lib/stripe/resources/payout.rb +4 -4
  54. data/lib/stripe/resources/person.rb +27 -3
  55. data/lib/stripe/resources/plan.rb +2 -3
  56. data/lib/stripe/resources/price.rb +1 -1
  57. data/lib/stripe/resources/product.rb +1 -2
  58. data/lib/stripe/resources/quote.rb +28 -3
  59. data/lib/stripe/resources/radar/value_list.rb +1 -2
  60. data/lib/stripe/resources/radar/value_list_item.rb +1 -2
  61. data/lib/stripe/resources/refund.rb +8 -1
  62. data/lib/stripe/resources/reversal.rb +1 -1
  63. data/lib/stripe/resources/review.rb +1 -1
  64. data/lib/stripe/resources/setup_attempt.rb +1 -1
  65. data/lib/stripe/resources/setup_intent.rb +414 -293
  66. data/lib/stripe/resources/source.rb +1 -1
  67. data/lib/stripe/resources/subscription.rb +149 -27
  68. data/lib/stripe/resources/subscription_item.rb +33 -0
  69. data/lib/stripe/resources/subscription_schedule.rb +141 -4
  70. data/lib/stripe/resources/tax/calculation.rb +6 -2
  71. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  72. data/lib/stripe/resources/tax/registration.rb +261 -1
  73. data/lib/stripe/resources/tax/transaction.rb +1 -1
  74. data/lib/stripe/resources/tax_id.rb +3 -4
  75. data/lib/stripe/resources/tax_rate.rb +2 -2
  76. data/lib/stripe/resources/terminal/configuration.rb +2 -2
  77. data/lib/stripe/resources/terminal/location.rb +2 -3
  78. data/lib/stripe/resources/terminal/reader.rb +426 -6
  79. data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
  80. data/lib/stripe/resources/token.rb +63 -2
  81. data/lib/stripe/resources/transfer.rb +1 -1
  82. data/lib/stripe/resources/treasury/financial_account.rb +5 -1
  83. data/lib/stripe/resources/v2/billing/meter_event.rb +2 -2
  84. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +2 -2
  85. data/lib/stripe/resources/v2/billing/meter_event_session.rb +2 -2
  86. data/lib/stripe/resources/v2/event.rb +2 -2
  87. data/lib/stripe/resources/v2/event_destination.rb +2 -2
  88. data/lib/stripe/resources/webhook_endpoint.rb +1 -2
  89. data/lib/stripe/resources.rb +1 -0
  90. data/lib/stripe/services/account_external_account_service.rb +3 -4
  91. data/lib/stripe/services/account_login_link_service.rb +1 -1
  92. data/lib/stripe/services/account_person_service.rb +85 -2
  93. data/lib/stripe/services/account_service.rb +169 -20
  94. data/lib/stripe/services/account_session_service.rb +115 -47
  95. data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
  96. data/lib/stripe/services/application_fee_service.rb +1 -1
  97. data/lib/stripe/services/apps_service.rb +1 -1
  98. data/lib/stripe/services/balance_service.rb +1 -1
  99. data/lib/stripe/services/billing/meter_service.rb +1 -1
  100. data/lib/stripe/services/billing_portal/session_service.rb +1 -1
  101. data/lib/stripe/services/billing_portal_service.rb +1 -1
  102. data/lib/stripe/services/billing_service.rb +1 -1
  103. data/lib/stripe/services/charge_service.rb +4 -4
  104. data/lib/stripe/services/checkout/session_service.rb +94 -15
  105. data/lib/stripe/services/checkout_service.rb +1 -1
  106. data/lib/stripe/services/climate_service.rb +1 -1
  107. data/lib/stripe/services/coupon_service.rb +1 -2
  108. data/lib/stripe/services/credit_note_preview_lines_service.rb +3 -3
  109. data/lib/stripe/services/credit_note_service.rb +14 -15
  110. data/lib/stripe/services/customer_balance_transaction_service.rb +3 -3
  111. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +2 -2
  112. data/lib/stripe/services/customer_payment_method_service.rb +1 -1
  113. data/lib/stripe/services/customer_payment_source_service.rb +1 -1
  114. data/lib/stripe/services/customer_service.rb +5 -7
  115. data/lib/stripe/services/customer_session_service.rb +1 -1
  116. data/lib/stripe/services/customer_tax_id_service.rb +2 -3
  117. data/lib/stripe/services/dispute_service.rb +1 -1
  118. data/lib/stripe/services/entitlements_service.rb +1 -1
  119. data/lib/stripe/services/file_service.rb +1 -1
  120. data/lib/stripe/services/financial_connections/account_service.rb +1 -1
  121. data/lib/stripe/services/financial_connections_service.rb +1 -1
  122. data/lib/stripe/services/forwarding_service.rb +1 -1
  123. data/lib/stripe/services/identity/verification_session_service.rb +21 -5
  124. data/lib/stripe/services/identity_service.rb +1 -1
  125. data/lib/stripe/services/invoice_item_service.rb +1 -2
  126. data/lib/stripe/services/invoice_service.rb +122 -28
  127. data/lib/stripe/services/issuing/authorization_service.rb +4 -4
  128. data/lib/stripe/services/issuing/card_service.rb +1 -1
  129. data/lib/stripe/services/issuing/dispute_service.rb +2 -2
  130. data/lib/stripe/services/issuing_service.rb +1 -1
  131. data/lib/stripe/services/payment_intent_service.rb +563 -313
  132. data/lib/stripe/services/payment_link_service.rb +1 -1
  133. data/lib/stripe/services/payment_method_configuration_service.rb +254 -2
  134. data/lib/stripe/services/payment_method_domain_service.rb +1 -1
  135. data/lib/stripe/services/payment_method_service.rb +59 -105
  136. data/lib/stripe/services/payout_service.rb +2 -2
  137. data/lib/stripe/services/plan_service.rb +2 -3
  138. data/lib/stripe/services/price_service.rb +2 -2
  139. data/lib/stripe/services/product_feature_service.rb +1 -2
  140. data/lib/stripe/services/product_service.rb +3 -4
  141. data/lib/stripe/services/promotion_code_service.rb +1 -1
  142. data/lib/stripe/services/quote_service.rb +21 -4
  143. data/lib/stripe/services/radar/early_fraud_warning_service.rb +1 -1
  144. data/lib/stripe/services/radar/value_list_item_service.rb +1 -2
  145. data/lib/stripe/services/radar/value_list_service.rb +1 -2
  146. data/lib/stripe/services/radar_service.rb +1 -1
  147. data/lib/stripe/services/reporting_service.rb +1 -1
  148. data/lib/stripe/services/setup_intent_service.rb +403 -291
  149. data/lib/stripe/services/sigma_service.rb +1 -1
  150. data/lib/stripe/services/source_service.rb +2 -2
  151. data/lib/stripe/services/subscription_item_service.rb +26 -0
  152. data/lib/stripe/services/subscription_schedule_service.rb +106 -3
  153. data/lib/stripe/services/subscription_service.rb +121 -26
  154. data/lib/stripe/services/tax/calculation_service.rb +6 -2
  155. data/lib/stripe/services/tax/registration_service.rb +170 -1
  156. data/lib/stripe/services/tax/transaction_service.rb +1 -1
  157. data/lib/stripe/services/tax_id_service.rb +2 -3
  158. data/lib/stripe/services/tax_service.rb +1 -1
  159. data/lib/stripe/services/terminal/configuration_service.rb +1 -2
  160. data/lib/stripe/services/terminal/location_service.rb +2 -3
  161. data/lib/stripe/services/terminal/reader_service.rb +196 -2
  162. data/lib/stripe/services/terminal_service.rb +1 -1
  163. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +90 -91
  164. data/lib/stripe/services/test_helpers/issuing_service.rb +1 -1
  165. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +43 -0
  166. data/lib/stripe/services/test_helpers/terminal_service.rb +1 -1
  167. data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
  168. data/lib/stripe/services/test_helpers/treasury_service.rb +1 -1
  169. data/lib/stripe/services/test_helpers_service.rb +1 -1
  170. data/lib/stripe/services/token_service.rb +62 -1
  171. data/lib/stripe/services/transfer_service.rb +2 -2
  172. data/lib/stripe/services/treasury/financial_account_service.rb +6 -2
  173. data/lib/stripe/services/treasury_service.rb +1 -1
  174. data/lib/stripe/services/v1_services.rb +1 -1
  175. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
  176. data/lib/stripe/services/v2/billing_service.rb +3 -3
  177. data/lib/stripe/services/v2/core/event_destination_service.rb +17 -23
  178. data/lib/stripe/services/v2/core/event_service.rb +1 -2
  179. data/lib/stripe/services/v2/core_service.rb +1 -1
  180. data/lib/stripe/services/v2_services.rb +1 -1
  181. data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
  182. data/lib/stripe/version.rb +1 -1
  183. data/lib/stripe/webhook.rb +1 -1
  184. data/rbi/stripe/resources/account.rbi +190 -35
  185. data/rbi/stripe/resources/account_session.rbi +196 -77
  186. data/rbi/stripe/resources/apple_pay_domain.rbi +1 -3
  187. data/rbi/stripe/resources/balance.rbi +55 -0
  188. data/rbi/stripe/resources/balance_transaction.rbi +3 -0
  189. data/rbi/stripe/resources/bank_account.rbi +2 -2
  190. data/rbi/stripe/resources/billing/alert.rbi +2 -2
  191. data/rbi/stripe/resources/billing_portal/session.rbi +3 -3
  192. data/rbi/stripe/resources/capability.rbi +1 -1
  193. data/rbi/stripe/resources/charge.rbi +52 -20
  194. data/rbi/stripe/resources/checkout/session.rbi +133 -24
  195. data/rbi/stripe/resources/confirmation_token.rbi +140 -115
  196. data/rbi/stripe/resources/country_spec.rbi +1 -1
  197. data/rbi/stripe/resources/coupon.rbi +2 -4
  198. data/rbi/stripe/resources/credit_note.rbi +23 -18
  199. data/rbi/stripe/resources/customer.rbi +4 -8
  200. data/rbi/stripe/resources/customer_session.rbi +5 -5
  201. data/rbi/stripe/resources/dispute.rbi +2 -2
  202. data/rbi/stripe/resources/event.rbi +4 -1
  203. data/rbi/stripe/resources/file.rbi +1 -1
  204. data/rbi/stripe/resources/identity/verification_report.rbi +9 -0
  205. data/rbi/stripe/resources/identity/verification_session.rbi +59 -12
  206. data/rbi/stripe/resources/invoice.rbi +149 -40
  207. data/rbi/stripe/resources/invoice_item.rbi +3 -8
  208. data/rbi/stripe/resources/invoice_line_item.rbi +2 -2
  209. data/rbi/stripe/resources/invoice_payment.rbi +9 -2
  210. data/rbi/stripe/resources/issuing/authorization.rbi +8 -8
  211. data/rbi/stripe/resources/issuing/card.rbi +1 -1
  212. data/rbi/stripe/resources/issuing/dispute.rbi +3 -3
  213. data/rbi/stripe/resources/login_link.rbi +2 -1
  214. data/rbi/stripe/resources/mandate.rbi +4 -0
  215. data/rbi/stripe/resources/payment_intent.rbi +637 -381
  216. data/rbi/stripe/resources/payment_method.rbi +81 -133
  217. data/rbi/stripe/resources/payment_method_configuration.rbi +400 -4
  218. data/rbi/stripe/resources/payment_method_domain.rbi +18 -2
  219. data/rbi/stripe/resources/payout.rbi +4 -4
  220. data/rbi/stripe/resources/person.rbi +33 -3
  221. data/rbi/stripe/resources/plan.rbi +2 -4
  222. data/rbi/stripe/resources/price.rbi +1 -1
  223. data/rbi/stripe/resources/product.rbi +1 -3
  224. data/rbi/stripe/resources/quote.rbi +25 -3
  225. data/rbi/stripe/resources/radar/value_list.rbi +1 -3
  226. data/rbi/stripe/resources/radar/value_list_item.rbi +1 -3
  227. data/rbi/stripe/resources/refund.rbi +8 -1
  228. data/rbi/stripe/resources/reversal.rbi +1 -1
  229. data/rbi/stripe/resources/review.rbi +1 -1
  230. data/rbi/stripe/resources/setup_attempt.rbi +1 -1
  231. data/rbi/stripe/resources/setup_intent.rbi +464 -346
  232. data/rbi/stripe/resources/source.rbi +1 -1
  233. data/rbi/stripe/resources/subscription.rbi +150 -34
  234. data/rbi/stripe/resources/subscription_item.rbi +36 -2
  235. data/rbi/stripe/resources/subscription_schedule.rbi +161 -11
  236. data/rbi/stripe/resources/tax/calculation.rbi +7 -3
  237. data/rbi/stripe/resources/tax/calculation_line_item.rbi +4 -1
  238. data/rbi/stripe/resources/tax/registration.rbi +249 -2
  239. data/rbi/stripe/resources/tax/transaction.rbi +1 -1
  240. data/rbi/stripe/resources/tax_id.rbi +3 -5
  241. data/rbi/stripe/resources/tax_rate.rbi +2 -2
  242. data/rbi/stripe/resources/terminal/configuration.rbi +2 -3
  243. data/rbi/stripe/resources/terminal/location.rbi +4 -6
  244. data/rbi/stripe/resources/terminal/reader.rbi +415 -8
  245. data/rbi/stripe/resources/test_helpers/test_clock.rbi +1 -3
  246. data/rbi/stripe/resources/token.rbi +70 -4
  247. data/rbi/stripe/resources/transfer.rbi +1 -1
  248. data/rbi/stripe/resources/treasury/financial_account.rbi +6 -2
  249. data/rbi/stripe/resources/v2/billing/meter_event.rbi +3 -3
  250. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +3 -3
  251. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +3 -3
  252. data/rbi/stripe/resources/v2/event.rbi +3 -3
  253. data/rbi/stripe/resources/v2/event_destination.rbi +3 -3
  254. data/rbi/stripe/resources/webhook_endpoint.rbi +1 -3
  255. data/rbi/stripe/services/account_external_account_service.rbi +3 -5
  256. data/rbi/stripe/services/account_login_link_service.rbi +1 -1
  257. data/rbi/stripe/services/account_person_service.rbi +93 -5
  258. data/rbi/stripe/services/account_service.rbi +166 -28
  259. data/rbi/stripe/services/account_session_service.rbi +126 -52
  260. data/rbi/stripe/services/apple_pay_domain_service.rbi +1 -3
  261. data/rbi/stripe/services/balance_service.rbi +1 -1
  262. data/rbi/stripe/services/billing/alert_service.rbi +2 -2
  263. data/rbi/stripe/services/billing_portal/session_service.rbi +1 -1
  264. data/rbi/stripe/services/charge_service.rbi +4 -4
  265. data/rbi/stripe/services/checkout/session_service.rbi +104 -19
  266. data/rbi/stripe/services/coupon_service.rbi +1 -3
  267. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +3 -3
  268. data/rbi/stripe/services/credit_note_service.rbi +13 -14
  269. data/rbi/stripe/services/customer_balance_transaction_service.rbi +3 -3
  270. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +2 -2
  271. data/rbi/stripe/services/customer_payment_method_service.rbi +1 -1
  272. data/rbi/stripe/services/customer_payment_source_service.rbi +1 -1
  273. data/rbi/stripe/services/customer_service.rbi +4 -8
  274. data/rbi/stripe/services/customer_session_service.rbi +1 -1
  275. data/rbi/stripe/services/customer_tax_id_service.rbi +2 -4
  276. data/rbi/stripe/services/dispute_service.rbi +1 -1
  277. data/rbi/stripe/services/file_service.rbi +1 -1
  278. data/rbi/stripe/services/identity/verification_session_service.rbi +22 -6
  279. data/rbi/stripe/services/invoice_item_service.rbi +1 -3
  280. data/rbi/stripe/services/invoice_service.rbi +126 -35
  281. data/rbi/stripe/services/issuing/authorization_service.rbi +4 -4
  282. data/rbi/stripe/services/issuing/card_service.rbi +1 -1
  283. data/rbi/stripe/services/issuing/dispute_service.rbi +2 -2
  284. data/rbi/stripe/services/payment_intent_service.rbi +599 -369
  285. data/rbi/stripe/services/payment_method_configuration_service.rbi +280 -4
  286. data/rbi/stripe/services/payment_method_domain_service.rbi +1 -1
  287. data/rbi/stripe/services/payment_method_service.rbi +62 -121
  288. data/rbi/stripe/services/payout_service.rbi +2 -2
  289. data/rbi/stripe/services/plan_service.rbi +2 -4
  290. data/rbi/stripe/services/price_service.rbi +2 -2
  291. data/rbi/stripe/services/product_feature_service.rbi +1 -3
  292. data/rbi/stripe/services/product_service.rbi +2 -4
  293. data/rbi/stripe/services/promotion_code_service.rbi +1 -1
  294. data/rbi/stripe/services/quote_service.rbi +16 -3
  295. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +1 -1
  296. data/rbi/stripe/services/radar/value_list_item_service.rbi +1 -3
  297. data/rbi/stripe/services/radar/value_list_service.rbi +1 -3
  298. data/rbi/stripe/services/setup_intent_service.rbi +457 -344
  299. data/rbi/stripe/services/source_service.rbi +1 -1
  300. data/rbi/stripe/services/subscription_item_service.rbi +28 -2
  301. data/rbi/stripe/services/subscription_schedule_service.rbi +119 -10
  302. data/rbi/stripe/services/subscription_service.rbi +121 -33
  303. data/rbi/stripe/services/tax/calculation_service.rbi +6 -2
  304. data/rbi/stripe/services/tax/registration_service.rbi +171 -2
  305. data/rbi/stripe/services/tax_id_service.rbi +2 -4
  306. data/rbi/stripe/services/terminal/configuration_service.rbi +1 -3
  307. data/rbi/stripe/services/terminal/location_service.rbi +4 -6
  308. data/rbi/stripe/services/terminal/reader_service.rbi +200 -4
  309. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +106 -106
  310. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +31 -0
  311. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +1 -3
  312. data/rbi/stripe/services/token_service.rbi +71 -3
  313. data/rbi/stripe/services/transfer_service.rbi +1 -1
  314. data/rbi/stripe/services/treasury/financial_account_service.rbi +6 -2
  315. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +1 -3
  316. data/rbi/stripe/services/v2/billing_service.rbi +1 -1
  317. data/rbi/stripe/services/v2/core/event_destination_service.rbi +14 -22
  318. data/rbi/stripe/services/v2/core/event_service.rbi +1 -3
  319. data/rbi/stripe/services/webhook_endpoint_service.rbi +1 -3
  320. metadata +5 -2
@@ -103,6 +103,18 @@ module Stripe
103
103
  @phone = phone
104
104
  end
105
105
  end
106
+
107
+ class RelatedPerson < Stripe::RequestParams
108
+ # A token representing a connected account. If provided, the person parameter is also required and must be associated with the account.
109
+ attr_accessor :account
110
+ # A token referencing a Person resource that this verification is being used to verify.
111
+ attr_accessor :person
112
+
113
+ def initialize(account: nil, person: nil)
114
+ @account = account
115
+ @person = person
116
+ end
117
+ end
106
118
  # A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems.
107
119
  attr_accessor :client_reference_id
108
120
  # Specifies which fields in the response should be expanded.
@@ -115,6 +127,8 @@ module Stripe
115
127
  attr_accessor :provided_details
116
128
  # Customer ID
117
129
  attr_accessor :related_customer
130
+ # Tokens referencing a Person resource and it's associated account.
131
+ attr_accessor :related_person
118
132
  # The URL that the user will be redirected to upon completing the verification flow.
119
133
  attr_accessor :return_url
120
134
  # The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. You must provide a `type` if not passing `verification_flow`.
@@ -129,6 +143,7 @@ module Stripe
129
143
  options: nil,
130
144
  provided_details: nil,
131
145
  related_customer: nil,
146
+ related_person: nil,
132
147
  return_url: nil,
133
148
  type: nil,
134
149
  verification_flow: nil
@@ -139,6 +154,7 @@ module Stripe
139
154
  @options = options
140
155
  @provided_details = provided_details
141
156
  @related_customer = related_customer
157
+ @related_person = related_person
142
158
  @return_url = return_url
143
159
  @type = type
144
160
  @verification_flow = verification_flow
@@ -235,9 +251,9 @@ module Stripe
235
251
  end
236
252
  end
237
253
 
238
- # A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
254
+ # A VerificationSession object can be canceled when it is in requires_input [status](https://docs.stripe.com/docs/identity/how-sessions-work).
239
255
  #
240
- # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
256
+ # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#cancel).
241
257
  def cancel(session, params = {}, opts = {})
242
258
  request(
243
259
  method: :post,
@@ -254,7 +270,7 @@ module Stripe
254
270
  #
255
271
  # If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode.
256
272
  #
257
- # Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents)
273
+ # Related guide: [Verify your users' identity documents](https://docs.stripe.com/docs/identity/verify-identity-documents)
258
274
  def create(params = {}, opts = {})
259
275
  request(
260
276
  method: :post,
@@ -281,7 +297,7 @@ module Stripe
281
297
  # request logs, etc.
282
298
  #
283
299
  # A VerificationSession object can be redacted when it is in requires_input or verified
284
- # [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
300
+ # [status](https://docs.stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
285
301
  # state will automatically cancel it.
286
302
  #
287
303
  # The redaction process may take up to four days. When the redaction process is in progress, the
@@ -294,7 +310,7 @@ module Stripe
294
310
  # placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
295
311
  # used for any purpose.
296
312
  #
297
- # [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
313
+ # [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#redact).
298
314
  def redact(session, params = {}, opts = {})
299
315
  request(
300
316
  method: :post,
@@ -6,7 +6,7 @@ module Stripe
6
6
  attr_reader :verification_reports, :verification_sessions
7
7
 
8
8
  def initialize(requestor)
9
- super(requestor)
9
+ super
10
10
  @verification_reports = Stripe::Identity::VerificationReportService.new(@requestor)
11
11
  @verification_sessions = Stripe::Identity::VerificationSessionService.new(@requestor)
12
12
  end
@@ -3,8 +3,7 @@
3
3
 
4
4
  module Stripe
5
5
  class InvoiceItemService < StripeService
6
- class DeleteParams < Stripe::RequestParams
7
- end
6
+ class DeleteParams < Stripe::RequestParams; end
8
7
 
9
8
  class RetrieveParams < Stripe::RequestParams
10
9
  # Specifies which fields in the response should be expanded.
@@ -6,12 +6,11 @@ module Stripe
6
6
  attr_reader :line_items
7
7
 
8
8
  def initialize(requestor)
9
- super(requestor)
9
+ super
10
10
  @line_items = Stripe::InvoiceLineItemService.new(@requestor)
11
11
  end
12
12
 
13
- class DeleteParams < Stripe::RequestParams
14
- end
13
+ class DeleteParams < Stripe::RequestParams; end
15
14
 
16
15
  class RetrieveParams < Stripe::RequestParams
17
16
  # Specifies which fields in the response should be expanded.
@@ -124,7 +123,7 @@ module Stripe
124
123
  # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
125
124
  # One of `month`.
126
125
  attr_accessor :interval
127
- # Type of installment plan, one of `fixed_count`.
126
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
128
127
  attr_accessor :type
129
128
 
130
129
  def initialize(count: nil, interval: nil, type: nil)
@@ -188,11 +187,8 @@ module Stripe
188
187
  end
189
188
  end
190
189
 
191
- class Konbini < Stripe::RequestParams
192
- end
193
-
194
- class SepaDebit < Stripe::RequestParams
195
- end
190
+ class Konbini < Stripe::RequestParams; end
191
+ class SepaDebit < Stripe::RequestParams; end
196
192
 
197
193
  class UsBankAccount < Stripe::RequestParams
198
194
  class FinancialConnections < Stripe::RequestParams
@@ -774,7 +770,7 @@ module Stripe
774
770
  # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
775
771
  # One of `month`.
776
772
  attr_accessor :interval
777
- # Type of installment plan, one of `fixed_count`.
773
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
778
774
  attr_accessor :type
779
775
 
780
776
  def initialize(count: nil, interval: nil, type: nil)
@@ -838,11 +834,8 @@ module Stripe
838
834
  end
839
835
  end
840
836
 
841
- class Konbini < Stripe::RequestParams
842
- end
843
-
844
- class SepaDebit < Stripe::RequestParams
845
- end
837
+ class Konbini < Stripe::RequestParams; end
838
+ class SepaDebit < Stripe::RequestParams; end
846
839
 
847
840
  class UsBankAccount < Stripe::RequestParams
848
841
  class FinancialConnections < Stripe::RequestParams
@@ -1488,6 +1481,18 @@ module Stripe
1488
1481
  end
1489
1482
  end
1490
1483
 
1484
+ class AttachPaymentParams < Stripe::RequestParams
1485
+ # Specifies which fields in the response should be expanded.
1486
+ attr_accessor :expand
1487
+ # The ID of the PaymentIntent to attach to the invoice.
1488
+ attr_accessor :payment_intent
1489
+
1490
+ def initialize(expand: nil, payment_intent: nil)
1491
+ @expand = expand
1492
+ @payment_intent = payment_intent
1493
+ end
1494
+ end
1495
+
1491
1496
  class FinalizeInvoiceParams < Stripe::RequestParams
1492
1497
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
1493
1498
  attr_accessor :auto_advance
@@ -1923,7 +1928,7 @@ module Stripe
1923
1928
  end
1924
1929
 
1925
1930
  class TaxId < Stripe::RequestParams
1926
- # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
1931
+ # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
1927
1932
  attr_accessor :type
1928
1933
  # Value of the tax ID.
1929
1934
  attr_accessor :value
@@ -2105,6 +2110,15 @@ module Stripe
2105
2110
  end
2106
2111
 
2107
2112
  class ScheduleDetails < Stripe::RequestParams
2113
+ class BillingMode < Stripe::RequestParams
2114
+ # Attribute for param field type
2115
+ attr_accessor :type
2116
+
2117
+ def initialize(type: nil)
2118
+ @type = type
2119
+ end
2120
+ end
2121
+
2108
2122
  class Phase < Stripe::RequestParams
2109
2123
  class AddInvoiceItem < Stripe::RequestParams
2110
2124
  class Discount < Stripe::RequestParams
@@ -2197,6 +2211,18 @@ module Stripe
2197
2211
  end
2198
2212
  end
2199
2213
 
2214
+ class BillingThresholds < Stripe::RequestParams
2215
+ # Monetary threshold that triggers the subscription to advance to a new billing period
2216
+ attr_accessor :amount_gte
2217
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
2218
+ attr_accessor :reset_billing_cycle_anchor
2219
+
2220
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
2221
+ @amount_gte = amount_gte
2222
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
2223
+ end
2224
+ end
2225
+
2200
2226
  class Discount < Stripe::RequestParams
2201
2227
  # ID of the coupon to create a new discount for.
2202
2228
  attr_accessor :coupon
@@ -2239,6 +2265,15 @@ module Stripe
2239
2265
  end
2240
2266
 
2241
2267
  class Item < Stripe::RequestParams
2268
+ class BillingThresholds < Stripe::RequestParams
2269
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
2270
+ attr_accessor :usage_gte
2271
+
2272
+ def initialize(usage_gte: nil)
2273
+ @usage_gte = usage_gte
2274
+ end
2275
+ end
2276
+
2242
2277
  class Discount < Stripe::RequestParams
2243
2278
  # ID of the coupon to create a new discount for.
2244
2279
  attr_accessor :coupon
@@ -2295,6 +2330,8 @@ module Stripe
2295
2330
  @unit_amount_decimal = unit_amount_decimal
2296
2331
  end
2297
2332
  end
2333
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
2334
+ attr_accessor :billing_thresholds
2298
2335
  # The coupons to redeem into discounts for the subscription item.
2299
2336
  attr_accessor :discounts
2300
2337
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
@@ -2311,6 +2348,7 @@ module Stripe
2311
2348
  attr_accessor :tax_rates
2312
2349
 
2313
2350
  def initialize(
2351
+ billing_thresholds: nil,
2314
2352
  discounts: nil,
2315
2353
  metadata: nil,
2316
2354
  plan: nil,
@@ -2319,6 +2357,7 @@ module Stripe
2319
2357
  quantity: nil,
2320
2358
  tax_rates: nil
2321
2359
  )
2360
+ @billing_thresholds = billing_thresholds
2322
2361
  @discounts = discounts
2323
2362
  @metadata = metadata
2324
2363
  @plan = plan
@@ -2348,6 +2387,8 @@ module Stripe
2348
2387
  attr_accessor :automatic_tax
2349
2388
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
2350
2389
  attr_accessor :billing_cycle_anchor
2390
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
2391
+ attr_accessor :billing_thresholds
2351
2392
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
2352
2393
  attr_accessor :collection_method
2353
2394
  # 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).
@@ -2372,7 +2413,7 @@ module Stripe
2372
2413
  attr_accessor :metadata
2373
2414
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
2374
2415
  attr_accessor :on_behalf_of
2375
- # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
2416
+ # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
2376
2417
  attr_accessor :proration_behavior
2377
2418
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
2378
2419
  attr_accessor :start_date
@@ -2388,6 +2429,7 @@ module Stripe
2388
2429
  application_fee_percent: nil,
2389
2430
  automatic_tax: nil,
2390
2431
  billing_cycle_anchor: nil,
2432
+ billing_thresholds: nil,
2391
2433
  collection_method: nil,
2392
2434
  currency: nil,
2393
2435
  default_payment_method: nil,
@@ -2410,6 +2452,7 @@ module Stripe
2410
2452
  @application_fee_percent = application_fee_percent
2411
2453
  @automatic_tax = automatic_tax
2412
2454
  @billing_cycle_anchor = billing_cycle_anchor
2455
+ @billing_thresholds = billing_thresholds
2413
2456
  @collection_method = collection_method
2414
2457
  @currency = currency
2415
2458
  @default_payment_method = default_payment_method
@@ -2429,6 +2472,8 @@ module Stripe
2429
2472
  @trial_end = trial_end
2430
2473
  end
2431
2474
  end
2475
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
2476
+ attr_accessor :billing_mode
2432
2477
  # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
2433
2478
  attr_accessor :end_behavior
2434
2479
  # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
@@ -2436,7 +2481,8 @@ module Stripe
2436
2481
  # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2437
2482
  attr_accessor :proration_behavior
2438
2483
 
2439
- def initialize(end_behavior: nil, phases: nil, proration_behavior: nil)
2484
+ def initialize(billing_mode: nil, end_behavior: nil, phases: nil, proration_behavior: nil)
2485
+ @billing_mode = billing_mode
2440
2486
  @end_behavior = end_behavior
2441
2487
  @phases = phases
2442
2488
  @proration_behavior = proration_behavior
@@ -2444,7 +2490,25 @@ module Stripe
2444
2490
  end
2445
2491
 
2446
2492
  class SubscriptionDetails < Stripe::RequestParams
2493
+ class BillingMode < Stripe::RequestParams
2494
+ # Attribute for param field type
2495
+ attr_accessor :type
2496
+
2497
+ def initialize(type: nil)
2498
+ @type = type
2499
+ end
2500
+ end
2501
+
2447
2502
  class Item < Stripe::RequestParams
2503
+ class BillingThresholds < Stripe::RequestParams
2504
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
2505
+ attr_accessor :usage_gte
2506
+
2507
+ def initialize(usage_gte: nil)
2508
+ @usage_gte = usage_gte
2509
+ end
2510
+ end
2511
+
2448
2512
  class Discount < Stripe::RequestParams
2449
2513
  # ID of the coupon to create a new discount for.
2450
2514
  attr_accessor :coupon
@@ -2501,6 +2565,8 @@ module Stripe
2501
2565
  @unit_amount_decimal = unit_amount_decimal
2502
2566
  end
2503
2567
  end
2568
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
2569
+ attr_accessor :billing_thresholds
2504
2570
  # Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
2505
2571
  attr_accessor :clear_usage
2506
2572
  # A flag that, if set to `true`, will delete the specified item.
@@ -2523,6 +2589,7 @@ module Stripe
2523
2589
  attr_accessor :tax_rates
2524
2590
 
2525
2591
  def initialize(
2592
+ billing_thresholds: nil,
2526
2593
  clear_usage: nil,
2527
2594
  deleted: nil,
2528
2595
  discounts: nil,
@@ -2534,6 +2601,7 @@ module Stripe
2534
2601
  quantity: nil,
2535
2602
  tax_rates: nil
2536
2603
  )
2604
+ @billing_thresholds = billing_thresholds
2537
2605
  @clear_usage = clear_usage
2538
2606
  @deleted = deleted
2539
2607
  @discounts = discounts
@@ -2548,6 +2616,8 @@ module Stripe
2548
2616
  end
2549
2617
  # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
2550
2618
  attr_accessor :billing_cycle_anchor
2619
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
2620
+ attr_accessor :billing_mode
2551
2621
  # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
2552
2622
  attr_accessor :cancel_at
2553
2623
  # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
@@ -2571,6 +2641,7 @@ module Stripe
2571
2641
 
2572
2642
  def initialize(
2573
2643
  billing_cycle_anchor: nil,
2644
+ billing_mode: nil,
2574
2645
  cancel_at: nil,
2575
2646
  cancel_at_period_end: nil,
2576
2647
  cancel_now: nil,
@@ -2583,6 +2654,7 @@ module Stripe
2583
2654
  trial_end: nil
2584
2655
  )
2585
2656
  @billing_cycle_anchor = billing_cycle_anchor
2657
+ @billing_mode = billing_mode
2586
2658
  @cancel_at = cancel_at
2587
2659
  @cancel_at_period_end = cancel_at_period_end
2588
2660
  @cancel_now = cancel_now
@@ -2668,16 +2740,38 @@ module Stripe
2668
2740
  )
2669
2741
  end
2670
2742
 
2671
- # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
2743
+ # Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
2744
+ #
2745
+ # For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
2746
+ # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
2747
+ # invoice's status becomes paid.
2748
+ #
2749
+ # If the PaymentIntent's status is already succeeded when it's attached, it's
2750
+ # credited to the invoice immediately.
2751
+ #
2752
+ # See: [Partial payments](https://docs.stripe.com/docs/invoicing/partial-payments) to learn more.
2753
+ def attach_payment(invoice, params = {}, opts = {})
2754
+ request(
2755
+ method: :post,
2756
+ path: format("/v1/invoices/%<invoice>s/attach_payment", { invoice: CGI.escape(invoice) }),
2757
+ params: params,
2758
+ opts: opts,
2759
+ base_address: :api
2760
+ )
2761
+ end
2762
+
2763
+ # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://docs.stripe.com/api#finalize_invoice) the invoice to your customers.
2672
2764
  def create(params = {}, opts = {})
2673
2765
  request(method: :post, path: "/v1/invoices", params: params, opts: opts, base_address: :api)
2674
2766
  end
2675
2767
 
2676
- # At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
2768
+ # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
2677
2769
  #
2678
- # Note that when you are viewing an upcoming invoice, you are simply viewing a preview the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
2770
+ # You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update.
2771
+ #
2772
+ # The recommended way to get only the prorations being previewed on the invoice is to consider line items where parent.subscription_item_details.proration is true.
2679
2773
  #
2680
- # You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
2774
+ # Note that when you are viewing an upcoming invoice, you are simply viewing a preview the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
2681
2775
  #
2682
2776
  # Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
2683
2777
  def create_preview(params = {}, opts = {})
@@ -2690,7 +2784,7 @@ module Stripe
2690
2784
  )
2691
2785
  end
2692
2786
 
2693
- # Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice).
2787
+ # Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice).
2694
2788
  def delete(invoice, params = {}, opts = {})
2695
2789
  request(
2696
2790
  method: :delete,
@@ -2761,7 +2855,7 @@ module Stripe
2761
2855
  )
2762
2856
  end
2763
2857
 
2764
- # Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
2858
+ # Search for invoices you've previously created using Stripe's [Search Query Language](https://docs.stripe.com/docs/search#search-query-language).
2765
2859
  # Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
2766
2860
  # conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
2767
2861
  # to an hour behind during outages. Search functionality is not available to merchants in India.
@@ -2788,11 +2882,11 @@ module Stripe
2788
2882
  )
2789
2883
  end
2790
2884
 
2791
- # Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),
2885
+ # Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized),
2792
2886
  # monetary values, as well as collection_method, become uneditable.
2793
2887
  #
2794
2888
  # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
2795
- # sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass
2889
+ # sending reminders for, or [automatically reconciling](https://docs.stripe.com/docs/billing/invoices/reconciliation) invoices, pass
2796
2890
  # auto_advance=false.
2797
2891
  def update(invoice, params = {}, opts = {})
2798
2892
  request(
@@ -2815,9 +2909,9 @@ module Stripe
2815
2909
  )
2816
2910
  end
2817
2911
 
2818
- # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
2912
+ # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
2819
2913
  #
2820
- # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
2914
+ # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
2821
2915
  def void_invoice(invoice, params = {}, opts = {})
2822
2916
  request(
2823
2917
  method: :post,
@@ -108,8 +108,8 @@ module Stripe
108
108
  end
109
109
  end
110
110
 
111
- # [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
112
- # This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
111
+ # [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow.
112
+ # This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
113
113
  def approve(authorization, params = {}, opts = {})
114
114
  request(
115
115
  method: :post,
@@ -120,8 +120,8 @@ module Stripe
120
120
  )
121
121
  end
122
122
 
123
- # [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
124
- # This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
123
+ # [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow.
124
+ # This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
125
125
  def decline(authorization, params = {}, opts = {})
126
126
  request(
127
127
  method: :post,
@@ -219,7 +219,7 @@ module Stripe
219
219
  attr_accessor :currency
220
220
  # Specifies which fields in the response should be expanded.
221
221
  attr_accessor :expand
222
- # Attribute for param field financial_account
222
+ # The new financial account ID the card will be associated with. This field allows a card to be reassigned to a different financial account.
223
223
  attr_accessor :financial_account
224
224
  # 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
225
225
  attr_accessor :metadata
@@ -637,7 +637,7 @@ module Stripe
637
637
  end
638
638
  end
639
639
 
640
- # Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
640
+ # Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
641
641
  def create(params = {}, opts = {})
642
642
  request(
643
643
  method: :post,
@@ -670,7 +670,7 @@ module Stripe
670
670
  )
671
671
  end
672
672
 
673
- # Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
673
+ # Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
674
674
  def submit(dispute, params = {}, opts = {})
675
675
  request(
676
676
  method: :post,
@@ -6,7 +6,7 @@ module Stripe
6
6
  attr_reader :authorizations, :cards, :cardholders, :disputes, :personalization_designs, :physical_bundles, :tokens, :transactions
7
7
 
8
8
  def initialize(requestor)
9
- super(requestor)
9
+ super
10
10
  @authorizations = Stripe::Issuing::AuthorizationService.new(@requestor)
11
11
  @cards = Stripe::Issuing::CardService.new(@requestor)
12
12
  @cardholders = Stripe::Issuing::CardholderService.new(@requestor)