stripe 15.2.0.pre.beta.1 → 15.3.0.pre.beta.1

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 (196) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +92 -0
  3. data/CONTRIBUTING.md +25 -0
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +10 -7
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_version.rb +1 -1
  8. data/lib/stripe/event_types.rb +9 -0
  9. data/lib/stripe/events/v2_core_account_link_completed_event.rb +1 -1
  10. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +1 -1
  11. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +1 -1
  12. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +1 -1
  13. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +1 -1
  14. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +1 -1
  15. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +1 -1
  16. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +1 -1
  17. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +1 -1
  18. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +1 -1
  19. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +1 -1
  20. data/lib/stripe/events/v2_off_session_payment_requires_capture_event.rb +21 -0
  21. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  22. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +21 -0
  23. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  24. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  25. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  26. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  27. data/lib/stripe/object_types.rb +1 -3
  28. data/lib/stripe/resources/account.rb +47 -20
  29. data/lib/stripe/resources/account_session.rb +85 -24
  30. data/lib/stripe/resources/apple_pay_domain.rb +1 -2
  31. data/lib/stripe/resources/balance.rb +42 -0
  32. data/lib/stripe/resources/balance_transaction.rb +2 -0
  33. data/lib/stripe/resources/bank_account.rb +2 -2
  34. data/lib/stripe/resources/billing_portal/session.rb +1 -1
  35. data/lib/stripe/resources/capability.rb +1 -1
  36. data/lib/stripe/resources/charge.rb +85 -9
  37. data/lib/stripe/resources/checkout/session.rb +22 -6
  38. data/lib/stripe/resources/confirmation_token.rb +37 -97
  39. data/lib/stripe/resources/country_spec.rb +1 -1
  40. data/lib/stripe/resources/coupon.rb +1 -2
  41. data/lib/stripe/resources/credit_note.rb +10 -11
  42. data/lib/stripe/resources/customer.rb +2 -4
  43. data/lib/stripe/resources/customer_session.rb +3 -3
  44. data/lib/stripe/resources/dispute.rb +2 -2
  45. data/lib/stripe/resources/event.rb +1 -1
  46. data/lib/stripe/resources/file.rb +1 -1
  47. data/lib/stripe/resources/financial_connections/account.rb +2 -0
  48. data/lib/stripe/resources/financial_connections/institution.rb +2 -0
  49. data/lib/stripe/resources/identity/verification_report.rb +6 -0
  50. data/lib/stripe/resources/identity/verification_session.rb +17 -11
  51. data/lib/stripe/resources/invoice.rb +70 -43
  52. data/lib/stripe/resources/invoice_item.rb +2 -3
  53. data/lib/stripe/resources/invoice_line_item.rb +1 -1
  54. data/lib/stripe/resources/invoice_payment.rb +9 -2
  55. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  56. data/lib/stripe/resources/issuing/card.rb +1 -1
  57. data/lib/stripe/resources/issuing/dispute.rb +3 -3
  58. data/lib/stripe/resources/order.rb +2 -55
  59. data/lib/stripe/resources/payment_attempt_record.rb +8 -0
  60. data/lib/stripe/resources/payment_intent.rb +439 -411
  61. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +7 -0
  62. data/lib/stripe/resources/payment_method.rb +50 -113
  63. data/lib/stripe/resources/payment_method_configuration.rb +297 -2
  64. data/lib/stripe/resources/payment_method_domain.rb +2 -2
  65. data/lib/stripe/resources/payment_record.rb +8 -0
  66. data/lib/stripe/resources/payout.rb +4 -4
  67. data/lib/stripe/resources/person.rb +2 -2
  68. data/lib/stripe/resources/plan.rb +2 -3
  69. data/lib/stripe/resources/price.rb +1 -1
  70. data/lib/stripe/resources/privacy/redaction_job.rb +52 -29
  71. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +12 -4
  72. data/lib/stripe/resources/product.rb +1 -61
  73. data/lib/stripe/resources/quote.rb +1 -1
  74. data/lib/stripe/resources/quote_preview_invoice.rb +2 -2
  75. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +26 -1
  76. data/lib/stripe/resources/radar/value_list.rb +1 -2
  77. data/lib/stripe/resources/radar/value_list_item.rb +1 -2
  78. data/lib/stripe/resources/refund.rb +6 -1
  79. data/lib/stripe/resources/reversal.rb +1 -1
  80. data/lib/stripe/resources/review.rb +1 -1
  81. data/lib/stripe/resources/setup_intent.rb +123 -311
  82. data/lib/stripe/resources/source.rb +1 -1
  83. data/lib/stripe/resources/subscription.rb +132 -37
  84. data/lib/stripe/resources/subscription_item.rb +33 -0
  85. data/lib/stripe/resources/subscription_schedule.rb +120 -5
  86. data/lib/stripe/resources/tax/association.rb +8 -31
  87. data/lib/stripe/resources/tax/calculation.rb +4 -0
  88. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  89. data/lib/stripe/resources/tax/registration.rb +1 -1
  90. data/lib/stripe/resources/tax_id.rb +1 -2
  91. data/lib/stripe/resources/tax_rate.rb +2 -2
  92. data/lib/stripe/resources/terminal/configuration.rb +1 -2
  93. data/lib/stripe/resources/terminal/location.rb +2 -3
  94. data/lib/stripe/resources/terminal/reader.rb +26 -4
  95. data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
  96. data/lib/stripe/resources/token.rb +2 -2
  97. data/lib/stripe/resources/transfer.rb +1 -1
  98. data/lib/stripe/resources/v2/core/account.rb +5 -5
  99. data/lib/stripe/resources/v2/money_management/received_credit.rb +0 -20
  100. data/lib/stripe/resources/v2/money_management/received_debit.rb +0 -24
  101. data/lib/stripe/resources/v2/payments/off_session_payment.rb +74 -0
  102. data/lib/stripe/resources/webhook_endpoint.rb +1 -2
  103. data/lib/stripe/resources.rb +8 -3
  104. data/lib/stripe/services/account_external_account_service.rb +2 -3
  105. data/lib/stripe/services/account_login_link_service.rb +1 -1
  106. data/lib/stripe/services/account_person_service.rb +1 -2
  107. data/lib/stripe/services/account_service.rb +38 -13
  108. data/lib/stripe/services/account_session_service.rb +49 -24
  109. data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
  110. data/lib/stripe/services/balance_service.rb +1 -1
  111. data/lib/stripe/services/balance_settings_service.rb +2 -2
  112. data/lib/stripe/services/charge_service.rb +76 -8
  113. data/lib/stripe/services/checkout/session_service.rb +14 -6
  114. data/lib/stripe/services/coupon_service.rb +1 -2
  115. data/lib/stripe/services/credit_note_service.rb +7 -8
  116. data/lib/stripe/services/customer_balance_transaction_service.rb +3 -3
  117. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +2 -2
  118. data/lib/stripe/services/customer_payment_source_service.rb +1 -1
  119. data/lib/stripe/services/customer_service.rb +3 -5
  120. data/lib/stripe/services/customer_tax_id_service.rb +1 -2
  121. data/lib/stripe/services/dispute_service.rb +1 -1
  122. data/lib/stripe/services/external_account_service.rb +2 -3
  123. data/lib/stripe/services/file_service.rb +1 -1
  124. data/lib/stripe/services/identity/verification_session_service.rb +5 -5
  125. data/lib/stripe/services/invoice_item_service.rb +1 -2
  126. data/lib/stripe/services/invoice_service.rb +65 -35
  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/order_service.rb +1 -33
  131. data/lib/stripe/services/payment_intent_service.rb +385 -386
  132. data/lib/stripe/services/payment_method_configuration_service.rb +212 -2
  133. data/lib/stripe/services/payment_method_domain_service.rb +1 -1
  134. data/lib/stripe/services/payment_method_service.rb +47 -110
  135. data/lib/stripe/services/payout_service.rb +2 -2
  136. data/lib/stripe/services/plan_service.rb +2 -3
  137. data/lib/stripe/services/price_service.rb +2 -2
  138. data/lib/stripe/services/privacy/redaction_job_service.rb +22 -13
  139. data/lib/stripe/services/privacy/redaction_job_validation_error_service.rb +1 -1
  140. data/lib/stripe/services/product_feature_service.rb +1 -2
  141. data/lib/stripe/services/product_service.rb +2 -41
  142. data/lib/stripe/services/promotion_code_service.rb +1 -1
  143. data/lib/stripe/services/quote_service.rb +1 -1
  144. data/lib/stripe/services/radar/early_fraud_warning_service.rb +1 -1
  145. data/lib/stripe/services/radar/value_list_item_service.rb +1 -2
  146. data/lib/stripe/services/radar/value_list_service.rb +1 -2
  147. data/lib/stripe/services/setup_intent_service.rb +122 -310
  148. data/lib/stripe/services/source_service.rb +1 -1
  149. data/lib/stripe/services/subscription_item_service.rb +26 -0
  150. data/lib/stripe/services/subscription_schedule_service.rb +94 -4
  151. data/lib/stripe/services/subscription_service.rb +103 -33
  152. data/lib/stripe/services/tax/calculation_service.rb +4 -0
  153. data/lib/stripe/services/tax/registration_service.rb +1 -1
  154. data/lib/stripe/services/tax_id_service.rb +1 -2
  155. data/lib/stripe/services/terminal/configuration_service.rb +1 -2
  156. data/lib/stripe/services/terminal/location_service.rb +2 -3
  157. data/lib/stripe/services/terminal/reader_service.rb +17 -3
  158. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +37 -97
  159. data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
  160. data/lib/stripe/services/token_service.rb +1 -1
  161. data/lib/stripe/services/transfer_service.rb +1 -1
  162. data/lib/stripe/services/v1_services.rb +1 -2
  163. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
  164. data/lib/stripe/services/v2/core/accounts/person_service.rb +2 -4
  165. data/lib/stripe/services/v2/core/event_destination_service.rb +4 -10
  166. data/lib/stripe/services/v2/core/event_service.rb +1 -2
  167. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +3 -7
  168. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +2 -4
  169. data/lib/stripe/services/v2/money_management/adjustment_service.rb +1 -2
  170. data/lib/stripe/services/v2/money_management/financial_account_service.rb +1 -2
  171. data/lib/stripe/services/v2/money_management/financial_address_service.rb +1 -1
  172. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +1 -2
  173. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +1 -2
  174. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +2 -4
  175. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +2 -4
  176. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +2 -4
  177. data/lib/stripe/services/v2/money_management/payout_method_service.rb +3 -7
  178. data/lib/stripe/services/v2/money_management/received_credit_service.rb +1 -2
  179. data/lib/stripe/services/v2/money_management/received_debit_service.rb +1 -2
  180. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +1 -2
  181. data/lib/stripe/services/v2/money_management/transaction_service.rb +1 -2
  182. data/lib/stripe/services/v2/payment_service.rb +15 -0
  183. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +138 -0
  184. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +1 -2
  185. data/lib/stripe/services/v2_services.rb +2 -1
  186. data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
  187. data/lib/stripe/services.rb +2 -3
  188. data/lib/stripe/version.rb +1 -1
  189. data/rbi/stripe.rbi +3903 -4131
  190. metadata +13 -8
  191. data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
  192. data/lib/stripe/resources/gift_cards/card.rb +0 -208
  193. data/lib/stripe/resources/gift_cards/transaction.rb +0 -272
  194. data/lib/stripe/services/gift_cards/card_service.rb +0 -170
  195. data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
  196. data/lib/stripe/services/gift_cards_service.rb +0 -14
