stripe 10.10.0.pre.beta.1 → 10.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -281
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +18 -11
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_operations/request.rb +1 -2
  7. data/lib/stripe/api_version.rb +0 -1
  8. data/lib/stripe/object_types.rb +0 -23
  9. data/lib/stripe/resources/customer.rb +0 -11
  10. data/lib/stripe/resources/financial_connections/account.rb +0 -3
  11. data/lib/stripe/resources/invoice.rb +0 -53
  12. data/lib/stripe/resources/invoice_line_item.rb +15 -0
  13. data/lib/stripe/resources/payment_intent.rb +0 -50
  14. data/lib/stripe/resources/quote.rb +0 -104
  15. data/lib/stripe/resources/subscription_schedule.rb +0 -20
  16. data/lib/stripe/resources/tax_id.rb +14 -16
  17. data/lib/stripe/resources/terminal/reader.rb +0 -60
  18. data/lib/stripe/resources.rb +0 -22
  19. data/lib/stripe/stripe_client.rb +28 -62
  20. data/lib/stripe/stripe_configuration.rb +1 -2
  21. data/lib/stripe/util.rb +1 -8
  22. data/lib/stripe/version.rb +1 -1
  23. data/lib/stripe.rb +0 -46
  24. metadata +4 -27
  25. data/lib/stripe/request_signing_authenticator.rb +0 -79
  26. data/lib/stripe/resources/account_notice.rb +0 -32
  27. data/lib/stripe/resources/capital/financing_offer.rb +0 -49
  28. data/lib/stripe/resources/capital/financing_summary.rb +0 -15
  29. data/lib/stripe/resources/capital/financing_transaction.rb +0 -27
  30. data/lib/stripe/resources/confirmation_token.rb +0 -16
  31. data/lib/stripe/resources/customer_entitlement.rb +0 -12
  32. data/lib/stripe/resources/customer_entitlement_summary.rb +0 -12
  33. data/lib/stripe/resources/entitlements/event.rb +0 -26
  34. data/lib/stripe/resources/entitlements/feature.rb +0 -38
  35. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -14
  36. data/lib/stripe/resources/gift_cards/card.rb +0 -59
  37. data/lib/stripe/resources/gift_cards/transaction.rb +0 -93
  38. data/lib/stripe/resources/invoice_payment.rb +0 -12
  39. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -88
  40. data/lib/stripe/resources/issuing/personalization_design.rb +0 -119
  41. data/lib/stripe/resources/issuing/physical_bundle.rb +0 -26
  42. data/lib/stripe/resources/margin.rb +0 -37
  43. data/lib/stripe/resources/order.rb +0 -120
  44. data/lib/stripe/resources/quote_phase.rb +0 -39
  45. data/lib/stripe/resources/quote_preview_invoice.rb +0 -43
  46. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -11
  47. data/lib/stripe/resources/tax/form.rb +0 -49
@@ -16,7 +16,6 @@ module Stripe
16
16
  File.object_name_alt => File,
17
17
  Account.object_name => Account,
18
18
  AccountLink.object_name => AccountLink,
19
- AccountNotice.object_name => AccountNotice,
20
19
  AccountSession.object_name => AccountSession,
21
20
  ApplePayDomain.object_name => ApplePayDomain,
22
21
  ApplicationFee.object_name => ApplicationFee,
@@ -28,9 +27,6 @@ module Stripe
28
27
  BillingPortal::Configuration.object_name => BillingPortal::Configuration,
29
28
  BillingPortal::Session.object_name => BillingPortal::Session,
30
29
  Capability.object_name => Capability,
31
- Capital::FinancingOffer.object_name => Capital::FinancingOffer,
32
- Capital::FinancingSummary.object_name => Capital::FinancingSummary,
33
- Capital::FinancingTransaction.object_name => Capital::FinancingTransaction,
34
30
  Card.object_name => Card,
35
31
  CashBalance.object_name => CashBalance,
36
32
  Charge.object_name => Charge,
@@ -38,7 +34,6 @@ module Stripe
38
34
  Climate::Order.object_name => Climate::Order,
39
35
  Climate::Product.object_name => Climate::Product,
40
36
  Climate::Supplier.object_name => Climate::Supplier,
