stripe 13.2.0 → 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 (225) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1396 -645
  3. data/OPENAPI_VERSION +1 -1
  4. data/VERSION +1 -1
  5. data/lib/stripe/object_types.rb +32 -0
  6. data/lib/stripe/request_signing_authenticator.rb +79 -0
  7. data/lib/stripe/resources/account.rb +230 -0
  8. data/lib/stripe/resources/account_link.rb +9 -0
  9. data/lib/stripe/resources/account_notice.rb +60 -0
  10. data/lib/stripe/resources/account_session.rb +103 -0
  11. data/lib/stripe/resources/apple_pay_domain.rb +13 -0
  12. data/lib/stripe/resources/application.rb +20 -0
  13. data/lib/stripe/resources/application_fee.rb +34 -0
  14. data/lib/stripe/resources/application_fee_refund.rb +17 -0
  15. data/lib/stripe/resources/apps/secret.rb +22 -0
  16. data/lib/stripe/resources/balance.rb +59 -0
  17. data/lib/stripe/resources/balance_transaction.rb +34 -0
  18. data/lib/stripe/resources/bank_account.rb +60 -2
  19. data/lib/stripe/resources/billing/alert.rb +21 -0
  20. data/lib/stripe/resources/billing/alert_triggered.rb +26 -0
  21. data/lib/stripe/resources/billing/credit_balance_summary.rb +25 -0
  22. data/lib/stripe/resources/billing/credit_balance_transaction.rb +45 -1
  23. data/lib/stripe/resources/billing/credit_grant.rb +46 -2
  24. data/lib/stripe/resources/billing/meter.rb +49 -7
  25. data/lib/stripe/resources/billing/meter_error_report.rb +44 -0
  26. data/lib/stripe/resources/billing/meter_event.rb +17 -3
  27. data/lib/stripe/resources/billing/meter_event_adjustment.rb +17 -1
  28. data/lib/stripe/resources/billing/meter_event_summary.rb +15 -0
  29. data/lib/stripe/resources/billing_portal/configuration.rb +70 -0
  30. data/lib/stripe/resources/billing_portal/session.rb +61 -0
  31. data/lib/stripe/resources/capability.rb +38 -0
  32. data/lib/stripe/resources/capital/financing_offer.rb +94 -0
  33. data/lib/stripe/resources/capital/financing_summary.rb +32 -0
  34. data/lib/stripe/resources/capital/financing_transaction.rb +56 -0
  35. data/lib/stripe/resources/card.rb +72 -0
  36. data/lib/stripe/resources/cash_balance.rb +14 -0
  37. data/lib/stripe/resources/charge.rb +469 -0
  38. data/lib/stripe/resources/checkout/session.rb +496 -0
  39. data/lib/stripe/resources/climate/order.rb +55 -0
  40. data/lib/stripe/resources/climate/product.rb +24 -0
  41. data/lib/stripe/resources/climate/supplier.rb +18 -0
  42. data/lib/stripe/resources/confirmation_token.rb +297 -0
  43. data/lib/stripe/resources/connect_collection_transfer.rb +24 -0
  44. data/lib/stripe/resources/country_spec.rb +27 -0
  45. data/lib/stripe/resources/coupon.rb +44 -0
  46. data/lib/stripe/resources/credit_note.rb +91 -0
  47. data/lib/stripe/resources/credit_note_line_item.rb +46 -0
  48. data/lib/stripe/resources/customer.rb +93 -0
  49. data/lib/stripe/resources/customer_balance_transaction.rb +27 -0
  50. data/lib/stripe/resources/customer_cash_balance_transaction.rb +72 -0
  51. data/lib/stripe/resources/customer_session.rb +34 -0
  52. data/lib/stripe/resources/discount.rb +29 -0
  53. data/lib/stripe/resources/dispute.rb +88 -0
  54. data/lib/stripe/resources/entitlements/active_entitlement.rb +11 -0
  55. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +23 -0
  56. data/lib/stripe/resources/entitlements/feature.rb +15 -0
  57. data/lib/stripe/resources/ephemeral_key.rb +13 -0
  58. data/lib/stripe/resources/event.rb +44 -0
  59. data/lib/stripe/resources/exchange_rate.rb +7 -0
  60. data/lib/stripe/resources/file.rb +23 -0
  61. data/lib/stripe/resources/file_link.rb +19 -0
  62. data/lib/stripe/resources/financial_connections/account.rb +87 -0
  63. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  64. data/lib/stripe/resources/financial_connections/account_owner.rb +17 -0
  65. data/lib/stripe/resources/financial_connections/account_ownership.rb +9 -0
  66. data/lib/stripe/resources/financial_connections/institution.rb +61 -0
  67. data/lib/stripe/resources/financial_connections/session.rb +49 -0
  68. data/lib/stripe/resources/financial_connections/transaction.rb +28 -0
  69. data/lib/stripe/resources/forwarding/request.rb +40 -0
  70. data/lib/stripe/resources/funding_instructions.rb +82 -0
  71. data/lib/stripe/resources/gift_cards/card.rb +96 -0
  72. data/lib/stripe/resources/gift_cards/transaction.rb +132 -0
  73. data/lib/stripe/resources/identity/verification_report.rb +92 -0
  74. data/lib/stripe/resources/identity/verification_session.rb +76 -0
  75. data/lib/stripe/resources/invoice.rb +418 -0
  76. data/lib/stripe/resources/invoice_item.rb +54 -0
  77. data/lib/stripe/resources/invoice_line_item.rb +83 -0
  78. data/lib/stripe/resources/invoice_payment.rb +46 -0
  79. data/lib/stripe/resources/invoice_rendering_template.rb +17 -0
  80. data/lib/stripe/resources/issuing/authorization.rb +129 -0
  81. data/lib/stripe/resources/issuing/card.rb +86 -0
  82. data/lib/stripe/resources/issuing/cardholder.rb +76 -0
  83. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +145 -0
  84. data/lib/stripe/resources/issuing/dispute.rb +65 -0
  85. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +49 -0
  86. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +43 -0
  87. data/lib/stripe/resources/issuing/personalization_design.rb +38 -0
  88. data/lib/stripe/resources/issuing/physical_bundle.rb +18 -0
  89. data/lib/stripe/resources/issuing/settlement.rb +49 -0
  90. data/lib/stripe/resources/issuing/token.rb +46 -0
  91. data/lib/stripe/resources/issuing/transaction.rb +106 -0
  92. data/lib/stripe/resources/line_item.rb +50 -0
  93. data/lib/stripe/resources/login_link.rb +7 -0
  94. data/lib/stripe/resources/mandate.rb +78 -0
  95. data/lib/stripe/resources/margin.rb +56 -0
  96. data/lib/stripe/resources/order.rb +322 -0
  97. data/lib/stripe/resources/payment_attempt_record.rb +100 -0
  98. data/lib/stripe/resources/payment_intent.rb +712 -0
  99. data/lib/stripe/resources/payment_link.rb +198 -0
  100. data/lib/stripe/resources/payment_method.rb +368 -0
  101. data/lib/stripe/resources/payment_method_configuration.rb +430 -0
  102. data/lib/stripe/resources/payment_method_domain.rb +57 -0
  103. data/lib/stripe/resources/payment_record.rb +194 -0
  104. data/lib/stripe/resources/payout.rb +56 -0
  105. data/lib/stripe/resources/person.rb +128 -0
  106. data/lib/stripe/resources/plan.rb +52 -0
  107. data/lib/stripe/resources/price.rb +77 -0
  108. data/lib/stripe/resources/product.rb +60 -0
  109. data/lib/stripe/resources/product_feature.rb +12 -0
  110. data/lib/stripe/resources/promotion_code.rb +35 -0
  111. data/lib/stripe/resources/quote.rb +356 -0
  112. data/lib/stripe/resources/quote_line.rb +136 -0
  113. data/lib/stripe/resources/quote_preview_invoice.rb +374 -0
  114. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +170 -0
  115. data/lib/stripe/resources/radar/early_fraud_warning.rb +17 -0
  116. data/lib/stripe/resources/radar/value_list.rb +23 -0
  117. data/lib/stripe/resources/radar/value_list_item.rb +17 -0
  118. data/lib/stripe/resources/refund.rb +130 -0
  119. data/lib/stripe/resources/reporting/report_run.rb +29 -0
  120. data/lib/stripe/resources/reporting/report_type.rb +19 -0
  121. data/lib/stripe/resources/reserve_transaction.rb +22 -0
  122. data/lib/stripe/resources/reversal.rb +21 -0
  123. data/lib/stripe/resources/review.rb +36 -0
  124. data/lib/stripe/resources/setup_attempt.rb +101 -0
  125. data/lib/stripe/resources/setup_intent.rb +158 -0
  126. data/lib/stripe/resources/shipping_rate.rb +42 -0
  127. data/lib/stripe/resources/sigma/scheduled_query_run.rb +26 -0
  128. data/lib/stripe/resources/source.rb +195 -0
  129. data/lib/stripe/resources/source_mandate_notification.rb +59 -0
  130. data/lib/stripe/resources/source_transaction.rb +48 -0
  131. data/lib/stripe/resources/subscription.rb +214 -0
  132. data/lib/stripe/resources/subscription_item.rb +46 -0
  133. data/lib/stripe/resources/subscription_schedule.rb +173 -0
  134. data/lib/stripe/resources/tax/association.rb +60 -0
  135. data/lib/stripe/resources/tax/calculation.rb +72 -0
  136. data/lib/stripe/resources/tax/calculation_line_item.rb +33 -0
  137. data/lib/stripe/resources/tax/form.rb +124 -0
  138. data/lib/stripe/resources/tax/registration.rb +379 -0
  139. data/lib/stripe/resources/tax/settings.rb +33 -0
  140. data/lib/stripe/resources/tax/transaction.rb +68 -0
  141. data/lib/stripe/resources/tax/transaction_line_item.rb +30 -0
  142. data/lib/stripe/resources/tax_code.rb +9 -0
  143. data/lib/stripe/resources/tax_deducted_at_source.rb +22 -0
  144. data/lib/stripe/resources/tax_id.rb +30 -0
  145. data/lib/stripe/resources/tax_rate.rb +42 -0
  146. data/lib/stripe/resources/terminal/configuration.rb +107 -0
  147. data/lib/stripe/resources/terminal/connection_token.rb +7 -0
  148. data/lib/stripe/resources/terminal/location.rb +20 -0
  149. data/lib/stripe/resources/terminal/reader.rb +178 -0
  150. data/lib/stripe/resources/terminal/reader_collected_data.rb +30 -0
  151. data/lib/stripe/resources/test_helpers/test_clock.rb +27 -0
  152. data/lib/stripe/resources/token.rb +29 -0
  153. data/lib/stripe/resources/topup.rb +33 -0
  154. data/lib/stripe/resources/transfer.rb +35 -0
  155. data/lib/stripe/resources/treasury/credit_reversal.rb +32 -0
  156. data/lib/stripe/resources/treasury/debit_reversal.rb +38 -0
  157. data/lib/stripe/resources/treasury/financial_account.rb +57 -0
  158. data/lib/stripe/resources/treasury/financial_account_features.rb +91 -0
  159. data/lib/stripe/resources/treasury/inbound_transfer.rb +66 -0
  160. data/lib/stripe/resources/treasury/outbound_payment.rb +85 -0
  161. data/lib/stripe/resources/treasury/outbound_transfer.rb +82 -0
  162. data/lib/stripe/resources/treasury/received_credit.rb +70 -0
  163. data/lib/stripe/resources/treasury/received_debit.rb +67 -0
  164. data/lib/stripe/resources/treasury/transaction.rb +42 -0
  165. data/lib/stripe/resources/treasury/transaction_entry.rb +34 -0
  166. data/lib/stripe/resources/usage_record.rb +13 -0
  167. data/lib/stripe/resources/usage_record_summary.rb +18 -0
  168. data/lib/stripe/resources/v2/amount.rb +9 -0
  169. data/lib/stripe/resources/v2/billing/meter_event.rb +18 -0
  170. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +20 -0
  171. data/lib/stripe/resources/v2/billing/meter_event_session.rb +14 -0
  172. data/lib/stripe/resources/v2/event.rb +21 -0
  173. data/lib/stripe/resources/v2/event_destination.rb +49 -0
  174. data/lib/stripe/resources/webhook_endpoint.rb +27 -0
  175. data/lib/stripe/resources.rb +31 -0
  176. data/lib/stripe/services/account_notice_service.rb +39 -0
  177. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -1
  178. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +2 -2
  179. data/lib/stripe/services/billing/credit_grant_service.rb +3 -3
  180. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +1 -1
  181. data/lib/stripe/services/billing/meter_event_service.rb +1 -1
  182. data/lib/stripe/services/billing/meter_service.rb +5 -5
  183. data/lib/stripe/services/capital/financing_offer_service.rb +42 -0
  184. data/lib/stripe/services/capital/financing_summary_service.rb +19 -0
  185. data/lib/stripe/services/capital/financing_transaction_service.rb +31 -0
  186. data/lib/stripe/services/capital_service.rb +15 -0
  187. data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +19 -0
  188. data/lib/stripe/services/financial_connections/account_service.rb +3 -1
  189. data/lib/stripe/services/financial_connections/institution_service.rb +30 -0
  190. data/lib/stripe/services/financial_connections_service.rb +2 -1
  191. data/lib/stripe/services/gift_cards/card_service.rb +63 -0
  192. data/lib/stripe/services/gift_cards/transaction_service.rb +74 -0
  193. data/lib/stripe/services/gift_cards_service.rb +14 -0
  194. data/lib/stripe/services/invoice_payment_service.rb +28 -0
  195. data/lib/stripe/services/invoice_service.rb +44 -1
  196. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +74 -0
  197. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +30 -0
  198. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +30 -0
  199. data/lib/stripe/services/issuing_service.rb +5 -1
  200. data/lib/stripe/services/margin_service.rb +50 -0
  201. data/lib/stripe/services/order_line_item_service.rb +17 -0
  202. data/lib/stripe/services/order_service.rb +78 -0
  203. data/lib/stripe/services/payment_attempt_record_service.rb +28 -0
  204. data/lib/stripe/services/payment_intent_service.rb +37 -0
  205. data/lib/stripe/services/payment_record_service.rb +78 -0
  206. data/lib/stripe/services/quote_line_service.rb +17 -0
  207. data/lib/stripe/services/quote_preview_invoice_service.rb +17 -0
  208. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +17 -0
  209. data/lib/stripe/services/quote_service.rb +49 -1
  210. data/lib/stripe/services/subscription_schedule_service.rb +11 -0
  211. data/lib/stripe/services/tax/association_service.rb +19 -0
  212. data/lib/stripe/services/tax/form_service.rb +37 -0
  213. data/lib/stripe/services/tax_service.rb +3 -1
  214. data/lib/stripe/services/terminal/reader_collected_data_service.rb +19 -0
  215. data/lib/stripe/services/terminal/reader_service.rb +33 -0
  216. data/lib/stripe/services/terminal_service.rb +2 -1
  217. data/lib/stripe/services/v1_services.rb +8 -1
  218. data/lib/stripe/services.rb +25 -0
  219. data/lib/stripe/stripe_configuration.rb +3 -1
  220. data/lib/stripe/stripe_object.rb +5 -0
  221. data/lib/stripe/util.rb +7 -1
  222. data/lib/stripe/version.rb +1 -1
  223. data/lib/stripe.rb +45 -0
  224. data/stripe.gemspec +2 -1
  225. metadata +62 -4
