stripe 13.3.0.pre.beta.1 → 13.3.0.pre.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/OPENAPI_VERSION +1 -1
  4. data/VERSION +1 -1
  5. data/lib/stripe/object_types.rb +10 -0
  6. data/lib/stripe/resources/account.rb +230 -0
  7. data/lib/stripe/resources/account_link.rb +9 -0
  8. data/lib/stripe/resources/account_notice.rb +28 -0
  9. data/lib/stripe/resources/account_session.rb +103 -0
  10. data/lib/stripe/resources/apple_pay_domain.rb +13 -0
  11. data/lib/stripe/resources/application.rb +20 -0
  12. data/lib/stripe/resources/application_fee.rb +34 -0
  13. data/lib/stripe/resources/application_fee_refund.rb +17 -0
  14. data/lib/stripe/resources/apps/secret.rb +22 -0
  15. data/lib/stripe/resources/balance.rb +59 -0
  16. data/lib/stripe/resources/balance_transaction.rb +34 -0
  17. data/lib/stripe/resources/bank_account.rb +60 -2
  18. data/lib/stripe/resources/billing/alert.rb +21 -0
  19. data/lib/stripe/resources/billing/alert_triggered.rb +26 -0
  20. data/lib/stripe/resources/billing/credit_balance_summary.rb +25 -0
  21. data/lib/stripe/resources/billing/credit_balance_transaction.rb +45 -1
  22. data/lib/stripe/resources/billing/credit_grant.rb +46 -2
  23. data/lib/stripe/resources/billing/meter.rb +49 -7
  24. data/lib/stripe/resources/billing/meter_error_report.rb +44 -0
  25. data/lib/stripe/resources/billing/meter_event.rb +17 -3
  26. data/lib/stripe/resources/billing/meter_event_adjustment.rb +17 -1
  27. data/lib/stripe/resources/billing/meter_event_summary.rb +15 -0
  28. data/lib/stripe/resources/billing_portal/configuration.rb +70 -0
  29. data/lib/stripe/resources/billing_portal/session.rb +61 -0
  30. data/lib/stripe/resources/capability.rb +38 -0
  31. data/lib/stripe/resources/capital/financing_offer.rb +45 -0
  32. data/lib/stripe/resources/capital/financing_summary.rb +17 -0
  33. data/lib/stripe/resources/capital/financing_transaction.rb +29 -0
  34. data/lib/stripe/resources/card.rb +72 -0
  35. data/lib/stripe/resources/cash_balance.rb +14 -0
  36. data/lib/stripe/resources/charge.rb +469 -0
  37. data/lib/stripe/resources/checkout/session.rb +496 -0
  38. data/lib/stripe/resources/climate/order.rb +55 -0
  39. data/lib/stripe/resources/climate/product.rb +24 -0
  40. data/lib/stripe/resources/climate/supplier.rb +18 -0
  41. data/lib/stripe/resources/confirmation_token.rb +297 -0
  42. data/lib/stripe/resources/connect_collection_transfer.rb +24 -0
  43. data/lib/stripe/resources/country_spec.rb +27 -0
  44. data/lib/stripe/resources/coupon.rb +44 -0
  45. data/lib/stripe/resources/credit_note.rb +91 -0
  46. data/lib/stripe/resources/credit_note_line_item.rb +46 -0
  47. data/lib/stripe/resources/customer.rb +93 -0
  48. data/lib/stripe/resources/customer_balance_transaction.rb +27 -0
  49. data/lib/stripe/resources/customer_cash_balance_transaction.rb +72 -0
  50. data/lib/stripe/resources/customer_session.rb +34 -0
  51. data/lib/stripe/resources/discount.rb +29 -0
  52. data/lib/stripe/resources/dispute.rb +88 -0
  53. data/lib/stripe/resources/entitlements/active_entitlement.rb +11 -0
  54. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +23 -0
  55. data/lib/stripe/resources/entitlements/feature.rb +15 -0
  56. data/lib/stripe/resources/ephemeral_key.rb +13 -0
  57. data/lib/stripe/resources/event.rb +44 -0
  58. data/lib/stripe/resources/exchange_rate.rb +7 -0
  59. data/lib/stripe/resources/file.rb +23 -0
  60. data/lib/stripe/resources/file_link.rb +19 -0
  61. data/lib/stripe/resources/financial_connections/account.rb +84 -0
  62. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +13 -0
  63. data/lib/stripe/resources/financial_connections/account_owner.rb +17 -0
  64. data/lib/stripe/resources/financial_connections/account_ownership.rb +9 -0
  65. data/lib/stripe/resources/financial_connections/institution.rb +35 -0
  66. data/lib/stripe/resources/financial_connections/session.rb +49 -0
  67. data/lib/stripe/resources/financial_connections/transaction.rb +28 -0
  68. data/lib/stripe/resources/forwarding/request.rb +40 -0
  69. data/lib/stripe/resources/funding_instructions.rb +82 -0
  70. data/lib/stripe/resources/gift_cards/card.rb +37 -0
  71. data/lib/stripe/resources/gift_cards/transaction.rb +39 -0
  72. data/lib/stripe/resources/identity/verification_report.rb +92 -0
  73. data/lib/stripe/resources/identity/verification_session.rb +76 -0
  74. data/lib/stripe/resources/invoice.rb +337 -0
  75. data/lib/stripe/resources/invoice_item.rb +54 -0
  76. data/lib/stripe/resources/invoice_line_item.rb +83 -0
  77. data/lib/stripe/resources/invoice_payment.rb +34 -0
  78. data/lib/stripe/resources/invoice_rendering_template.rb +17 -0
  79. data/lib/stripe/resources/issuing/authorization.rb +129 -0
  80. data/lib/stripe/resources/issuing/card.rb +86 -0
  81. data/lib/stripe/resources/issuing/cardholder.rb +76 -0
  82. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +57 -0
  83. data/lib/stripe/resources/issuing/dispute.rb +65 -0
  84. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +23 -0
  85. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +17 -0
  86. data/lib/stripe/resources/issuing/personalization_design.rb +38 -0
  87. data/lib/stripe/resources/issuing/physical_bundle.rb +18 -0
  88. data/lib/stripe/resources/issuing/settlement.rb +49 -0
  89. data/lib/stripe/resources/issuing/token.rb +46 -0
  90. data/lib/stripe/resources/issuing/transaction.rb +106 -0
  91. data/lib/stripe/resources/line_item.rb +50 -0
  92. data/lib/stripe/resources/login_link.rb +7 -0
  93. data/lib/stripe/resources/mandate.rb +78 -0
  94. data/lib/stripe/resources/margin.rb +19 -0
  95. data/lib/stripe/resources/order.rb +202 -0
  96. data/lib/stripe/resources/payment_attempt_record.rb +73 -0
  97. data/lib/stripe/resources/payment_intent.rb +642 -0
  98. data/lib/stripe/resources/payment_link.rb +198 -0
  99. data/lib/stripe/resources/payment_method.rb +368 -0
  100. data/lib/stripe/resources/payment_method_configuration.rb +430 -0
  101. data/lib/stripe/resources/payment_method_domain.rb +57 -0
  102. data/lib/stripe/resources/payment_record.rb +79 -0
  103. data/lib/stripe/resources/payout.rb +56 -0
  104. data/lib/stripe/resources/person.rb +128 -0
  105. data/lib/stripe/resources/plan.rb +52 -0
  106. data/lib/stripe/resources/price.rb +77 -0
  107. data/lib/stripe/resources/product.rb +60 -0
  108. data/lib/stripe/resources/product_feature.rb +12 -0
  109. data/lib/stripe/resources/promotion_code.rb +35 -0
  110. data/lib/stripe/resources/quote.rb +252 -0
  111. data/lib/stripe/resources/quote_line.rb +136 -0
  112. data/lib/stripe/resources/quote_preview_invoice.rb +331 -0
  113. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +159 -0
  114. data/lib/stripe/resources/radar/early_fraud_warning.rb +17 -0
  115. data/lib/stripe/resources/radar/value_list.rb +23 -0
  116. data/lib/stripe/resources/radar/value_list_item.rb +17 -0
  117. data/lib/stripe/resources/refund.rb +130 -0
  118. data/lib/stripe/resources/reporting/report_run.rb +29 -0
  119. data/lib/stripe/resources/reporting/report_type.rb +19 -0
  120. data/lib/stripe/resources/reserve_transaction.rb +22 -0
  121. data/lib/stripe/resources/reversal.rb +21 -0
  122. data/lib/stripe/resources/review.rb +36 -0
  123. data/lib/stripe/resources/setup_attempt.rb +101 -0
  124. data/lib/stripe/resources/setup_intent.rb +158 -0
  125. data/lib/stripe/resources/shipping_rate.rb +42 -0
  126. data/lib/stripe/resources/sigma/scheduled_query_run.rb +26 -0
  127. data/lib/stripe/resources/source.rb +195 -0
  128. data/lib/stripe/resources/source_mandate_notification.rb +59 -0
  129. data/lib/stripe/resources/source_transaction.rb +48 -0
  130. data/lib/stripe/resources/subscription.rb +214 -0
  131. data/lib/stripe/resources/subscription_item.rb +46 -0
  132. data/lib/stripe/resources/subscription_schedule.rb +153 -0
  133. data/lib/stripe/resources/tax/association.rb +36 -0
  134. data/lib/stripe/resources/tax/calculation.rb +72 -0
  135. data/lib/stripe/resources/tax/calculation_line_item.rb +33 -0
  136. data/lib/stripe/resources/tax/form.rb +75 -0
  137. data/lib/stripe/resources/tax/registration.rb +379 -0
  138. data/lib/stripe/resources/tax/settings.rb +33 -0
  139. data/lib/stripe/resources/tax/transaction.rb +68 -0
  140. data/lib/stripe/resources/tax/transaction_line_item.rb +30 -0
  141. data/lib/stripe/resources/tax_code.rb +9 -0
  142. data/lib/stripe/resources/tax_deducted_at_source.rb +22 -0
  143. data/lib/stripe/resources/tax_id.rb +30 -0
  144. data/lib/stripe/resources/tax_rate.rb +42 -0
  145. data/lib/stripe/resources/terminal/configuration.rb +107 -0
  146. data/lib/stripe/resources/terminal/connection_token.rb +7 -0
  147. data/lib/stripe/resources/terminal/location.rb +20 -0
  148. data/lib/stripe/resources/terminal/reader.rb +118 -0
  149. data/lib/stripe/resources/terminal/reader_collected_data.rb +16 -0
  150. data/lib/stripe/resources/test_helpers/test_clock.rb +27 -0
  151. data/lib/stripe/resources/token.rb +29 -0
  152. data/lib/stripe/resources/topup.rb +33 -0
  153. data/lib/stripe/resources/transfer.rb +35 -0
  154. data/lib/stripe/resources/treasury/credit_reversal.rb +32 -0
  155. data/lib/stripe/resources/treasury/debit_reversal.rb +38 -0
  156. data/lib/stripe/resources/treasury/financial_account.rb +57 -0
  157. data/lib/stripe/resources/treasury/financial_account_features.rb +91 -0
  158. data/lib/stripe/resources/treasury/inbound_transfer.rb +66 -0
  159. data/lib/stripe/resources/treasury/outbound_payment.rb +85 -0
  160. data/lib/stripe/resources/treasury/outbound_transfer.rb +82 -0
  161. data/lib/stripe/resources/treasury/received_credit.rb +70 -0
  162. data/lib/stripe/resources/treasury/received_debit.rb +67 -0
  163. data/lib/stripe/resources/treasury/transaction.rb +42 -0
  164. data/lib/stripe/resources/treasury/transaction_entry.rb +34 -0
  165. data/lib/stripe/resources/usage_record.rb +13 -0
  166. data/lib/stripe/resources/usage_record_summary.rb +18 -0
  167. data/lib/stripe/resources/v2/amount.rb +9 -0
  168. data/lib/stripe/resources/v2/billing/meter_event.rb +18 -0
  169. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +20 -0
  170. data/lib/stripe/resources/v2/billing/meter_event_session.rb +14 -0
  171. data/lib/stripe/resources/v2/event.rb +21 -0
  172. data/lib/stripe/resources/v2/event_destination.rb +49 -0
  173. data/lib/stripe/resources/webhook_endpoint.rb +27 -0
  174. data/lib/stripe/resources.rb +10 -0
  175. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -1
  176. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +2 -2
  177. data/lib/stripe/services/billing/credit_grant_service.rb +3 -3
  178. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +1 -1
  179. data/lib/stripe/services/billing/meter_event_service.rb +1 -1
  180. data/lib/stripe/services/billing/meter_service.rb +5 -5
  181. data/lib/stripe/stripe_object.rb +5 -0
  182. data/lib/stripe/version.rb +1 -1
  183. data/stripe.gemspec +2 -1
  184. metadata +13 -2
