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
@@ -50,6 +50,343 @@ module Stripe
50
50
  nested_resource_class_methods :line, operations: %i[list]
51
51
  nested_resource_class_methods :payment, operations: %i[retrieve list]
52
52
 
53
+ class AmountsDue < Stripe::StripeObject
54
+ attr_reader :amount, :amount_paid, :amount_remaining, :days_until_due, :description, :due_date, :paid_at, :status
55
+ end
56
+
57
+ class AutomaticTax < Stripe::StripeObject
58
+ class Liability < Stripe::StripeObject
59
+ attr_reader :account, :type
60
+ end
61
+ attr_reader :disabled_reason, :enabled, :liability, :status
62
+ end
63
+
64
+ class CustomField < Stripe::StripeObject
65
+ attr_reader :name, :value
66
+ end
67
+
68
+ class CustomerAddress < Stripe::StripeObject
69
+ attr_reader :city, :country, :line1, :line2, :postal_code, :state
70
+ end
71
+
72
+ class CustomerShipping < Stripe::StripeObject
73
+ class Address < Stripe::StripeObject
74
+ attr_reader :city, :country, :line1, :line2, :postal_code, :state
75
+ end
76
+ attr_reader :address, :carrier, :name, :phone, :tracking_number
77
+ end
78
+
79
+ class CustomerTaxId < Stripe::StripeObject
80
+ attr_reader :type, :value
81
+ end
82
+
83
+ class FromInvoice < Stripe::StripeObject
84
+ attr_reader :action, :invoice
85
+ end
86
+
87
+ class Issuer < Stripe::StripeObject
88
+ attr_reader :account, :type
89
+ end
90
+
91
+ class LastFinalizationError < Stripe::StripeObject
92
+ 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
93
+ end
94
+
95
+ class PaymentSettings < Stripe::StripeObject
96
+ class PaymentMethodOptions < Stripe::StripeObject
97
+ class AcssDebit < Stripe::StripeObject
98
+ class MandateOptions < Stripe::StripeObject
99
+ attr_reader :transaction_type
100
+ end
101
+ attr_reader :mandate_options, :verification_method
102
+ end
103
+
104
+ class Bancontact < Stripe::StripeObject
105
+ attr_reader :preferred_language
106
+ end
107
+
108
+ class Card < Stripe::StripeObject
109
+ class Installments < Stripe::StripeObject
110
+ attr_reader :enabled
111
+ end
112
+ attr_reader :installments, :request_three_d_secure
113
+ end
114
+
115
+ class CustomerBalance < Stripe::StripeObject
116
+ class BankTransfer < Stripe::StripeObject
117
+ class EuBankTransfer < Stripe::StripeObject
118
+ attr_reader :country
119
+ end
120
+ attr_reader :eu_bank_transfer, :type
121
+ end
122
+ attr_reader :bank_transfer, :funding_type
123
+ end
124
+
125
+ class IdBankTransfer < Stripe::StripeObject; end
126
+ class Konbini < Stripe::StripeObject; end
127
+ class SepaDebit < Stripe::StripeObject; end
128
+
129
+ class UsBankAccount < Stripe::StripeObject
130
+ class FinancialConnections < Stripe::StripeObject
131
+ class Filters < Stripe::StripeObject
132
+ attr_reader :account_subcategories, :institution
133
+ end
134
+ attr_reader :filters, :permissions, :prefetch
135
+ end
136
+ attr_reader :financial_connections, :verification_method
137
+ end
138
+ attr_reader :acss_debit, :bancontact, :card, :customer_balance, :id_bank_transfer, :konbini, :sepa_debit, :us_bank_account
139
+ end
140
+ attr_reader :default_mandate, :payment_method_options, :payment_method_types
141
+ end
142
+
143
+ class Rendering < Stripe::StripeObject
144
+ class Pdf < Stripe::StripeObject
145
+ attr_reader :page_size
146
+ end
147
+ attr_reader :amount_tax_display, :pdf, :template, :template_version
148
+ end
149
+
150
+ class ShippingCost < Stripe::StripeObject
151
+ class Tax < Stripe::StripeObject
152
+ attr_reader :amount, :rate, :taxability_reason, :taxable_amount
153
+ end
154
+ attr_reader :amount_subtotal, :amount_tax, :amount_total, :shipping_rate, :taxes
155
+ end
156
+
157
+ class ShippingDetails < Stripe::StripeObject
158
+ class Address < Stripe::StripeObject
159
+ attr_reader :city, :country, :line1, :line2, :postal_code, :state
160
+ end
161
+ attr_reader :address, :carrier, :name, :phone, :tracking_number
162
+ end
163
+
164
+ class StatusTransitions < Stripe::StripeObject
165
+ attr_reader :finalized_at, :marked_uncollectible_at, :paid_at, :voided_at
166
+ end
167
+
168
+ class SubscriptionDetails < Stripe::StripeObject
169
+ class PauseCollection < Stripe::StripeObject
170
+ attr_reader :behavior, :resumes_at
171
+ end
172
+ attr_reader :metadata, :pause_collection
173
+ end
174
+
175
+ class ThresholdReason < Stripe::StripeObject
176
+ class ItemReason < Stripe::StripeObject
177
+ attr_reader :line_item_ids, :usage_gte
178
+ end
179
+ attr_reader :amount_gte, :item_reasons
180
+ end
181
+
182
+ class TotalDiscountAmount < Stripe::StripeObject
183
+ attr_reader :amount, :discount
184
+ end
185
+
186
+ class TotalMarginAmount < Stripe::StripeObject
187
+ attr_reader :amount, :margin
188
+ end
189
+
190
+ class TotalPretaxCreditAmount < Stripe::StripeObject
191
+ attr_reader :amount, :credit_balance_transaction, :discount, :margin, :type
192
+ end
193
+
194
+ class TotalTaxAmount < Stripe::StripeObject
195
+ attr_reader :amount, :inclusive, :tax_rate, :taxability_reason, :taxable_amount
196
+ end
197
+
198
+ class TransferData < Stripe::StripeObject
199
+ attr_reader :amount, :destination
200
+ end
201
+ # The country of the business associated with this invoice, most often the business creating the invoice.
202
+ attr_reader :account_country
203
+ # The public name of the business associated with this invoice, most often the business creating the invoice.
204
+ attr_reader :account_name
205
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
206
+ attr_reader :account_tax_ids
207
+ # 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`.
208
+ attr_reader :amount_due
209
+ # Amount that was overpaid on the invoice. Overpayments are debited to the customer's credit balance.
210
+ attr_reader :amount_overpaid
211
+ # The amount, in cents (or local equivalent), that was paid.
212
+ attr_reader :amount_paid
213
+ # The difference between amount_due and amount_paid, in cents (or local equivalent).
214
+ attr_reader :amount_remaining
215
+ # This is the sum of all the shipping amounts.
216
+ attr_reader :amount_shipping
217
+ # List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically.
218
+ attr_reader :amounts_due
219
+ # ID of the Connect Application that created the invoice.
220
+ attr_reader :application
221
+ # 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.
222
+ attr_reader :application_fee_amount
223
+ # 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.
224
+ attr_reader :attempt_count
225
+ # 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.
226
+ attr_reader :attempted
227
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
228
+ attr_reader :auto_advance
229
+ # Attribute for field automatic_tax
230
+ attr_reader :automatic_tax
231
+ # 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.
232
+ attr_reader :automatically_finalizes_at
233
+ # Indicates the reason why the invoice was created.
234
+ #
235
+ # * `manual`: Unrelated to a subscription, for example, created via the invoice editor.
236
+ # * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds.
237
+ # * `subscription_create`: A new subscription was created.
238
+ # * `subscription_cycle`: A subscription advanced into a new period.
239
+ # * `subscription_threshold`: A subscription reached a billing threshold.
240
+ # * `subscription_update`: A subscription was updated.
241
+ # * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint.
242
+ attr_reader :billing_reason
243
+ # ID of the latest charge generated for this invoice, if any.
244
+ attr_reader :charge
245
+ # 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.
246
+ attr_reader :collection_method
247
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
248
+ attr_reader :created
249
+ # 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).
250
+ attr_reader :currency
251
+ # Custom fields displayed on the invoice.
252
+ attr_reader :custom_fields
253
+ # The ID of the customer who will be billed.
254
+ attr_reader :customer
255
+ # 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.
256
+ attr_reader :customer_address
257
+ # 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.
258
+ attr_reader :customer_email
259
+ # 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.
260
+ attr_reader :customer_name
261
+ # 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.
262
+ attr_reader :customer_phone
263
+ # 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.
264
+ attr_reader :customer_shipping
265
+ # 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.
266
+ attr_reader :customer_tax_exempt
267
+ # 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.
268
+ attr_reader :customer_tax_ids
269
+ # The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin.
270
+ attr_reader :default_margins
271
+ # 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.
272
+ attr_reader :default_payment_method
273
+ # 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.
274
+ attr_reader :default_source
275
+ # The tax rates applied to this invoice, if any.
276
+ attr_reader :default_tax_rates
277
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
278
+ attr_reader :description
279
+ # Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.
280
+ attr_reader :discount
281
+ # The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
282
+ attr_reader :discounts
283
+ # The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`.
284
+ attr_reader :due_date
285
+ # 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.
286
+ attr_reader :effective_at
287
+ # 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.
288
+ attr_reader :ending_balance
289
+ # Footer displayed on the invoice.
290
+ attr_reader :footer
291
+ # Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
292
+ attr_reader :from_invoice
293
+ # 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.
294
+ attr_reader :hosted_invoice_url
295
+ # 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.
296
+ attr_reader :id
297
+ # The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
298
+ attr_reader :invoice_pdf
299
+ # Attribute for field issuer
300
+ attr_reader :issuer
301
+ # The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
302
+ attr_reader :last_finalization_error
303
+ # The ID of the most recent non-draft revision of this invoice
304
+ attr_reader :latest_revision
305
+ # 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.
306
+ attr_reader :lines
307
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
308
+ attr_reader :livemode
309
+ # 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.
310
+ attr_reader :metadata
311
+ # The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`.
312
+ attr_reader :next_payment_attempt
313
+ # 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.
314
+ attr_reader :number
315
+ # String representing the object's type. Objects of the same type share the same value.
316
+ attr_reader :object
317
+ # 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.
318
+ attr_reader :on_behalf_of
319
+ # 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.
320
+ attr_reader :paid
321
+ # Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.
322
+ attr_reader :paid_out_of_band
323
+ # 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.
324
+ attr_reader :payment_intent
325
+ # Attribute for field payment_settings
326
+ attr_reader :payment_settings
327
+ # Payments for this invoice
328
+ attr_reader :payments
329
+ # 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.
330
+ attr_reader :period_end
331
+ # 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.
332
+ attr_reader :period_start
333
+ # Total amount of all post-payment credit notes issued for this invoice.
334
+ attr_reader :post_payment_credit_notes_amount
335
+ # Total amount of all pre-payment credit notes issued for this invoice.
336
+ attr_reader :pre_payment_credit_notes_amount
337
+ # The quote this invoice was generated from.
338
+ attr_reader :quote
339
+ # This is the transaction number that appears on email receipts sent for this invoice.
340
+ attr_reader :receipt_number
341
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
342
+ attr_reader :rendering
343
+ # The details of the cost of shipping, including the ShippingRate applied on the invoice.
344
+ attr_reader :shipping_cost
345
+ # 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.
346
+ attr_reader :shipping_details
347
+ # 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.
348
+ attr_reader :starting_balance
349
+ # Extra information about an invoice for the customer's credit card statement.
350
+ attr_reader :statement_descriptor
351
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
352
+ attr_reader :status
353
+ # Attribute for field status_transitions
354
+ attr_reader :status_transitions
355
+ # The subscription that this invoice was prepared for, if any.
356
+ attr_reader :subscription
357
+ # Details about the subscription that created this invoice.
358
+ attr_reader :subscription_details
359
+ # Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
360
+ attr_reader :subscription_proration_date
361
+ # 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
362
+ attr_reader :subtotal
363
+ # 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
364
+ attr_reader :subtotal_excluding_tax
365
+ # The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
366
+ attr_reader :tax
367
+ # ID of the test clock this invoice belongs to.
368
+ attr_reader :test_clock
369
+ # Attribute for field threshold_reason
370
+ attr_reader :threshold_reason
371
+ # Total after discounts and taxes.
372
+ attr_reader :total
373
+ # The aggregate amounts calculated per discount across all line items.
374
+ attr_reader :total_discount_amounts
375
+ # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
376
+ attr_reader :total_excluding_tax
377
+ # The aggregate amounts calculated per margin across all line items.
378
+ attr_reader :total_margin_amounts
379
+ # 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.
380
+ attr_reader :total_pretax_credit_amounts
381
+ # The aggregate amounts calculated per tax rate for all line items.
382
+ attr_reader :total_tax_amounts
383
+ # 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.
384
+ attr_reader :transfer_data
385
+ # 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.
386
+ attr_reader :webhooks_delivered_at
387
+ # Always true for a deleted object
388
+ attr_reader :deleted
389
+
53
390
  # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