@@ -5,9 +5,9 @@ module Stripe
5
5
  # A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
6
6
  # control over a Customer.
7
7
  #
8
- # Related guides: [Customer Session with the Payment Element](https://stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#save-payment-methods),
9
- # [Customer Session with the Pricing Table](https://stripe.com/payments/checkout/pricing-table#customer-session),
10
- # [Customer Session with the Buy Button](https://stripe.com/payment-links/buy-button#pass-an-existing-customer).
8
+ # Related guides: [Customer Session with the Payment Element](https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#save-payment-methods),
9
+ # [Customer Session with the Pricing Table](https://docs.stripe.com/payments/checkout/pricing-table#customer-session),
10
+ # [Customer Session with the Buy Button](https://docs.stripe.com/payment-links/buy-button#pass-an-existing-customer).
11
11
  class CustomerSession < APIResource
12
12
  extend Stripe::APIOperations::Create
13
13
 
@@ -621,7 +621,7 @@ module Stripe
621
621
  attr_reader :payment_intent
622
622
  # Attribute for field payment_method_details
623
623
  attr_reader :payment_method_details
624
- # Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories).
624
+ # Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `noncompliant`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories).
625
625
  attr_reader :reason
626
626
  # Current status of dispute. Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`.
627
627
  attr_reader :status