@@ -0,0 +1,136 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ # A quote line defines a set of changes, in the order provided, that will be applied upon quote acceptance.
6
+ class QuoteLine < APIResource
7
+ OBJECT_NAME = "quote_line"
8
+ def self.object_name
9
+ "quote_line"
10
+ end
11
+
12
+ class Action < Stripe::StripeObject
13
+ class AddDiscount < Stripe::StripeObject
14
+ class DiscountEnd < Stripe::StripeObject
15
+ attr_reader :type
16
+ end
17
+ attr_reader :coupon, :discount, :discount_end, :index, :promotion_code
18
+ end
19
+
20
+ class AddItem < Stripe::StripeObject
21
+ class Discount < Stripe::StripeObject
22
+ class DiscountEnd < Stripe::StripeObject
23
+ attr_reader :timestamp, :type
24
+ end
25
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
26
+ end
27
+
28
+ class Trial < Stripe::StripeObject
29
+ attr_reader :converts_to, :type
30
+ end
31
+ attr_reader :discounts, :metadata, :price, :quantity, :tax_rates, :trial
32
+ end
33
+
34
+ class RemoveDiscount < Stripe::StripeObject
35
+ class DiscountEnd < Stripe::StripeObject
36
+ attr_reader :timestamp, :type
37
+ end
38
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
39
+ end
40
+
41
+ class RemoveItem < Stripe::StripeObject
42
+ attr_reader :price
43
+ end
44
+
45
+ class SetDiscount < Stripe::StripeObject
46
+ class DiscountEnd < Stripe::StripeObject
47
+ attr_reader :timestamp, :type
48
+ end
49
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
50
+ end
51
+
52
+ class SetItem < Stripe::StripeObject
53
+ class Discount < Stripe::StripeObject
54
+ class DiscountEnd < Stripe::StripeObject
55
+ attr_reader :timestamp, :type
56
+ end
57
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
58
+ end
59
+
60
+ class Trial < Stripe::StripeObject
61
+ attr_reader :converts_to, :type
62
+ end
63
+ attr_reader :discounts, :metadata, :price, :quantity, :tax_rates, :trial
64
+ end
65
+ attr_reader :add_discount, :add_item, :add_metadata, :remove_discount, :remove_item, :remove_metadata, :set_discounts, :set_items, :set_metadata, :type
66
+ end
67
+
68
+ class AppliesTo < Stripe::StripeObject
69
+ attr_reader :new_reference, :subscription_schedule, :type
70
+ end
71
+
72
+ class CancelSubscriptionSchedule < Stripe::StripeObject
73
+ attr_reader :cancel_at, :invoice_now, :prorate
74
+ end
75
+
76
+ class EndsAt < Stripe::StripeObject
77
+ class DiscountEnd < Stripe::StripeObject
78
+ attr_reader :discount
79
+ end
80
+
81
+ class Duration < Stripe::StripeObject
82
+ attr_reader :interval, :interval_count
83
+ end
84
+ attr_reader :computed, :discount_end, :duration, :timestamp, :type
85
+ end
86
+
87
+ class SetPauseCollection < Stripe::StripeObject
88
+ class Set < Stripe::StripeObject
89
+ attr_reader :behavior
90
+ end
91
+ attr_reader :set, :type
92
+ end
93
+
94
+ class StartsAt < Stripe::StripeObject
95
+ class DiscountEnd < Stripe::StripeObject
96
+ attr_reader :discount
97
+ end
98
+
99
+ class LineEndsAt < Stripe::StripeObject
100
+ attr_reader :id
101
+ end
102
+ attr_reader :computed, :discount_end, :line_ends_at, :timestamp, :type
103
+ end
104
+
105
+ class TrialSettings < Stripe::StripeObject
106
+ class EndBehavior < Stripe::StripeObject
107
+ attr_reader :prorate_up_front
108
+ end
109
+ attr_reader :end_behavior
110
+ end
111
+ # A list of items the customer is being quoted for.
112
+ attr_reader :actions
113
+ # Details to identify the subscription schedule the quote line applies to.
114
+ attr_reader :applies_to
115
+ # For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
116
+ attr_reader :billing_cycle_anchor
117
+ # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
118
+ attr_reader :cancel_subscription_schedule
119
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
120
+ attr_reader :ends_at
121
+ # Unique identifier for the object.
122
+ attr_reader :id
123
+ # String representing the object's type. Objects of the same type share the same value.
124
+ attr_reader :object
125
+ # Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
126
+ attr_reader :proration_behavior
127
+ # Details to modify the pause_collection behavior of the subscription schedule.
128
+ attr_reader :set_pause_collection
129
+ # Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
130
+ attr_reader :set_schedule_end
131
+ # Details to identify the earliest timestamp where the proposed change should take effect.
132
+ attr_reader :starts_at
133
+ # Settings related to subscription trials.
134
+ attr_reader :trial_settings
135
+ end
136
+ end
@@ -39,5 +39,336 @@ module Stripe
39
39
  def self.object_name