41
- ConfirmationToken.object_name => ConfirmationToken,
42
37
  CountrySpec.object_name => CountrySpec,
43
38
  Coupon.object_name => Coupon,
44
39
  CreditNote.object_name => CreditNote,
@@ -46,49 +41,35 @@ module Stripe
46
41
  Customer.object_name => Customer,
47
42
  CustomerBalanceTransaction.object_name => CustomerBalanceTransaction,
48
43
  CustomerCashBalanceTransaction.object_name => CustomerCashBalanceTransaction,
49
- CustomerEntitlement.object_name => CustomerEntitlement,
50
- CustomerEntitlementSummary.object_name => CustomerEntitlementSummary,
51
44
  CustomerSession.object_name => CustomerSession,
52
45
  Discount.object_name => Discount,
53
46
  Dispute.object_name => Dispute,
54
- Entitlements::Event.object_name => Entitlements::Event,
55
- Entitlements::Feature.object_name => Entitlements::Feature,
56
47
  EphemeralKey.object_name => EphemeralKey,
57
48
  Event.object_name => Event,
58
49
  ExchangeRate.object_name => ExchangeRate,
59
50
  File.object_name => File,
60
51
  FileLink.object_name => FileLink,
61
52
  FinancialConnections::Account.object_name => FinancialConnections::Account,
62
- FinancialConnections::AccountInferredBalance.object_name =>
63
- FinancialConnections::AccountInferredBalance,
64
53
  FinancialConnections::AccountOwner.object_name => FinancialConnections::AccountOwner,
65
54
  FinancialConnections::AccountOwnership.object_name =>
66
55
  FinancialConnections::AccountOwnership,
67
56
  FinancialConnections::Session.object_name => FinancialConnections::Session,
68
57
  FinancialConnections::Transaction.object_name => FinancialConnections::Transaction,
69
58
  FundingInstructions.object_name => FundingInstructions,
70
- GiftCards::Card.object_name => GiftCards::Card,
71
- GiftCards::Transaction.object_name => GiftCards::Transaction,
72
59
  Identity::VerificationReport.object_name => Identity::VerificationReport,
73
60
  Identity::VerificationSession.object_name => Identity::VerificationSession,
74
61
  Invoice.object_name => Invoice,
75
62
  InvoiceItem.object_name => InvoiceItem,
76
63
  InvoiceLineItem.object_name => InvoiceLineItem,
77
- InvoicePayment.object_name => InvoicePayment,
78
64
  Issuing::Authorization.object_name => Issuing::Authorization,
79
65
  Issuing::Card.object_name => Issuing::Card,
80
66
  Issuing::Cardholder.object_name => Issuing::Cardholder,
81
- Issuing::CreditUnderwritingRecord.object_name => Issuing::CreditUnderwritingRecord,
82
67
  Issuing::Dispute.object_name => Issuing::Dispute,
83
- Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
84
- Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
85
68
  Issuing::Token.object_name => Issuing::Token,
86
69
  Issuing::Transaction.object_name => Issuing::Transaction,
87
70
  LineItem.object_name => LineItem,
88
71
  LoginLink.object_name => LoginLink,
89
72
  Mandate.object_name => Mandate,
90
- Margin.object_name => Margin,
91
- Order.object_name => Order,
92
73
  PaymentIntent.object_name => PaymentIntent,
93
74
  PaymentLink.object_name => PaymentLink,
94
75
  PaymentMethod.object_name => PaymentMethod,
@@ -101,9 +82,6 @@ module Stripe
101
82
  Product.object_name => Product,
102
83
  PromotionCode.object_name => PromotionCode,
103
84
  Quote.object_name => Quote,
104
- QuotePhase.object_name => QuotePhase,
105
- QuotePreviewInvoice.object_name => QuotePreviewInvoice,
106
- QuotePreviewSubscriptionSchedule.object_name => QuotePreviewSubscriptionSchedule,
107
85
  Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning,
108
86
  Radar::ValueList.object_name => Radar::ValueList,
109
87
  Radar::ValueListItem.object_name => Radar::ValueListItem,
@@ -123,7 +101,6 @@ module Stripe
123
101
  SubscriptionSchedule.object_name => SubscriptionSchedule,
124
102
  Tax::Calculation.object_name => Tax::Calculation,