@@ -657,7 +657,7 @@ module Stripe
657
657
 
658
658
  # When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically.
659
659
  #
660
- # Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories).
660
+ # Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://docs.stripe.com/docs/disputes/categories).
661
661
  def self.update(dispute, params = {}, opts = {})
662
662
  request_stripe_object(
663
663
  method: :post,
@@ -142,7 +142,7 @@ module Stripe
142
142
  attr_reader :account
143
143
  # The Stripe API version used to render `data`. This property is populated only for events on or after October 31, 2014.
144
144
  attr_reader :api_version
145
- # Attribute for field context
145
+ # Authentication context needed to fetch the event or related object.
146
146
  attr_reader :context
147
147
  # Time at which the object was created. Measured in seconds since the Unix epoch.
148
148
  attr_reader :created
@@ -6,7 +6,7 @@ module Stripe
6
6
  # files with the [create file](https://stripe.com/docs/api#create_file) request
7
7
  # (for example, when uploading dispute evidence). Stripe also
8
8
  # creates files independently (for example, the results of a [Sigma scheduled
9
- # query](https://stripe.com/docs/api#scheduled_queries)).
9
+ # query](https://docs.stripe.com/api#scheduled_queries)).
10
10
  #
11
11
  # Related guide: [File upload guide](https://stripe.com/docs/file-upload)
12
12
  class File < APIResource
@@ -230,6 +230,8 @@ module Stripe
230
230
  attr_reader :id
231
231
  # The state of the most recent attempt to refresh the account's inferred balance history.
232
232
  attr_reader :inferred_balances_refresh
233
+ # The ID of the Financial Connections Institution this account belongs to. Note that this relationship may sometimes change in rare circumstances (e.g. institution mergers).
234
+ attr_reader :institution
233
235
  # The name of the institution that holds this account.
234
236
  attr_reader :institution_name
235
237
  # The last 4 digits of the account number. If present, this will be 4 numeric characters.
@@ -59,6 +59,8 @@ module Stripe
59
59
  @starting_after = starting_after
60
60
  end
61
61
  end
62
+ # The list of countries supported by this institution, formatted as ISO country codes.
63
+ attr_reader :countries
62
64
  # Attribute for field features
63
65
  attr_reader :features
64
66
  # Unique identifier for the object.
@@ -91,10 +91,16 @@ module Stripe
91
91
  attr_reader :last_name
92
92
  # Document ID number.
93
93
  attr_reader :number
94
+ # Sex of the person in the document.
95
+ attr_reader :sex
94
96
  # Status of this `document` check.
95
97
  attr_reader :status
96
98
  # Type of the document.
97
99
  attr_reader :type
100
+ # Place of birth as it appears in the document.
101
+ attr_reader :unparsed_place_of_birth
102
+ # Sex as it appears in the document.
103
+ attr_reader :unparsed_sex
98
104
  end
99
105
 
100
106
  class Email < Stripe::StripeObject
@@ -5,11 +5,11 @@ module Stripe
5
5
  module Identity
6
6
  # A VerificationSession guides you through the process of collecting and verifying the identities
7
7
  # of your users. It contains details about the type of verification, such as what [verification
8
- # check](https://stripe.com/docs/identity/verification-checks) to perform. Only create one VerificationSession for
8
+ # check](https://docs.stripe.com/docs/identity/verification-checks) to perform. Only create one VerificationSession for
9
9
  # each verification in your system.
10
10
  #
11
11
  # A VerificationSession transitions through [multiple
12
- # statuses](https://stripe.com/docs/identity/how-sessions-work) throughout its lifetime as it progresses through
12
+ # statuses](https://docs.stripe.com/docs/identity/how-sessions-work) throughout its lifetime as it progresses through
13
13
  # the verification flow. The VerificationSession contains the user's verified data after
14
14
  # verification checks are complete.
15
15
  #
@@ -116,6 +116,12 @@ module Stripe
116
116
  attr_reader :last_name
117
117
  # The user's verified phone number
118
118
  attr_reader :phone
119
+ # The user's verified sex.
120
+ attr_reader :sex
121
+ # The user's verified place of birth as it appears in the document.
122
+ attr_reader :unparsed_place_of_birth
123
+ # The user's verified sex as it appears in the document.
124
+ attr_reader :unparsed_sex
119
125
  end
120
126
 
121
127
  class ListParams < Stripe::RequestParams
@@ -386,9 +392,9 @@ module Stripe
386
392
  # The user’s verified data.
387
393
  attr_reader :verified_outputs
388
394
 
389
- # A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
395
+ # A VerificationSession object can be canceled when it is in requires_input [status](https://docs.stripe.com/docs/identity/how-sessions-work).
390
396
  #
391
- # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
397
+ # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#cancel).
392
398
  def cancel(params = {}, opts = {})
393
399
  request_stripe_object(
394
400
  method: :post,
@@ -398,9 +404,9 @@ module Stripe
398
404
  )
399
405
  end
400
406
 
401
- # A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
407
+ # A VerificationSession object can be canceled when it is in requires_input [status](https://docs.stripe.com/docs/identity/how-sessions-work).
402
408
  #
403
- # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
409
+ # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#cancel).
404
410
  def self.cancel(session, params = {}, opts = {})
405
411
  request_stripe_object(
406
412
  method: :post,
@@ -416,7 +422,7 @@ module Stripe
416
422
  #
417
423
  # If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode.
418
424
  #
419
- # Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents)
425
+ # Related guide: [Verify your users' identity documents](https://docs.stripe.com/docs/identity/verify-identity-documents)
420
426
  def self.create(params = {}, opts = {})
421
427
  request_stripe_object(
422
428
  method: :post,
@@ -441,7 +447,7 @@ module Stripe
441
447
  # request logs, etc.
442
448
  #
443
449
  # A VerificationSession object can be redacted when it is in requires_input or verified
444
- # [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
450
+ # [status](https://docs.stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
445
451
  # state will automatically cancel it.
446
452
  #
447
453
  # The redaction process may take up to four days. When the redaction process is in progress, the
@@ -454,7 +460,7 @@ module Stripe
454
460
  # placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
455
461
  # used for any purpose.
456
462
  #
457
- # [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
463
+ # [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#redact).
458
464
  def redact(params = {}, opts = {})
459
465
  request_stripe_object(
460
466
  method: :post,
@@ -469,7 +475,7 @@ module Stripe
469
475
  # request logs, etc.
470
476
  #
471
477
  # A VerificationSession object can be redacted when it is in requires_input or verified
472
- # [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
478
+ # [status](https://docs.stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
473
479
  # state will automatically cancel it.
474
480
  #
475
481
  # The redaction process may take up to four days. When the redaction process is in progress, the
@@ -482,7 +488,7 @@ module Stripe
482
488
  # placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
483
489
  # used for any purpose.
484
490
  #
485
- # [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
491
+ # [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#redact).
486
492
  def self.redact(session, params = {}, opts = {})
487
493
  request_stripe_object(
488
494
  method: :post,
@@ -26,7 +26,7 @@ module Stripe
26
26
  # Stripe applies any customer credit on the account before determining the
27
27
  # amount due for the invoice (i.e., the amount that will be actually
28
28
  # charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge
29
- # per currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the
29
+ # per currency](https://docs.stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the
30
30
  # invoice is automatically marked paid, and we add the amount due to the
31
31
  # customer's credit balance which is applied to the next invoice.
32
32
  #
@@ -496,8 +496,7 @@ module Stripe
496
496
  attr_reader :type
497
497
  end
498
498
 
499
- class DeleteParams < Stripe::RequestParams
500
- end
499
+ class DeleteParams < Stripe::RequestParams; end
501
500
 
502
501
  class UpdateParams < Stripe::RequestParams
503
502
  class AmountsDue < Stripe::RequestParams
@@ -711,14 +710,9 @@ module Stripe
711
710
  end
712
711
  end
713
712
 
714
- class IdBankTransfer < Stripe::RequestParams
715
- end
716
-
717
- class Konbini < Stripe::RequestParams
718
- end
719
-
720
- class SepaDebit < Stripe::RequestParams
721
- end
713
+ class IdBankTransfer < Stripe::RequestParams; end
714
+ class Konbini < Stripe::RequestParams; end
715
+ class SepaDebit < Stripe::RequestParams; end
722
716
 
723
717
  class UsBankAccount < Stripe::RequestParams
724
718
  class FinancialConnections < Stripe::RequestParams
@@ -1429,14 +1423,9 @@ module Stripe
1429
1423
  end
1430
1424
  end
1431
1425
 
1432
- class IdBankTransfer < Stripe::RequestParams
1433
- end
1434
-
1435
- class Konbini < Stripe::RequestParams
1436
- end
1437
-
1438
- class SepaDebit < Stripe::RequestParams
1439
- end
1426
+ class IdBankTransfer < Stripe::RequestParams; end
1427
+ class Konbini < Stripe::RequestParams; end
1428
+ class SepaDebit < Stripe::RequestParams; end
1440
1429
 
1441
1430
  class UsBankAccount < Stripe::RequestParams
1442
1431
  class FinancialConnections < Stripe::RequestParams
@@ -3467,6 +3456,18 @@ module Stripe
3467
3456
  end
3468
3457
  end
3469
3458
 
3459
+ class BillingThresholds < Stripe::RequestParams
3460
+ # Monetary threshold that triggers the subscription to advance to a new billing period
3461
+ attr_accessor :amount_gte
3462
+ # 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.
3463
+ attr_accessor :reset_billing_cycle_anchor
3464
+
3465
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
3466
+ @amount_gte = amount_gte
3467
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
3468
+ end
3469
+ end
3470
+
3470
3471
  class Discount < Stripe::RequestParams
3471
3472
  class DiscountEnd < Stripe::RequestParams
3472
3473
  class Duration < Stripe::RequestParams
@@ -3537,6 +3538,15 @@ module Stripe
3537
3538
  end
3538
3539
 
3539
3540
  class Item < Stripe::RequestParams
3541
+ class BillingThresholds < Stripe::RequestParams
3542
+ # 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))
3543
+ attr_accessor :usage_gte
3544
+
3545
+ def initialize(usage_gte: nil)
3546
+ @usage_gte = usage_gte
3547
+ end
3548
+ end
3549
+
3540
3550
  class Discount < Stripe::RequestParams
3541
3551
  class DiscountEnd < Stripe::RequestParams
3542
3552
  class Duration < Stripe::RequestParams
@@ -3633,6 +3643,8 @@ module Stripe
3633
3643
  @type = type
3634
3644
  end
3635
3645
  end
3646
+ # 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.
3647
+ attr_accessor :billing_thresholds
3636
3648
  # The coupons to redeem into discounts for the subscription item.
3637
3649
  attr_accessor :discounts
3638
3650
  # 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`.
@@ -3651,6 +3663,7 @@ module Stripe
3651
3663
  attr_accessor :trial
3652
3664
 
3653
3665
  def initialize(
3666
+ billing_thresholds: nil,
3654
3667
  discounts: nil,
3655
3668
  metadata: nil,
3656
3669
  plan: nil,
@@ -3660,6 +3673,7 @@ module Stripe
3660
3673
  tax_rates: nil,
3661
3674
  trial: nil
3662
3675
  )
3676
+ @billing_thresholds = billing_thresholds
3663
3677
  @discounts = discounts
3664
3678
  @metadata = metadata
3665
3679
  @plan = plan
@@ -3716,6 +3730,8 @@ module Stripe
3716
3730
  attr_accessor :automatic_tax
3717
3731
  # 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).
3718
3732
  attr_accessor :billing_cycle_anchor
3733
+ # 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.
3734
+ attr_accessor :billing_thresholds
3719
3735
  # 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.
3720
3736
  attr_accessor :collection_method
3721
3737
  # 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).
@@ -3742,7 +3758,7 @@ module Stripe
3742
3758
  attr_accessor :on_behalf_of
3743
3759
  # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
3744
3760
  attr_accessor :pause_collection
3745
- # 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.
3761
+ # 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.
3746
3762
  attr_accessor :proration_behavior
3747
3763
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
3748
3764
  attr_accessor :start_date
@@ -3762,6 +3778,7 @@ module Stripe
3762
3778
  application_fee_percent: nil,
3763
3779
  automatic_tax: nil,
3764
3780
  billing_cycle_anchor: nil,
3781
+ billing_thresholds: nil,
3765
3782
  collection_method: nil,
3766
3783
  currency: nil,
3767
3784
  default_payment_method: nil,
@@ -3787,6 +3804,7 @@ module Stripe
3787
3804
  @application_fee_percent = application_fee_percent
3788
3805
  @automatic_tax = automatic_tax
3789
3806
  @billing_cycle_anchor = billing_cycle_anchor
3807
+ @billing_thresholds = billing_thresholds
3790
3808
  @collection_method = collection_method
3791
3809
  @currency = currency
3792
3810
  @default_payment_method = default_payment_method
@@ -3862,7 +3880,7 @@ module Stripe
3862
3880
  attr_accessor :amendments
3863
3881
  # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
3864
3882
  attr_accessor :billing_behavior
3865
- # Configure billing_mode to opt in improved credit proration behavior.When the schedule creates a subscription, the subscription's `billing_mode` will be set to the same value as the schedule's `billing_mode`.
3883
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
3866
3884
  attr_accessor :billing_mode
3867
3885
  # 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.
3868
3886
  attr_accessor :end_behavior
@@ -3894,6 +3912,15 @@ module Stripe
3894
3912
 
3895
3913
  class SubscriptionDetails < Stripe::RequestParams
3896
3914
  class Item < Stripe::RequestParams
3915
+ class BillingThresholds < Stripe::RequestParams
3916
+ # 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))
3917
+ attr_accessor :usage_gte
3918
+
3919
+ def initialize(usage_gte: nil)
3920
+ @usage_gte = usage_gte
3921
+ end
3922
+ end
3923
+
3897
3924
  class Discount < Stripe::RequestParams
3898
3925
  class DiscountEnd < Stripe::RequestParams
3899
3926
  class Duration < Stripe::RequestParams
@@ -3978,6 +4005,8 @@ module Stripe
3978
4005
  @unit_amount_decimal = unit_amount_decimal
3979
4006
  end
3980
4007
  end
4008
+ # 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.
4009
+ attr_accessor :billing_thresholds
3981
4010
  # 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.
3982
4011
  attr_accessor :clear_usage
3983
4012
  # A flag that, if set to `true`, will delete the specified item.
@@ -4000,6 +4029,7 @@ module Stripe
4000
4029
  attr_accessor :tax_rates
4001
4030
 
4002
4031
  def initialize(
4032
+ billing_thresholds: nil,
4003
4033
  clear_usage: nil,
4004
4034
  deleted: nil,
4005
4035
  discounts: nil,
@@ -4011,6 +4041,7 @@ module Stripe
4011
4041
  quantity: nil,
4012
4042
  tax_rates: nil
4013
4043
  )
4044
+ @billing_thresholds = billing_thresholds
4014
4045
  @clear_usage = clear_usage
4015
4046
  @deleted = deleted
4016
4047
  @discounts = discounts
@@ -4034,11 +4065,11 @@ module Stripe
4034
4065
  end
4035
4066
  # 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`.
4036
4067
  attr_accessor :billing_cycle_anchor
4037
- # Configure billing_mode in each subscription to opt in improved credit proration behavior.
4068
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
4038
4069
  attr_accessor :billing_mode
4039
4070
  # 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.
4040
4071
  attr_accessor :cancel_at
4041
- # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
4072
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead.
4042
4073
  attr_accessor :cancel_at_period_end
4043
4074
  # This simulates the subscription being canceled or expired immediately.
4044
4075
  attr_accessor :cancel_now
@@ -4246,7 +4277,7 @@ module Stripe
4246
4277
  attr_reader :from_invoice
4247
4278
  # The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
4248
4279
  attr_reader :hosted_invoice_url
4249
- # Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details.
4280
+ # Unique identifier for the object. For preview invoices created using the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint, this id will be prefixed with `upcoming_in`.
4250
4281
  attr_reader :id
4251
4282
  # The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
4252
4283
  attr_reader :invoice_pdf
@@ -4347,9 +4378,6 @@ module Stripe
4347
4378
 
4348
4379
  # Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
4349
4380
  #
4350
- # For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
4351
- # of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
4352
- #
4353
4381
  # For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
4354
4382
  # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
4355
4383
  # invoice's status becomes paid.
@@ -4357,7 +4385,7 @@ module Stripe
4357
4385
  # If the PaymentIntent's status is already succeeded when it's attached, it's
4358
4386
  # credited to the invoice immediately.
4359
4387
  #
4360
- # See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
4388
+ # See: [Partial payments](https://docs.stripe.com/docs/invoicing/partial-payments) to learn more.
4361
4389
  def attach_payment(params = {}, opts = {})
4362
4390
  request_stripe_object(
4363
4391
  method: :post,
@@ -4369,9 +4397,6 @@ module Stripe
4369
4397
 
4370
4398
  # Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
4371
4399
  #
4372
- # For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
4373
- # of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
4374
- #
4375
4400
  # For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
4376
4401
  # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
4377
4402
  # invoice's status becomes paid.
@@ -4379,7 +4404,7 @@ module Stripe
4379
4404
  # If the PaymentIntent's status is already succeeded when it's attached, it's
4380
4405
  # credited to the invoice immediately.
4381
4406
  #
4382
- # See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
4407
+ # See: [Partial payments](https://docs.stripe.com/docs/invoicing/partial-payments) to learn more.
4383
4408
  def self.attach_payment(invoice, params = {}, opts = {})
4384
4409
  request_stripe_object(
4385
4410
  method: :post,
@@ -4389,16 +4414,18 @@ module Stripe
4389
4414
  )
4390
4415
  end
4391
4416
 
4392
- # 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.
4417
+ # 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.
4393
4418
  def self.create(params = {}, opts = {})
4394
4419
  request_stripe_object(method: :post, path: "/v1/invoices", params: params, opts: opts)
4395
4420
  end
4396
4421
 
4397
4422
  # 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.
4398
4423
  #
4399
- # 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.
4424
+ # 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.
4425
+ #
4426
+ # 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.
4400
4427
  #
4401
- # 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.
4428
+ # 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.
4402
4429
  #
4403
4430
  # 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)
4404
4431
  def self.create_preview(params = {}, opts = {})
@@ -4410,7 +4437,7 @@ module Stripe
4410
4437
  )
4411
4438
  end
4412
4439
 
4413
- # 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).
4440
+ # 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).
4414
4441
  def self.delete(invoice, params = {}, opts = {})
4415
4442
  request_stripe_object(
4416
4443
  method: :delete,
@@ -4420,7 +4447,7 @@ module Stripe
4420
4447
  )
4421
4448
  end
4422
4449
 
4423
- # 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).
4450
+ # 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).
4424
4451
  def delete(params = {}, opts = {})
4425
4452
  request_stripe_object(
4426
4453
  method: :delete,
@@ -4547,11 +4574,11 @@ module Stripe
4547
4574
  )
4548
4575
  end
4549
4576
 
4550
- # Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),
4577
+ # Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized),
4551
4578
  # monetary values, as well as collection_method, become uneditable.
4552
4579
  #
4553
4580
  # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
4554
- # sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass
4581
+ # sending reminders for, or [automatically reconciling](https://docs.stripe.com/docs/billing/invoices/reconciliation) invoices, pass
4555
4582
  # auto_advance=false.
4556
4583
  def self.update(invoice, params = {}, opts = {})
4557
4584
  request_stripe_object(
@@ -4582,9 +4609,9 @@ module Stripe
4582
4609
  )
4583
4610
  end
4584
4611
 
4585
- # 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.
4612
+ # 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.
4586
4613
  #
4587
- # 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.
4614
+ # 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.
4588
4615
  def void_invoice(params = {}, opts = {})
4589
4616
  request_stripe_object(
4590
4617
  method: :post,
@@ -4594,9 +4621,9 @@ module Stripe
4594
4621
  )
4595
4622
  end
4596
4623
 
4597
- # 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.
4624
+ # 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.
4598
4625
  #
4599
- # 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.
4626
+ # 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.
4600
4627
  def self.void_invoice(invoice, params = {}, opts = {})
4601
4628
  request_stripe_object(
4602
4629
  method: :post,
@@ -59,8 +59,7 @@ module Stripe
59
59
  attr_reader :unit_amount_decimal
60
60
  end
61
61
 
62
- class DeleteParams < Stripe::RequestParams
63
- end
62
+ class DeleteParams < Stripe::RequestParams; end
64
63
 
65
64
  class UpdateParams < Stripe::RequestParams
66
65
  class Discount < Stripe::RequestParams
@@ -483,7 +482,7 @@ module Stripe
483
482
  attr_reader :metadata
484
483
  # String representing the object's type. Objects of the same type share the same value.
485
484
  attr_reader :object
486
- # The parent that generated this invoice
485
+ # The parent that generated this invoice item.
487
486
  attr_reader :parent
488
487
  # Attribute for field period
489
488
  attr_reader :period
@@ -400,7 +400,7 @@ module Stripe
400
400
  attr_reader :metadata
401
401
  # String representing the object's type. Objects of the same type share the same value.
402
402
  attr_reader :object
403
- # The parent that generated this invoice
403
+ # The parent that generated this line item.
404
404
  attr_reader :parent
405
405
  # Attribute for field period
406
406
  attr_reader :period
@@ -2,7 +2,14 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
- # The invoice payment object
5
+ # Invoice Payments represent payments made against invoices. Invoice Payments can
6
+ # be accessed in two ways:
7
+ # 1. By expanding the `payments` field on the [Invoice](https://stripe.com/docs/api#invoice) resource.
8
+ # 2. By using the Invoice Payment retrieve and list endpoints.
9
+ #
10
+ # Invoice Payments include the mapping between payment objects, such as Payment Intent, and Invoices.
11
+ # This resource and its endpoints allows you to easily track if a payment is associated with a specific invoice and
12
+ # monitor the allocation details of the payments.
6
13
  class InvoicePayment < APIResource
7
14
  OBJECT_NAME = "invoice_payment"
8
15
  def self.object_name
@@ -10,7 +17,7 @@ module Stripe
10
17
  end
11
18
 
12
19
  class Payment < Stripe::StripeObject
13
- # ID of the successful charge for this payment when `type` is `charge`.
20
+ # ID of the successful charge for this payment when `type` is `charge`.Note: charge is only surfaced if the charge object is not associated with a payment intent. If the charge object does have a payment intent, the Invoice Payment surfaces the payment intent instead.
14
21
  attr_reader :charge
15
22
  # ID of the PaymentIntent associated with this payment when `type` is `payment_intent`. Note: This property is only populated for invoices finalized on or after March 15th, 2019.
16
23
  attr_reader :payment_intent
@@ -1122,8 +1122,8 @@ module Stripe
1122
1122
  # The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized.
1123
1123
  attr_reader :wallet
1124
1124
 
1125
- # [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.
1126
- # 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).
1125
+ # [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.
1126
+ # 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).
1127
1127
  def approve(params = {}, opts = {})
1128
1128
  request_stripe_object(
1129
1129
  method: :post,
@@ -1134,8 +1134,8 @@ module Stripe
1134
1134
  end
1135
1135
 
1136
1136
  deprecate :approve, :none, 2024, 3
1137
- # [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.
1138
- # 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).
1137
+ # [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.
1138
+ # 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).
1139
1139
  def self.approve(authorization, params = {}, opts = {})
1140
1140
  request_stripe_object(
1141
1141
  method: :post,
@@ -1150,8 +1150,8 @@ module Stripe
1150
1150
  deprecate :approve, :none, 2024, 3
1151
1151
  end
1152
1152
 
1153
- # [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.
1154
- # 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).
1153
+ # [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.
1154
+ # 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).
1155
1155
  def decline(params = {}, opts = {})
1156
1156
  request_stripe_object(
1157
1157
  method: :post,
@@ -1162,8 +1162,8 @@ module Stripe
1162
1162
  end
1163
1163
 
1164
1164
  deprecate :decline, :none, 2024, 3
1165
- # [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.
1166
- # 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).
1165
+ # [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.
1166
+ # 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).
1167
1167
  def self.decline(authorization, params = {}, opts = {})
1168
1168
  request_stripe_object(
1169
1169
  method: :post,