40
40
  "quote_preview_invoice"
41
41
  end
42
+
43
+ class AmountsDue < Stripe::StripeObject
44
+ attr_reader :amount, :amount_paid, :amount_remaining, :days_until_due, :description, :due_date, :paid_at, :status
45
+ end
46
+
47
+ class AppliesTo < Stripe::StripeObject
48
+ attr_reader :new_reference, :subscription_schedule, :type
49
+ end
50
+
51
+ class AutomaticTax < Stripe::StripeObject
52
+ class Liability < Stripe::StripeObject
53
+ attr_reader :account, :type
54
+ end
55
+ attr_reader :disabled_reason, :enabled, :liability, :status
56
+ end
57
+
58
+ class CustomField < Stripe::StripeObject
59
+ attr_reader :name, :value
60
+ end
61
+
62
+ class CustomerAddress < Stripe::StripeObject
63
+ attr_reader :city, :country, :line1, :line2, :postal_code, :state
64
+ end
65
+
66
+ class CustomerShipping < Stripe::StripeObject
67
+ class Address < Stripe::StripeObject
68
+ attr_reader :city, :country, :line1, :line2, :postal_code, :state
69
+ end
70
+ attr_reader :address, :carrier, :name, :phone, :tracking_number
71
+ end
72
+
73
+ class CustomerTaxId < Stripe::StripeObject
74
+ attr_reader :type, :value
75
+ end
76
+
77
+ class FromInvoice < Stripe::StripeObject
78
+ attr_reader :action, :invoice
79
+ end
80
+
81
+ class Issuer < Stripe::StripeObject
82
+ attr_reader :account, :type
83
+ end
84
+
85
+ class LastFinalizationError < Stripe::StripeObject
86
+ attr_reader :charge, :code, :decline_code, :doc_url, :message, :network_advice_code, :network_decline_code, :param, :payment_intent, :payment_method, :payment_method_type, :request_log_url, :setup_intent, :source, :type
87
+ end
88
+
89
+ class PaymentSettings < Stripe::StripeObject
90
+ class PaymentMethodOptions < Stripe::StripeObject
91
+ class AcssDebit < Stripe::StripeObject
92
+ class MandateOptions < Stripe::StripeObject
93
+ attr_reader :transaction_type
94
+ end
95
+ attr_reader :mandate_options, :verification_method
96
+ end
97
+
98
+ class Bancontact < Stripe::StripeObject
99
+ attr_reader :preferred_language
100
+ end
101
+
102
+ class Card < Stripe::StripeObject
103
+ class Installments < Stripe::StripeObject
104
+ attr_reader :enabled
105
+ end
106
+ attr_reader :installments, :request_three_d_secure
107
+ end
108
+
109
+ class CustomerBalance < Stripe::StripeObject
110
+ class BankTransfer < Stripe::StripeObject
111
+ class EuBankTransfer < Stripe::StripeObject
112
+ attr_reader :country
113
+ end
114
+ attr_reader :eu_bank_transfer, :type
115
+ end
116
+ attr_reader :bank_transfer, :funding_type
117
+ end
118
+
119
+ class IdBankTransfer < Stripe::StripeObject; end
120
+ class Konbini < Stripe::StripeObject; end
121
+ class SepaDebit < Stripe::StripeObject; end
122
+
123
+ class UsBankAccount < Stripe::StripeObject
124
+ class FinancialConnections < Stripe::StripeObject
125
+ class Filters < Stripe::StripeObject
126
+ attr_reader :account_subcategories, :institution
127
+ end
128
+ attr_reader :filters, :permissions, :prefetch
129
+ end
130
+ attr_reader :financial_connections, :verification_method
131
+ end
132
+ attr_reader :acss_debit, :bancontact, :card, :customer_balance, :id_bank_transfer, :konbini, :sepa_debit, :us_bank_account
133
+ end
134
+ attr_reader :default_mandate, :payment_method_options, :payment_method_types
135
+ end
136
+
137
+ class Rendering < Stripe::StripeObject
138
+ class Pdf < Stripe::StripeObject
139
+ attr_reader :page_size
140
+ end
141
+ attr_reader :amount_tax_display, :pdf, :template, :template_version
142
+ end
143
+
144
+ class ShippingCost < Stripe::StripeObject
145
+ class Tax < Stripe::StripeObject
146
+ attr_reader :amount, :rate, :taxability_reason, :taxable_amount
147
+ end
148
+ attr_reader :amount_subtotal, :amount_tax, :amount_total, :shipping_rate, :taxes
149
+ end
150
+
151
+ class ShippingDetails < Stripe::StripeObject
152
+ class Address < Stripe::StripeObject
153
+ attr_reader :city, :country, :line1, :line2, :postal_code, :state
154
+ end
155
+ attr_reader :address, :carrier, :name, :phone, :tracking_number
156
+ end
157
+
158
+ class StatusTransitions < Stripe::StripeObject
159
+ attr_reader :finalized_at, :marked_uncollectible_at, :paid_at, :voided_at
160
+ end
161
+
162
+ class SubscriptionDetails < Stripe::StripeObject
163
+ class PauseCollection < Stripe::StripeObject
164
+ attr_reader :behavior, :resumes_at
165
+ end
166
+ attr_reader :metadata, :pause_collection
167
+ end
168
+
169
+ class ThresholdReason < Stripe::StripeObject
170
+ class ItemReason < Stripe::StripeObject
171
+ attr_reader :line_item_ids, :usage_gte
172
+ end
173
+ attr_reader :amount_gte, :item_reasons
174
+ end
175
+
176
+ class TotalDiscountAmount < Stripe::StripeObject
177
+ attr_reader :amount, :discount
178
+ end
179
+
180
+ class TotalMarginAmount < Stripe::StripeObject
181
+ attr_reader :amount, :margin
182
+ end
183
+
184
+ class TotalPretaxCreditAmount < Stripe::StripeObject
185
+ attr_reader :amount, :credit_balance_transaction, :discount, :margin, :type
186
+ end
187
+
188
+ class TotalTaxAmount < Stripe::StripeObject
189
+ attr_reader :amount, :inclusive, :tax_rate, :taxability_reason, :taxable_amount
190
+ end
191
+
192
+ class TransferData < Stripe::StripeObject
193
+ attr_reader :amount, :destination
194
+ end
195
+ # The country of the business associated with this invoice, most often the business creating the invoice.
196
+ attr_reader :account_country
197
+ # The public name of the business associated with this invoice, most often the business creating the invoice.
198
+ attr_reader :account_name
199
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
200
+ attr_reader :account_tax_ids
201
+ # Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.
202
+ attr_reader :amount_due
203
+ # Amount that was overpaid on the invoice. Overpayments are debited to the customer's credit balance.
204
+ attr_reader :amount_overpaid
205
+ # The amount, in cents (or local equivalent), that was paid.
206
+ attr_reader :amount_paid
207
+ # The difference between amount_due and amount_paid, in cents (or local equivalent).
208
+ attr_reader :amount_remaining
209
+ # This is the sum of all the shipping amounts.
210
+ attr_reader :amount_shipping
211
+ # List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically.
212
+ attr_reader :amounts_due
213
+ # ID of the Connect Application that created the invoice.
214
+ attr_reader :application
215
+ # The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
216
+ attr_reader :application_fee_amount
217
+ # Attribute for field applies_to
218
+ attr_reader :applies_to
219
+ # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
220
+ attr_reader :attempt_count
221
+ # Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.
222
+ attr_reader :attempted
223
+ # Attribute for field automatic_tax
224
+ attr_reader :automatic_tax
225
+ # The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized.
226
+ attr_reader :automatically_finalizes_at
227
+ # Indicates the reason why the invoice was created.
228
+ #
229
+ # * `manual`: Unrelated to a subscription, for example, created via the invoice editor.
230
+ # * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds.
231
+ # * `subscription_create`: A new subscription was created.
232
+ # * `subscription_cycle`: A subscription advanced into a new period.
233
+ # * `subscription_threshold`: A subscription reached a billing threshold.
234
+ # * `subscription_update`: A subscription was updated.
235
+ # * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint.
236
+ attr_reader :billing_reason
237
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
238
+ attr_reader :collection_method
239
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
240
+ attr_reader :created
241
+ # 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).
242
+ attr_reader :currency
243
+ # Custom fields displayed on the invoice.
244
+ attr_reader :custom_fields
245
+ # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated.
246
+ attr_reader :customer_address
247
+ # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.
248
+ attr_reader :customer_email
249
+ # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated.
250
+ attr_reader :customer_name
251
+ # The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated.
252
+ attr_reader :customer_phone
253
+ # The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated.
254
+ attr_reader :customer_shipping
255
+ # The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated.
256
+ attr_reader :customer_tax_exempt
257
+ # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.
258
+ attr_reader :customer_tax_ids
259
+ # The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin.
260
+ attr_reader :default_margins
261
+ # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
262
+ attr_reader :default_payment_method
263
+ # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
264
+ attr_reader :default_source
265
+ # The tax rates applied to this invoice, if any.
266
+ attr_reader :default_tax_rates
267
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
268
+ attr_reader :description
269
+ # Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.
270
+ attr_reader :discount
271
+ # The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
272
+ attr_reader :discounts
273
+ # The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`.
274
+ attr_reader :due_date
275
+ # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
276
+ attr_reader :effective_at
277
+ # Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
278
+ attr_reader :ending_balance
279
+ # Footer displayed on the invoice.
280
+ attr_reader :footer
281
+ # Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
282
+ attr_reader :from_invoice
283
+ # 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.
284
+ attr_reader :id
285
+ # Attribute for field issuer
286
+ attr_reader :issuer
287
+ # The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
288
+ attr_reader :last_finalization_error
289
+ # The ID of the most recent non-draft revision of this invoice
290
+ attr_reader :latest_revision
291
+ # The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
292
+ attr_reader :lines
293
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
294
+ attr_reader :livemode
295
+ # 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.
296
+ attr_reader :metadata
297
+ # The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`.
298
+ attr_reader :next_payment_attempt
299
+ # A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
300
+ attr_reader :number
301
+ # String representing the object's type. Objects of the same type share the same value.
302
+ attr_reader :object
303
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
304
+ attr_reader :on_behalf_of
305
+ # Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.
306
+ attr_reader :paid
307
+ # Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.
308
+ attr_reader :paid_out_of_band
309
+ # The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent.
310
+ attr_reader :payment_intent
311
+ # Attribute for field payment_settings
312
+ attr_reader :payment_settings
313
+ # Payments for this invoice
314
+ attr_reader :payments
315
+ # End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
316
+ attr_reader :period_end
317
+ # Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
318
+ attr_reader :period_start
319
+ # Total amount of all post-payment credit notes issued for this invoice.
320
+ attr_reader :post_payment_credit_notes_amount
321
+ # Total amount of all pre-payment credit notes issued for this invoice.
322
+ attr_reader :pre_payment_credit_notes_amount
323
+ # The quote this invoice was generated from.
324
+ attr_reader :quote
325
+ # This is the transaction number that appears on email receipts sent for this invoice.
326
+ attr_reader :receipt_number
327
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
328
+ attr_reader :rendering
329
+ # The details of the cost of shipping, including the ShippingRate applied on the invoice.
330
+ attr_reader :shipping_cost
331
+ # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
332
+ attr_reader :shipping_details
333
+ # Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
334
+ attr_reader :starting_balance
335
+ # Extra information about an invoice for the customer's credit card statement.
336
+ attr_reader :statement_descriptor
337
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
338
+ attr_reader :status
339
+ # Attribute for field status_transitions
340
+ attr_reader :status_transitions
341
+ # Attribute for field subscription
342
+ attr_reader :subscription
343
+ # Details about the subscription that created this invoice.
344
+ attr_reader :subscription_details
345
+ # Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
346
+ attr_reader :subscription_proration_date
347
+ # Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
348
+ attr_reader :subtotal
349
+ # The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
350
+ attr_reader :subtotal_excluding_tax
351
+ # The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
352
+ attr_reader :tax
353
+ # ID of the test clock this invoice belongs to.
354
+ attr_reader :test_clock
355
+ # Attribute for field threshold_reason
356
+ attr_reader :threshold_reason
357
+ # Total after discounts and taxes.
358
+ attr_reader :total
359
+ # The aggregate amounts calculated per discount across all line items.
360
+ attr_reader :total_discount_amounts
361
+ # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
362
+ attr_reader :total_excluding_tax
363
+ # The aggregate amounts calculated per margin across all line items.
364
+ attr_reader :total_margin_amounts
365
+ # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
366
+ attr_reader :total_pretax_credit_amounts
367
+ # The aggregate amounts calculated per tax rate for all line items.
368
+ attr_reader :total_tax_amounts
369
+ # The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
370
+ attr_reader :transfer_data
371
+ # Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
372
+ attr_reader :webhooks_delivered_at
42
373
  end