@@ -7,6 +7,7 @@ module Stripe
7
7
  class Quote < APIResource
8
8
  extend Stripe::APIOperations::Create
9
9
  extend Stripe::APIOperations::List
10
+ extend Stripe::APIOperations::NestedResource
10
11
  include Stripe::APIOperations::Save
11
12
 
12
13
  OBJECT_NAME = "quote"
@@ -14,6 +15,261 @@ module Stripe
14
15
  "quote"
15
16
  end
16
17
 
18
+ nested_resource_class_methods :preview_invoice, operations: %i[list]
19
+ nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
20
+
21
+ class AutomaticTax < Stripe::StripeObject
22
+ class Liability < Stripe::StripeObject
23
+ attr_reader :account, :type
24
+ end
25
+ attr_reader :enabled, :liability, :status
26
+ end
27
+
28
+ class Computed < Stripe::StripeObject
29
+ class LastReestimationDetails < Stripe::StripeObject
30
+ class Failed < Stripe::StripeObject
31
+ attr_reader :failure_code, :message, :reason
32
+ end
33
+ attr_reader :failed, :status
34
+ end
35
+
36
+ class Recurring < Stripe::StripeObject
37
+ class TotalDetails < Stripe::StripeObject
38
+ class Breakdown < Stripe::StripeObject
39
+ class Discount < Stripe::StripeObject
40
+ attr_reader :amount, :discount
41
+ end
42
+
43
+ class Tax < Stripe::StripeObject
44
+ attr_reader :amount, :rate, :taxability_reason, :taxable_amount
45
+ end
46
+ attr_reader :discounts, :taxes
47
+ end
48
+ attr_reader :amount_discount, :amount_shipping, :amount_tax, :breakdown
49
+ end
50
+ attr_reader :amount_subtotal, :amount_total, :interval, :interval_count, :total_details
51
+ end
52
+
53
+ class Upfront < Stripe::StripeObject
54
+ class TotalDetails < Stripe::StripeObject
55
+ class Breakdown < Stripe::StripeObject
56
+ class Discount < Stripe::StripeObject
57
+ attr_reader :amount, :discount
58
+ end
59
+
60
+ class Tax < Stripe::StripeObject
61
+ attr_reader :amount, :rate, :taxability_reason, :taxable_amount
62
+ end
63
+ attr_reader :discounts, :taxes
64
+ end
65
+ attr_reader :amount_discount, :amount_shipping, :amount_tax, :breakdown
66
+ end
67
+ attr_reader :amount_subtotal, :amount_total, :line_items, :total_details
68
+ end
69
+ attr_reader :last_reestimation_details, :recurring, :updated_at, :upfront
70
+ end
71
+
72
+ class FromQuote < Stripe::StripeObject
73
+ attr_reader :is_revision, :quote
74
+ end
75
+
76
+ class InvoiceSettings < Stripe::StripeObject
77
+ class Issuer < Stripe::StripeObject
78
+ attr_reader :account, :type
79
+ end
80
+ attr_reader :days_until_due, :issuer
81
+ end
82
+
83
+ class StatusDetails < Stripe::StripeObject
84
+ class Canceled < Stripe::StripeObject
85
+ attr_reader :reason, :transitioned_at
86
+ end
87
+
88
+ class Stale < Stripe::StripeObject
89
+ class LastReason < Stripe::StripeObject
90
+ class LinesInvalid < Stripe::StripeObject
91
+ attr_reader :invalid_at, :lines
92
+ end
93
+
94
+ class SubscriptionChanged < Stripe::StripeObject
95
+ attr_reader :previous_subscription
96
+ end
97
+
98
+ class SubscriptionScheduleChanged < Stripe::StripeObject
99
+ attr_reader :previous_subscription_schedule
100
+ end
101
+ attr_reader :line_invalid, :lines_invalid, :marked_stale, :subscription_canceled, :subscription_changed, :subscription_expired, :subscription_schedule_canceled, :subscription_schedule_changed, :subscription_schedule_released, :type
102
+ end
103
+ attr_reader :expires_at, :last_reason, :last_updated_at, :transitioned_at
104
+ end
105
+ attr_reader :canceled, :stale
106
+ end
107
+
108
+ class StatusTransitions < Stripe::StripeObject
109
+ attr_reader :accepted_at, :canceled_at, :finalized_at
110
+ end
111
+
112
+ class SubscriptionData < Stripe::StripeObject
113
+ class BillOnAcceptance < Stripe::StripeObject
114
+ class BillFrom < Stripe::StripeObject
115
+ class LineStartsAt < Stripe::StripeObject
116
+ attr_reader :id
117
+ end
118
+ attr_reader :computed, :line_starts_at, :timestamp, :type
119
+ end
120
+
121
+ class BillUntil < Stripe::StripeObject
122
+ class Duration < Stripe::StripeObject
123
+ attr_reader :interval, :interval_count
124
+ end
125
+
126
+ class LineEndsAt < Stripe::StripeObject
127
+ attr_reader :id
128
+ end
129
+ attr_reader :computed, :duration, :line_ends_at, :timestamp, :type
130
+ end
131
+ attr_reader :bill_from, :bill_until
132
+ end
133
+
134
+ class Prebilling < Stripe::StripeObject
135
+ attr_reader :iterations
136
+ end
137
+ attr_reader :bill_on_acceptance, :billing_behavior, :billing_cycle_anchor, :description, :effective_date, :end_behavior, :from_subscription, :metadata, :prebilling, :proration_behavior, :trial_period_days
138
+ end
139
+
140
+ class SubscriptionDataOverride < Stripe::StripeObject
141
+ class AppliesTo < Stripe::StripeObject
142
+ attr_reader :new_reference, :subscription_schedule, :type
143
+ end
144
+
145
+ class BillOnAcceptance < Stripe::StripeObject
146
+ class BillFrom < Stripe::StripeObject
147
+ class LineStartsAt < Stripe::StripeObject
148
+ attr_reader :id
149
+ end
150
+ attr_reader :computed, :line_starts_at, :timestamp, :type
151
+ end
152
+
153
+ class BillUntil < Stripe::StripeObject
154
+ class Duration < Stripe::StripeObject
155
+ attr_reader :interval, :interval_count
156
+ end
157
+
158
+ class LineEndsAt < Stripe::StripeObject
159
+ attr_reader :id
160
+ end
161
+ attr_reader :computed, :duration, :line_ends_at, :timestamp, :type
162
+ end
163
+ attr_reader :bill_from, :bill_until
164
+ end
165
+ attr_reader :applies_to, :bill_on_acceptance, :billing_behavior, :customer, :description, :end_behavior, :proration_behavior
166
+ end
167
+
168
+ class SubscriptionSchedule < Stripe::StripeObject
169
+ class AppliesTo < Stripe::StripeObject
170
+ attr_reader :new_reference, :subscription_schedule, :type
171
+ end
172
+ attr_reader :applies_to, :subscription_schedule
173
+ end
174
+
175
+ class TotalDetails < Stripe::StripeObject
176
+ class Breakdown < Stripe::StripeObject
177
+ class Discount < Stripe::StripeObject
178
+ attr_reader :amount, :discount
179
+ end
180
+
181
+ class Tax < Stripe::StripeObject
182
+ attr_reader :amount, :rate, :taxability_reason, :taxable_amount
183
+ end
184
+ attr_reader :discounts, :taxes
185
+ end
186
+ attr_reader :amount_discount, :amount_shipping, :amount_tax, :breakdown
187
+ end
188
+
189
+ class TransferData < Stripe::StripeObject
190
+ attr_reader :amount, :amount_percent, :destination
191
+ end
192
+ # Allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
193
+ attr_reader :allow_backdated_lines
194
+ # Total before any discounts or taxes are applied.
195
+ attr_reader :amount_subtotal
196
+ # Total after discounts and taxes are applied.
197
+ attr_reader :amount_total
198
+ # ID of the Connect Application that created the quote.
199
+ attr_reader :application
200
+ # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote.
201
+ attr_reader :application_fee_amount
202
+ # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote.
203
+ attr_reader :application_fee_percent
204
+ # Attribute for field automatic_tax
205
+ attr_reader :automatic_tax
206
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
207
+ attr_reader :collection_method
208
+ # Attribute for field computed
209
+ attr_reader :computed
210
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
211
+ attr_reader :created
212
+ # 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).
213
+ attr_reader :currency
214
+ # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
215
+ attr_reader :customer
216
+ # The tax rates applied to this quote.
217
+ attr_reader :default_tax_rates
218
+ # A description that will be displayed on the quote PDF.
219
+ attr_reader :description
220
+ # The discounts applied to this quote.
221
+ attr_reader :discounts
222
+ # The date on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
223
+ attr_reader :expires_at
224
+ # A footer that will be displayed on the quote PDF.
225
+ attr_reader :footer
226
+ # Details of the quote that was cloned. See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details.
227
+ attr_reader :from_quote
228
+ # A header that will be displayed on the quote PDF.
229
+ attr_reader :header
230
+ # Unique identifier for the object.
231
+ attr_reader :id
232
+ # The invoice that was created from this quote.
233
+ attr_reader :invoice
234
+ # Attribute for field invoice_settings
235
+ attr_reader :invoice_settings
236
+ # A list of items the customer is being quoted for.
237
+ attr_reader :line_items
238
+ # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
239
+ attr_reader :lines
240
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
241
+ attr_reader :livemode
242
+ # 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.
243
+ attr_reader :metadata
244
+ # A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize).
245
+ attr_reader :number
246
+ # String representing the object's type. Objects of the same type share the same value.
247
+ attr_reader :object
248
+ # The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details.
249
+ attr_reader :on_behalf_of
250
+ # The status of the quote.
251
+ attr_reader :status
252
+ # Details on when and why a quote has been marked as stale or canceled.
253
+ attr_reader :status_details
254
+ # Attribute for field status_transitions
255
+ attr_reader :status_transitions
256
+ # The subscription that was created or updated from this quote.
257
+ attr_reader :subscription
258
+ # Attribute for field subscription_data
259
+ attr_reader :subscription_data
260
+ # List representing overrides for `subscription_data` configurations for specific subscription schedules.
261
+ attr_reader :subscription_data_overrides
262
+ # The subscription schedule that was created or updated from this quote.
263
+ attr_reader :subscription_schedule
264
+ # The subscription schedules that were created or updated from this quote.
265
+ attr_reader :subscription_schedules
266
+ # ID of the test clock this quote belongs to.
267
+ attr_reader :test_clock
268
+ # Attribute for field total_details
269
+ attr_reader :total_details
270
+ # The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices.
271
+ attr_reader :transfer_data
272
+
17
273
  # Accepts the specified quote.