125
103
  Tax::CalculationLineItem.object_name => Tax::CalculationLineItem,
126
- Tax::Form.object_name => Tax::Form,
127
104
  Tax::Registration.object_name => Tax::Registration,
128
105
  Tax::Settings.object_name => Tax::Settings,
129
106
  Tax::Transaction.object_name => Tax::Transaction,
@@ -22,7 +22,6 @@ module Stripe
22
22
  nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list]
23
23
  nested_resource_class_methods :source, operations: %i[create retrieve update delete list]
24
24
  nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list]
25
- nested_resource_class_methods :entitlement, operations: %i[list]
26
25
 
27
26
  # Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
28
27
  # funding instructions will be created. If funding instructions have already been created for a given customer, the same
@@ -186,16 +185,6 @@ module Stripe
186
185
  )
187
186
  end
188
187
 
189
- # Retrieve the entitlement summary for a customer
190
- def self.retrieve_entitlement_summary(customer, params = {}, opts = {})
191
- request_stripe_object(
192
- method: :get,
193
- path: format("/v1/customers/%<customer>s/entitlement_summary", { customer: CGI.escape(customer) }),
194
- params: params,
195
- opts: opts
196
- )
197
- end
198
-
199
188
  def test_helpers
200
189
  TestHelpers.new(self)
201
190
  end
@@ -6,15 +6,12 @@ module Stripe
6
6
  # A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
7
7
  class Account < APIResource
8
8
  extend Stripe::APIOperations::List
9
- extend Stripe::APIOperations::NestedResource
10
9
 
11
10
  OBJECT_NAME = "financial_connections.account"
12
11
  def self.object_name
13
12
  "financial_connections.account"
14
13
  end
15
14
 
16
- nested_resource_class_methods :inferred_balance, operations: %i[list]
17
-
18
15
  # Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
19
16
  def disconnect(params = {}, opts = {})
20
17
  request_stripe_object(
@@ -40,33 +40,12 @@ module Stripe
40
40
  extend Stripe::APIOperations::List
41
41
  extend Stripe::APIOperations::Search
42
42
  include Stripe::APIOperations::Save
43
- extend Stripe::APIOperations::NestedResource
44
43
 
45
44
  OBJECT_NAME = "invoice"
46
45
  def self.object_name
47
46
  "invoice"
48
47
  end
49
48
 
50
- nested_resource_class_methods :payment, operations: %i[retrieve list]
51
-
52
- # Attaches a PaymentIntent to the invoice, adding it to the list of payments.
53
- # When the PaymentIntent's status changes to succeeded, the payment is credited
54
- # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
55
- # invoice's status becomes paid.
56
- #
57
- # If the PaymentIntent's status is already succeeded when it is attached, it is
58
- # credited to the invoice immediately.
59
- #
60
- # Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
61
- def attach_payment_intent(params = {}, opts = {})
62
- request_stripe_object(
63
- method: :post,
64
- path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(self["id"]) }),
65
- params: params,
66
- opts: opts
67
- )
68
- end
69
-
70
49
  # Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
71
50
  def finalize_invoice(params = {}, opts = {})
72
51
  request_stripe_object(
@@ -119,38 +98,6 @@ module Stripe
119
98
  )
120
99
  end
121
100
 
122
- # Attaches a PaymentIntent to the invoice, adding it to the list of payments.
123
- # When the PaymentIntent's status changes to succeeded, the payment is credited
124
- # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
125
- # invoice's status becomes paid.
126
- #
127
- # If the PaymentIntent's status is already succeeded when it is attached, it is
128
- # credited to the invoice immediately.
129
- #
130
- # Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
131
- def self.attach_payment_intent(invoice, params = {}, opts = {})
132
- request_stripe_object(
133
- method: :post,
134
- path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
135
- params: params,
136
- opts: opts
137
- )
138
- end
139
-
140
- # At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
141
- #
142
- # Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
143
- #
144
- # You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource.
145
- def self.create_preview(params = {}, opts = {})
146
- request_stripe_object(
147
- method: :post,
148
- path: "/v1/invoices/create_preview",
149
- params: params,
150
- opts: opts
151
- )
152
- end
153
-
154
101
  # Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
155
102
  def self.finalize_invoice(invoice, params = {}, opts = {})