43
374
  end
@@ -7,5 +7,164 @@ module Stripe
7
7
  def self.object_name
8
8
  "quote_preview_subscription_schedule"
9
9
  end
10
+
11
+ class AppliesTo < Stripe::StripeObject
12
+ attr_reader :new_reference, :subscription_schedule, :type
13
+ end
14
+
15
+ class CurrentPhase < Stripe::StripeObject
16
+ attr_reader :end_date, :start_date
17
+ end
18
+
19
+ class DefaultSettings < Stripe::StripeObject
20
+ class AutomaticTax < Stripe::StripeObject
21
+ class Liability < Stripe::StripeObject
22
+ attr_reader :account, :type
23
+ end
24
+ attr_reader :disabled_reason, :enabled, :liability
25
+ end
26
+
27
+ class BillingThresholds < Stripe::StripeObject
28
+ attr_reader :amount_gte, :reset_billing_cycle_anchor
29
+ end
30
+
31
+ class InvoiceSettings < Stripe::StripeObject
32
+ class Issuer < Stripe::StripeObject
33
+ attr_reader :account, :type
34
+ end
35
+ attr_reader :account_tax_ids, :days_until_due, :issuer
36
+ end
37
+
38
+ class TransferData < Stripe::StripeObject
39
+ attr_reader :amount_percent, :destination
40
+ end
41
+ attr_reader :application_fee_percent, :automatic_tax, :billing_cycle_anchor, :billing_thresholds, :collection_method, :default_payment_method, :description, :invoice_settings, :on_behalf_of, :transfer_data
42
+ end
43
+
44
+ class LastPriceMigrationError < Stripe::StripeObject
45
+ class FailedTransition < Stripe::StripeObject
46
+ attr_reader :source_price, :target_price
47
+ end
48
+ attr_reader :errored_at, :failed_transitions, :type
49
+ end
50
+
51
+ class Phase < Stripe::StripeObject
52
+ class AddInvoiceItem < Stripe::StripeObject
53
+ class Discount < Stripe::StripeObject
54
+ class DiscountEnd < Stripe::StripeObject
55
+ attr_reader :timestamp, :type
56
+ end
57
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
58
+ end
59
+ attr_reader :discounts, :price, :quantity, :tax_rates
60
+ end
61
+
62
+ class AutomaticTax < Stripe::StripeObject
63
+ class Liability < Stripe::StripeObject
64
+ attr_reader :account, :type
65
+ end
66
+ attr_reader :disabled_reason, :enabled, :liability
67
+ end
68
+
69
+ class BillingThresholds < Stripe::StripeObject
70
+ attr_reader :amount_gte, :reset_billing_cycle_anchor
71
+ end
72
+
73
+ class Discount < Stripe::StripeObject
74
+ class DiscountEnd < Stripe::StripeObject
75
+ attr_reader :timestamp, :type
76
+ end
77
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
78
+ end
79
+
80
+ class InvoiceSettings < Stripe::StripeObject
81
+ class Issuer < Stripe::StripeObject
82
+ attr_reader :account, :type
83
+ end
84
+ attr_reader :account_tax_ids, :days_until_due, :issuer
85
+ end
86
+
87
+ class Item < Stripe::StripeObject
88
+ class BillingThresholds < Stripe::StripeObject
89
+ attr_reader :usage_gte
90
+ end
91
+
92
+ class Discount < Stripe::StripeObject
93
+ class DiscountEnd < Stripe::StripeObject
94
+ attr_reader :timestamp, :type
95
+ end
96
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
97
+ end
98
+
99
+ class Trial < Stripe::StripeObject
100
+ attr_reader :converts_to, :type
101
+ end
102
+ attr_reader :billing_thresholds, :discounts, :metadata, :plan, :price, :quantity, :tax_rates, :trial
103
+ end
104
+
105
+ class PauseCollection < Stripe::StripeObject
106
+ attr_reader :behavior
107
+ end
108
+
109
+ class TransferData < Stripe::StripeObject
110
+ attr_reader :amount_percent, :destination
111
+ end
112
+
113
+ class TrialSettings < Stripe::StripeObject
114
+ class EndBehavior < Stripe::StripeObject
115
+ attr_reader :prorate_up_front
116
+ end
117
+ attr_reader :end_behavior
118
+ end
119
+ attr_reader :add_invoice_items, :application_fee_percent, :automatic_tax, :billing_cycle_anchor, :billing_thresholds, :collection_method, :coupon, :currency, :default_payment_method, :default_tax_rates, :description, :discounts, :end_date, :invoice_settings, :items, :metadata, :on_behalf_of, :pause_collection, :proration_behavior, :start_date, :transfer_data, :trial_continuation, :trial_end, :trial_settings
120
+ end
121
+
122
+ class Prebilling < Stripe::StripeObject
123
+ attr_reader :invoice, :period_end, :period_start, :update_behavior
124
+ end
125
+ # ID of the Connect Application that created the schedule.
126
+ attr_reader :application
127
+ # Attribute for field applies_to
128
+ attr_reader :applies_to
129
+ # 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.
130
+ attr_reader :billing_behavior
131
+ # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
132
+ attr_reader :canceled_at
133
+ # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
134
+ attr_reader :completed_at
135
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
136
+ attr_reader :created
137
+ # Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`.
138
+ attr_reader :current_phase
139
+ # ID of the customer who owns the subscription schedule.
140
+ attr_reader :customer
141
+ # Attribute for field default_settings
142
+ attr_reader :default_settings
143
+ # 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.
144
+ attr_reader :end_behavior
145
+ # Unique identifier for the object.
146
+ attr_reader :id
147
+ # Details of the most recent price migration that failed for the subscription schedule.
148
+ attr_reader :last_price_migration_error
149
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
150
+ attr_reader :livemode
151
+ # 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.
152
+ attr_reader :metadata
153
+ # String representing the object's type. Objects of the same type share the same value.
154
+ attr_reader :object
155
+ # Configuration for the subscription schedule's phases.
156
+ attr_reader :phases
157
+ # Time period and invoice for a Subscription billed in advance.
158
+ attr_reader :prebilling
159
+ # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
160
+ attr_reader :released_at
161
+ # ID of the subscription once managed by the subscription schedule (if it is released).
162
+ attr_reader :released_subscription
163
+ # The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules).
164
+ attr_reader :status
165
+ # ID of the subscription managed by the subscription schedule.
166
+ attr_reader :subscription
167
+ # ID of the test clock this subscription schedule belongs to.
168
+ attr_reader :test_clock
10
169
  end
11
170
  end
@@ -15,6 +15,23 @@ module Stripe
15
15
  "radar.early_fraud_warning"
16
16
  end
17
17
 
18
+ # An EFW is actionable if it has not received a dispute and has not been fully refunded. You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later.
19
+ attr_reader :actionable
20
+ # ID of the charge this early fraud warning is for, optionally expanded.
21
+ attr_reader :charge
22
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
23
+ attr_reader :created
24
+ # The type of fraud labelled by the issuer. One of `card_never_received`, `fraudulent_card_application`, `made_with_counterfeit_card`, `made_with_lost_card`, `made_with_stolen_card`, `misc`, `unauthorized_use_of_card`.
25
+ attr_reader :fraud_type
26
+ # Unique identifier for the object.
27
+ attr_reader :id
28
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
29
+ attr_reader :livemode
30
+ # String representing the object's type. Objects of the same type share the same value.
31
+ attr_reader :object
32
+ # ID of the Payment Intent this early fraud warning is for, optionally expanded.
33
+ attr_reader :payment_intent
34
+
18
35
  # Returns a list of early fraud warnings.
19
36
  def self.list(filters = {}, opts = {})
20
37
  request_stripe_object(