18
274
  def accept(params = {}, opts = {})
19
275
  request_stripe_object(
@@ -124,6 +380,86 @@ module Stripe
124
380
  )
125
381
  end
126
382
 
383
+ # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
384
+ def list_lines(params = {}, opts = {})
385
+ request_stripe_object(
386
+ method: :get,
387
+ path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
388
+ params: params,
389
+ opts: opts
390
+ )
391
+ end
392
+
393
+ # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
394
+ def self.list_lines(quote, params = {}, opts = {})
395
+ request_stripe_object(
396
+ method: :get,
397
+ path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
398
+ params: params,
399
+ opts: opts
400
+ )
401
+ end
402
+
403
+ # Preview the invoice line items that would be generated by accepting the quote.
404
+ def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
405
+ request_stripe_object(
406
+ method: :get,
407
+ path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
408
+ params: params,
409
+ opts: opts
410
+ )
411
+ end
412
+
413
+ # Preview the invoice line items that would be generated by accepting the quote.
414
+ def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
415
+ request_stripe_object(
416
+ method: :get,
417
+ path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
418
+ params: params,
419
+ opts: opts
420
+ )
421
+ end
422
+
423
+ # Converts a stale quote to draft.
424
+ def mark_draft(params = {}, opts = {})
425
+ request_stripe_object(
426
+ method: :post,
427
+ path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
428
+ params: params,
429
+ opts: opts
430
+ )
431
+ end
432
+
433
+ # Converts a stale quote to draft.
434
+ def self.mark_draft(quote, params = {}, opts = {})
435
+ request_stripe_object(
436
+ method: :post,
437
+ path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
438
+ params: params,
439
+ opts: opts
440
+ )
441
+ end
442
+
443
+ # Converts a draft or open quote to stale.
444
+ def mark_stale(params = {}, opts = {})
445
+ request_stripe_object(
446
+ method: :post,
447
+ path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
448
+ params: params,
449
+ opts: opts
450
+ )
451
+ end
452
+
453
+ # Converts a draft or open quote to stale.
454
+ def self.mark_stale(quote, params = {}, opts = {})
455
+ request_stripe_object(
456
+ method: :post,
457
+ path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
458
+ params: params,
459
+ opts: opts
460
+ )
461
+ end
462
+
127
463
  # Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
128
464
  def pdf(params = {}, opts = {}, &read_body_chunk_block)
129
465
  opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
@@ -150,6 +486,26 @@ module Stripe
150
486
  )
151
487
  end
152
488
 
489
+ # Recompute the upcoming invoice estimate for the quote.
490
+ def reestimate(params = {}, opts = {})
491
+ request_stripe_object(
492
+ method: :post,
493
+ path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
494
+ params: params,
495
+ opts: opts
496
+ )
497
+ end
498
+
499
+ # Recompute the upcoming invoice estimate for the quote.
500
+ def self.reestimate(quote, params = {}, opts = {})
501
+ request_stripe_object(
502
+ method: :post,
503
+ path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
504
+ params: params,
505
+ opts: opts
506
+ )
507
+ end
508
+
153
509
  # A quote models prices and services for a customer.
154
510
  def self.update(id, params = {}, opts = {})
155
511
  request_stripe_object(
@@ -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