156
103
  request_stripe_object(
@@ -3,9 +3,24 @@
3
3
 
4
4
  module Stripe
5
5
  class InvoiceLineItem < StripeObject
6
+ include Stripe::APIOperations::Save
7
+
6
8
  OBJECT_NAME = "line_item"
7
9
  def self.object_name
8
10
  "line_item"
9
11
  end
12
+
13
+ # Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item,
14
+ # so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice
15
+ # item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well.
16
+ # Updating an invoice's line item is only possible before the invoice is finalized.
17
+ def self.update(id, params = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :post,
20
+ path: format("/v1/invoices/%<invoice>s/lines/%<id>s", { invoice: CGI.escape(invoice), id: CGI.escape(id) }),
21
+ params: params,
22
+ opts: opts
23
+ )
24
+ end
10
25
  end
11
26
  end
@@ -93,31 +93,6 @@ module Stripe
93
93
  )
94
94
  end
95
95
 
96
- # Perform an decremental authorization on an eligible
97
- # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
98
- # PaymentIntent's status must be requires_capture and
99
- # [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization)
100
- # must be available.
101
- #
102
- # Decremental authorizations decrease the authorized amount on your customer's card
103
- # to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount.
104
- #
105
- # After decrement, the PaymentIntent object
106
- # returns with the updated
107
- # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
108
- # The PaymentIntent will now be capturable up to the new authorized amount.
109
- #
110
- # Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines.
111
- # After it's captured, a PaymentIntent can no longer be decremented.
112
- def decrement_authorization(params = {}, opts = {})
113
- request_stripe_object(
114
- method: :post,
115
- path: format("/v1/payment_intents/%<intent>s/decrement_authorization", { intent: CGI.escape(self["id"]) }),
116
- params: params,
117
- opts: opts
118
- )
119
- end
120
-
121
96
  # Perform an incremental authorization on an eligible
122
97
  # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
123
98
  # PaymentIntent's status must be requires_capture and
@@ -230,31 +205,6 @@ module Stripe
230
205
  )
231
206
  end
232
207
 
233
- # Perform an decremental authorization on an eligible
234
- # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
235
- # PaymentIntent's status must be requires_capture and
236
- # [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization)
237
- # must be available.
238
- #
239
- # Decremental authorizations decrease the authorized amount on your customer's card
240
- # to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount.
241
- #
242
- # After decrement, the PaymentIntent object
243
- # returns with the updated
244
- # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
245
- # The PaymentIntent will now be capturable up to the new authorized amount.
246
- #
247
- # Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines.
248
- # After it's captured, a PaymentIntent can no longer be decremented.
249
- def self.decrement_authorization(intent, params = {}, opts = {})
250
- request_stripe_object(
251
- method: :post,
252
- path: format("/v1/payment_intents/%<intent>s/decrement_authorization", { intent: CGI.escape(intent) }),
253
- params: params,
254
- opts: opts
255
- )
256
- end
257
-
258
208
  # Perform an incremental authorization on an eligible
259
209
  # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
260
210
  # PaymentIntent's status must be requires_capture and
@@ -8,16 +8,12 @@ module Stripe
8
8
  extend Stripe::APIOperations::Create
9
9
  extend Stripe::APIOperations::List
10
10
  include Stripe::APIOperations::Save
11
- extend Stripe::APIOperations::NestedResource
12
11
 
13
12
  OBJECT_NAME = "quote"
14
13
  def self.object_name
15
14
  "quote"
16
15
  end
17
16
 
18
- nested_resource_class_methods :preview_invoice, operations: %i[list]
19
- nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
20
-
21
17
  # Accepts the specified quote.
22
18
  def accept(params = {}, opts = {})
23
19
  request_stripe_object(
@@ -68,46 +64,6 @@ module Stripe
68
64
  )
69
65
  end
70
66
 