54
391
  def add_lines(params = {}, opts = {})
55
392
  request_stripe_object(
@@ -24,6 +24,60 @@ module Stripe
24
24
  "invoiceitem"
25
25
  end
26
26
 
27
+ class Period < Stripe::StripeObject
28
+ attr_reader :end, :start
29
+ end
30
+ # Amount (in the `currency` specified) of the invoice item. This should always be equal to `unit_amount * quantity`.
31
+ attr_reader :amount
32
+ # 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).
33
+ attr_reader :currency
34
+ # The ID of the customer who will be billed when this invoice item is billed.
35
+ attr_reader :customer
36
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
37
+ attr_reader :date
38
+ # An arbitrary string attached to the object. Often useful for displaying to users.
39
+ attr_reader :description
40
+ # If true, discounts will apply to this invoice item. Always false for prorations.
41
+ attr_reader :discountable
42
+ # The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
43
+ attr_reader :discounts
44
+ # Unique identifier for the object.
45
+ attr_reader :id
46
+ # The ID of the invoice this invoice item belongs to.
47
+ attr_reader :invoice
48
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
49
+ attr_reader :livemode
50
+ # The margins which apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item.
51
+ attr_reader :margins
52
+ # 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.
53
+ attr_reader :metadata
54
+ # String representing the object's type. Objects of the same type share the same value.
55
+ attr_reader :object
56
+ # Attribute for field period
57
+ attr_reader :period
58
+ # If the invoice item is a proration, the plan of the subscription that the proration was computed for.
59
+ attr_reader :plan
60
+ # The price of the invoice item.
61
+ attr_reader :price
62
+ # Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.
63
+ attr_reader :proration
64
+ # Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for.
65
+ attr_reader :quantity
66
+ # The subscription that this invoice item has been created for, if any.
67
+ attr_reader :subscription
68
+ # The subscription item that this invoice item has been created for, if any.
69
+ attr_reader :subscription_item
70
+ # The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item.
71
+ attr_reader :tax_rates
72
+ # ID of the test clock this invoice item belongs to.
73
+ attr_reader :test_clock
74
+ # Unit amount (in the `currency` specified) of the invoice item.
75
+ attr_reader :unit_amount
76
+ # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places.
77
+ attr_reader :unit_amount_decimal
78
+ # Always true for a deleted object
79
+ attr_reader :deleted
80
+
27
81
  # Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.
28
82
  def self.create(params = {}, opts = {})
29
83
  request_stripe_object(method: :post, path: "/v1/invoiceitems", params: params, opts: opts)
@@ -13,6 +13,89 @@ module Stripe
13
13
  "line_item"
14
14
  end
15
15
 
16
+ class DiscountAmount < Stripe::StripeObject
17
+ attr_reader :amount, :discount
18
+ end
19
+
20
+ class MarginAmount < Stripe::StripeObject
21
+ attr_reader :amount, :margin
22
+ end
23
+
24
+ class Period < Stripe::StripeObject
25
+ attr_reader :end, :start
26
+ end
27
+
28
+ class PretaxCreditAmount < Stripe::StripeObject
29
+ attr_reader :amount, :credit_balance_transaction, :discount, :margin, :type
30
+ end
31
+
32
+ class ProrationDetails < Stripe::StripeObject
33
+ class CreditedItems < Stripe::StripeObject
34
+ attr_reader :invoice, :invoice_line_items
35
+ end
36
+ attr_reader :credited_items
37
+ end
38
+
39
+ class TaxAmount < Stripe::StripeObject
40
+ attr_reader :amount, :inclusive, :tax_rate, :taxability_reason, :taxable_amount
41
+ end
42
+ # The amount, in cents (or local equivalent).
43
+ attr_reader :amount
44
+ # The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts.
45
+ attr_reader :amount_excluding_tax
46
+ # 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).
47
+ attr_reader :currency
48
+ # An arbitrary string attached to the object. Often useful for displaying to users.
49
+ attr_reader :description
50
+ # The amount of discount calculated per discount for this line item.
51
+ attr_reader :discount_amounts
52
+ # If true, discounts will apply to this line item. Always false for prorations.
53
+ attr_reader :discountable
54
+ # The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
55
+ attr_reader :discounts
56
+ # Unique identifier for the object.
57
+ attr_reader :id
58
+ # The ID of the invoice that contains this line item.
59
+ attr_reader :invoice
60
+ # The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any.
61
+ attr_reader :invoice_item
62
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
63
+ attr_reader :livemode
64
+ # The amount of margin calculated per margin for this line item.
65
+ attr_reader :margin_amounts
66
+ # The margins applied to the line item. When set, the `default_margins` on the invoice do not apply to the line item. Use `expand[]=margins` to expand each margin.
67
+ attr_reader :margins
68
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
69
+ attr_reader :metadata
70
+ # String representing the object's type. Objects of the same type share the same value.
71
+ attr_reader :object
72
+ # Attribute for field period
73
+ attr_reader :period
74
+ # The plan of the subscription, if the line item is a subscription or a proration.
75
+ attr_reader :plan
76
+ # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
77
+ attr_reader :pretax_credit_amounts
78
+ # The price of the line item.
79
+ attr_reader :price
80
+ # Whether this is a proration.
81
+ attr_reader :proration
82
+ # Additional details for proration line items
83
+ attr_reader :proration_details
84
+ # The quantity of the subscription, if the line item is a subscription or a proration.
85
+ attr_reader :quantity
86
+ # The subscription that the invoice item pertains to, if any.
87
+ attr_reader :subscription
88
+ # The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription.
89
+ attr_reader :subscription_item
90
+ # The amount of tax calculated per tax rate for this line item
91
+ attr_reader :tax_amounts
92
+ # The tax rates which apply to the line item.
93
+ attr_reader :tax_rates
94
+ # A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`.
95
+ attr_reader :type
96
+ # The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts.
97
+ attr_reader :unit_amount_excluding_tax
98
+
16
99
  # Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item,
17
100
  # so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice
18
101
  # item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well.
@@ -8,5 +8,39 @@ module Stripe
8
8
  def self.object_name
9
9
  "invoice_payment"
10
10
  end
11
+
12
+ class Payment < Stripe::StripeObject
13
+ attr_reader :charge, :payment_intent, :payment_record, :type
14
+ end
15
+
16
+ class StatusTransitions < Stripe::StripeObject
17
+ attr_reader :canceled_at, :paid_at
18
+ end
19
+ # Excess payment that was received for this invoice and credited to the customer’s `invoice_credit_balance`. This field is null until the payment is `paid`. Overpayment can happen when you attach more than one PaymentIntent to the invoice, and each of them succeeds. To avoid overpayment, cancel any PaymentIntents that you do not need before attaching more.
20
+ attr_reader :amount_overpaid
21
+ # Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is `paid`. This amount can be less than the `amount_requested` if the PaymentIntent’s `amount_received` is not sufficient to pay all of the invoices that it is attached to.
22
+ attr_reader :amount_paid
23
+ # Amount intended to be paid toward this invoice, in cents (or local equivalent)
24
+ attr_reader :amount_requested
25
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
26
+ attr_reader :created
27
+ # 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).
28
+ attr_reader :currency
29
+ # Unique identifier for the object.
30
+ attr_reader :id
31
+ # The invoice that was paid.
32
+ attr_reader :invoice
33
+ # Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice’s `amount_remaining`. The PaymentIntent associated with the default payment can’t be edited or canceled directly.
34
+ attr_reader :is_default
35
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
36
+ attr_reader :livemode
37
+ # String representing the object's type. Objects of the same type share the same value.
38
+ attr_reader :object
39
+ # Attribute for field payment
40
+ attr_reader :payment
41
+ # The status of the payment, one of `open`, `paid`, or `canceled`.
42
+ attr_reader :status
43
+ # Attribute for field status_transitions
44
+ attr_reader :status_transitions
11
45
  end
12
46
  end
@@ -12,6 +12,23 @@ module Stripe
12
12
  "invoice_rendering_template"
13
13
  end
14
14
 
15
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
16
+ attr_reader :created
17
+ # Unique identifier for the object.
18
+ attr_reader :id
19
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
20
+ attr_reader :livemode
21
+ # 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.
22
+ attr_reader :metadata
23
+ # A brief description of the template, hidden from customers
24
+ attr_reader :nickname
25
+ # String representing the object's type. Objects of the same type share the same value.
26
+ attr_reader :object
27
+ # The status of the template, one of `active` or `archived`.
28
+ attr_reader :status
29
+ # Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering
30
+ attr_reader :version
31
+
15
32
  # Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it.
16
33
  def archive(params = {}, opts = {})
17
34
  request_stripe_object(