71
- # 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.
72
- def list_lines(params = {}, opts = {})
73
- request_stripe_object(
74
- method: :get,
75
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
76
- params: params,
77
- opts: opts
78
- )
79
- end
80
-
81
- # Preview the invoice line items that would be generated by accepting the quote.
82
- def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
83
- request_stripe_object(
84
- method: :get,
85
- path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
86
- params: params,
87
- opts: opts
88
- )
89
- end
90
-
91
- # Converts a stale quote to draft.
92
- def mark_draft(params = {}, opts = {})
93
- request_stripe_object(
94
- method: :post,
95
- path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
96
- params: params,
97
- opts: opts
98
- )
99
- end
100
-
101
- # Converts a draft or open quote to stale.
102
- def mark_stale(params = {}, opts = {})
103
- request_stripe_object(
104
- method: :post,
105
- path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
106
- params: params,
107
- opts: opts
108
- )
109
- end
110
-
111
67
  # Download the PDF for a finalized quote
112
68
  def pdf(params = {}, opts = {}, &read_body_chunk_block)
113
69
  config = opts[:client]&.config || Stripe.config
@@ -121,16 +77,6 @@ module Stripe
121
77
  )
122
78
  end
123
79
 
124
- # Recompute the upcoming invoice estimate for the quote.
125
- def reestimate(params = {}, opts = {})
126
- request_stripe_object(
127
- method: :post,
128
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
129
- params: params,
130
- opts: opts
131
- )
132
- end
133
-
134
80
  # Accepts the specified quote.
135
81
  def self.accept(quote, params = {}, opts = {})
136
82
  request_stripe_object(
@@ -181,46 +127,6 @@ module Stripe
181
127
  )
182
128
  end
183
129
 
184
- # 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.
185
- def self.list_lines(quote, params = {}, opts = {})
186
- request_stripe_object(
187
- method: :get,
188
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
189
- params: params,
190
- opts: opts
191
- )
192
- end
193
-
194
- # Preview the invoice line items that would be generated by accepting the quote.
195
- def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
196
- request_stripe_object(
197
- method: :get,
198
- path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
199
- params: params,
200
- opts: opts
201
- )
202
- end
203
-
204
- # Converts a stale quote to draft.
205
- def self.mark_draft(quote, params = {}, opts = {})
206
- request_stripe_object(
207
- method: :post,
208
- path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
209
- params: params,
210
- opts: opts
211
- )
212
- end
213
-
214
- # Converts a draft or open quote to stale.
215
- def self.mark_stale(quote, params = {}, opts = {})
216
- request_stripe_object(
217
- method: :post,
218
- path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
219
- params: params,
220
- opts: opts
221
- )
222
- end
223
-
224
130
  # Download the PDF for a finalized quote
225
131
  def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
226
132
  config = opts[:client]&.config || Stripe.config
@@ -234,16 +140,6 @@ module Stripe
234
140
  )
235
141
  end
236
142
 
237
- # Recompute the upcoming invoice estimate for the quote.
238
- def self.reestimate(quote, params = {}, opts = {})
239
- request_stripe_object(
240
- method: :post,
241
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
242
- params: params,
243
- opts: opts
244
- )
245
- end
246
-
247
143
  # A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote).
248
144
  def self.create(params = {}, opts = {})
249
145
  request_stripe_object(method: :post, path: "/v1/quotes", params: params, opts: opts)
@@ -15,16 +15,6 @@ module Stripe
15
15
  "subscription_schedule"
16
16
  end
17
17
 
18
- # Amends an existing subscription schedule.
19
- def amend(params = {}, opts = {})
20
- request_stripe_object(
21
- method: :post,
22
- path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
23
- params: params,
24
- opts: opts
25
- )
26
- end
27
-
28
18
  # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
29
19
  def cancel(params = {}, opts = {})
30
20
  request_stripe_object(
@@ -45,16 +35,6 @@ module Stripe
45
35
  )
46
36
  end
47
37
 
48
- # Amends an existing subscription schedule.
49
- def self.amend(schedule, params = {}, opts = {})
50
- request_stripe_object(
51
- method: :post,
52
- path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
53
- params: params,
54
- opts: opts
55
- )
56
- end
57
-
58
38
  # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
59
39
  def self.cancel(schedule, params = {}, opts = {})
60
40
  request_stripe_object(
@@ -7,45 +7,43 @@ module Stripe
7
7
  #
8
8
  # Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids)
9
9
  class TaxId < APIResource
10
+ extend Stripe::APIOperations::Create
10
11
  include Stripe::APIOperations::Delete
12
+ extend Stripe::APIOperations::List
11
13
 
12
14
  OBJECT_NAME = "tax_id"
13
15
  def self.object_name
14
16
  "tax_id"
15
17
  end
16
18
 
17
- def resource_url
18
- if !respond_to?(:customer) || customer.nil?
19
- raise NotImplementedError,
20
- "Tax IDs cannot be accessed without a customer ID."
21
- end
22
- "#{Customer.resource_url}/#{CGI.escape(customer)}/tax_ids" \
23
- "/#{CGI.escape(id)}"
24
- end
25
-
26
- def self.retrieve(_id, _opts = {})
27
- raise NotImplementedError,
28
- "Tax IDs cannot be retrieved without a customer ID. Retrieve a " \
29
- "tax ID using `Customer.retrieve_tax_id('customer_id', " \
30
- "'tax_id_id')`"
19
+ # Creates a new account or customer tax_id object.
20
+ def self.create(params = {}, opts = {})
21
+ request_stripe_object(method: :post, path: "/v1/tax_ids", params: params, opts: opts)
31
22
  end
32
23
 
24
+ # Deletes an existing account or customer tax_id object.
33
25
  def self.delete(id, params = {}, opts = {})
34
26
  request_stripe_object(
35
27
  method: :delete,
36
- path: "#{resource_url}/#{id}",
28
+ path: format("/v1/tax_ids/%<id>s", { id: CGI.escape(id) }),
37
29
  params: params,
38
30
  opts: opts
39
31
  )
40
32
  end
41
33
 
34
+ # Deletes an existing account or customer tax_id object.
42
35
  def delete(params = {}, opts = {})
43
36
  request_stripe_object(
44
37
  method: :delete,
45
- path: resource_url.to_s,
38
+ path: format("/v1/tax_ids/%<id>s", { id: CGI.escape(self["id"]) }),
46
39
  params: params,
47
40
  opts: opts
48
41
  )
49
42
  end
43
+
44
+ # Returns a list of tax IDs.
45
+ def self.list(filters = {}, opts = {})
46
+ request_stripe_object(method: :get, path: "/v1/tax_ids", params: filters, opts: opts)
47
+ end
50
48
  end
51
49
  end
@@ -27,36 +27,6 @@ module Stripe
27
27
  )
28
28
  end
29
29
 
30
- # Initiates an input collection flow on a Reader.
31
- def collect_inputs(params = {}, opts = {})
32
- request_stripe_object(
33
- method: :post,
34
- path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(self["id"]) }),
35
- params: params,
36
- opts: opts
37
- )
38
- end
39
-
40
- # Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
41
- def collect_payment_method(params = {}, opts = {})
42
- request_stripe_object(
43
- method: :post,
44
- path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(self["id"]) }),
45
- params: params,
46
- opts: opts
47
- )
48
- end
49
-
50
- # Finalizes a payment on a Reader.
51
- def confirm_payment_intent(params = {}, opts = {})
52
- request_stripe_object(
53
- method: :post,
54
- path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(self["id"]) }),
55
- params: params,
56
- opts: opts
57
- )
58
- end
59
-
60
30
  # Initiates a payment flow on a Reader.
61
31
  def process_payment_intent(params = {}, opts = {})
62
32
  request_stripe_object(
@@ -107,36 +77,6 @@ module Stripe
107
77
  )
108
78
  end
109
79
 
110
- # Initiates an input collection flow on a Reader.
111
- def self.collect_inputs(reader, params = {}, opts = {})
112
- request_stripe_object(
113
- method: :post,
114
- path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(reader) }),
115
- params: params,
116
- opts: opts
117
- )
118
- end
119
-
120
- # Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
121
- def self.collect_payment_method(reader, params = {}, opts = {})
122
- request_stripe_object(
123
- method: :post,
124
- path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(reader) }),
125
- params: params,
126
- opts: opts
127
- )
128
- end
129
-
130
- # Finalizes a payment on a Reader.
131
- def self.confirm_payment_intent(reader, params = {}, opts = {})
132
- request_stripe_object(
133
- method: :post,
134
- path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(reader) }),
135
- params: params,
136
- opts: opts
137
- )
138
- end
139
-
140
80
  # Initiates a payment flow on a Reader.
141
81
  def self.process_payment_intent(reader, params = {}, opts = {})
142
82
  request_stripe_object(