stripe 10.5.0.pre.beta.1 → 10.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +43 -249
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +0 -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 -20
  9. data/lib/stripe/resources/account.rb +8 -0
  10. data/lib/stripe/resources/apps/secret.rb +2 -0
  11. data/lib/stripe/resources/charge.rb +10 -0
  12. data/lib/stripe/resources/checkout/session.rb +8 -0
  13. data/lib/stripe/resources/climate/order.rb +8 -0
  14. data/lib/stripe/resources/credit_note.rb +4 -0
  15. data/lib/stripe/resources/customer.rb +16 -0
  16. data/lib/stripe/resources/dispute.rb +6 -0
  17. data/lib/stripe/resources/financial_connections/account.rb +10 -3
  18. data/lib/stripe/resources/identity/verification_session.rb +44 -0
  19. data/lib/stripe/resources/invoice.rb +20 -21
  20. data/lib/stripe/resources/issuing/authorization.rb +17 -0
  21. data/lib/stripe/resources/issuing/card.rb +8 -0
  22. data/lib/stripe/resources/issuing/dispute.rb +2 -0
  23. data/lib/stripe/resources/issuing/transaction.rb +4 -0
  24. data/lib/stripe/resources/payment_intent.rb +118 -0
  25. data/lib/stripe/resources/payment_link.rb +2 -0
  26. data/lib/stripe/resources/payment_method.rb +28 -0
  27. data/lib/stripe/resources/payment_method_domain.rb +12 -0
  28. data/lib/stripe/resources/payout.rb +8 -0
  29. data/lib/stripe/resources/quote.rb +12 -94
  30. data/lib/stripe/resources/refund.rb +8 -0
  31. data/lib/stripe/resources/review.rb +2 -0
  32. data/lib/stripe/resources/setup_intent.rb +36 -0
  33. data/lib/stripe/resources/source.rb +2 -0
  34. data/lib/stripe/resources/subscription.rb +14 -0
  35. data/lib/stripe/resources/subscription_schedule.rb +4 -18
  36. data/lib/stripe/resources/tax/calculation.rb +2 -0
  37. data/lib/stripe/resources/tax/transaction.rb +4 -0
  38. data/lib/stripe/resources/terminal/reader.rb +12 -54
  39. data/lib/stripe/resources/test_helpers/test_clock.rb +2 -0
  40. data/lib/stripe/resources/topup.rb +2 -0
  41. data/lib/stripe/resources/treasury/financial_account.rb +4 -0
  42. data/lib/stripe/resources/treasury/inbound_transfer.rb +8 -0
  43. data/lib/stripe/resources/treasury/outbound_payment.rb +8 -0
  44. data/lib/stripe/resources/treasury/outbound_transfer.rb +8 -0
  45. data/lib/stripe/resources/treasury/received_credit.rb +1 -0
  46. data/lib/stripe/resources/treasury/received_debit.rb +1 -0
  47. data/lib/stripe/resources.rb +0 -19
  48. data/lib/stripe/stripe_client.rb +28 -62
  49. data/lib/stripe/stripe_configuration.rb +1 -2
  50. data/lib/stripe/util.rb +1 -8
  51. data/lib/stripe/version.rb +1 -1
  52. data/lib/stripe.rb +0 -46
  53. metadata +4 -24
  54. data/lib/stripe/request_signing_authenticator.rb +0 -79
  55. data/lib/stripe/resources/account_notice.rb +0 -14
  56. data/lib/stripe/resources/capital/financing_offer.rb +0 -32
  57. data/lib/stripe/resources/capital/financing_summary.rb +0 -12
  58. data/lib/stripe/resources/capital/financing_transaction.rb +0 -13
  59. data/lib/stripe/resources/confirmation_token.rb +0 -13
  60. data/lib/stripe/resources/customer_session.rb +0 -12
  61. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -13
  62. data/lib/stripe/resources/gift_cards/card.rb +0 -25
  63. data/lib/stripe/resources/gift_cards/transaction.rb +0 -56
  64. data/lib/stripe/resources/invoice_payment.rb +0 -11
  65. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -69
  66. data/lib/stripe/resources/issuing/personalization_design.rb +0 -77
  67. data/lib/stripe/resources/issuing/physical_bundle.rb +0 -13
  68. data/lib/stripe/resources/margin.rb +0 -14
  69. data/lib/stripe/resources/order.rb +0 -89
  70. data/lib/stripe/resources/quote_phase.rb +0 -29
  71. data/lib/stripe/resources/quote_preview_invoice.rb +0 -42
  72. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -10
  73. data/lib/stripe/resources/tax/form.rb +0 -39
@@ -13,6 +13,7 @@ module Stripe
13
13
 
14
14
  OBJECT_NAME = "issuing.dispute"
15
15
 
16
+ # Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
16
17
  def submit(params = {}, opts = {})
17
18
  request_stripe_object(
18
19
  method: :post,
@@ -22,6 +23,7 @@ module Stripe
22
23
  )
23
24
  end
24
25
 
26
+ # Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
25
27
  def self.submit(dispute, params = {}, opts = {})
26
28
  request_stripe_object(
27
29
  method: :post,
@@ -21,6 +21,7 @@ module Stripe
21
21
  class TestHelpers < APIResourceTestHelpers
22
22
  RESOURCE_CLASS = Transaction
23
23
 
24
+ # Allows the user to capture an arbitrary amount, also known as a forced capture.
24
25
  def self.create_force_capture(params = {}, opts = {})
25
26
  request_stripe_object(
26
27
  method: :post,
@@ -30,6 +31,7 @@ module Stripe
30
31
  )
31
32
  end
32
33
 
34
+ # Allows the user to refund an arbitrary amount, also known as a unlinked refund.
33
35
  def self.create_unlinked_refund(params = {}, opts = {})
34
36
  request_stripe_object(
35
37
  method: :post,
@@ -39,6 +41,7 @@ module Stripe
39
41
  )
40
42
  end
41
43
 
44
+ # Refund a test-mode Transaction.
42
45
  def self.refund(transaction, params = {}, opts = {})
43
46
  request_stripe_object(
44
47
  method: :post,
@@ -48,6 +51,7 @@ module Stripe
48
51
  )
49
52
  end
50
53
 
54
+ # Refund a test-mode Transaction.
51
55
  def refund(params = {}, opts = {})
52
56
  @resource.request_stripe_object(
53
57
  method: :post,
@@ -21,6 +21,7 @@ module Stripe
21
21
 
22
22
  OBJECT_NAME = "payment_intent"
23
23
 
24
+ # Manually reconcile the remaining amount for a customer_balance PaymentIntent.
24
25
  def apply_customer_balance(params = {}, opts = {})
25
26
  request_stripe_object(
26
27
  method: :post,
@@ -30,6 +31,11 @@ module Stripe
30
31
  )
31
32
  end
32
33
 
34
+ # You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing.
35
+ #
36
+ # After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded.
37
+ #
38
+ # You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
33
39
  def cancel(params = {}, opts = {})
34
40
  request_stripe_object(
35
41
  method: :post,
@@ -39,6 +45,11 @@ module Stripe
39
45
  )
40
46
  end
41
47
 
48
+ # Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.
49
+ #
50
+ # Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
51
+ #
52
+ # Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
42
53
  def capture(params = {}, opts = {})
43
54
  request_stripe_object(
44
55
  method: :post,
@@ -48,6 +59,29 @@ module Stripe
48
59
  )
49
60
  end
50
61
 
62
+ # Confirm that your customer intends to pay with current or provided
63
+ # payment method. Upon confirmation, the PaymentIntent will attempt to initiate
64
+ # a payment.
65
+ # If the selected payment method requires additional authentication steps, the
66
+ # PaymentIntent will transition to the requires_action status and
67
+ # suggest additional actions via next_action. If payment fails,
68
+ # the PaymentIntent transitions to the requires_payment_method status or the
69
+ # canceled status if the confirmation limit is reached. If
70
+ # payment succeeds, the PaymentIntent will transition to the succeeded
71
+ # status (or requires_capture, if capture_method is set to manual).
72
+ # If the confirmation_method is automatic, payment may be attempted
73
+ # using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
74
+ # and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret).
75
+ # After next_actions are handled by the client, no additional
76
+ # confirmation is required to complete the payment.
77
+ # If the confirmation_method is manual, all payment attempts must be
78
+ # initiated using a secret key.
79
+ # If any actions are required for the payment, the PaymentIntent will
80
+ # return to the requires_confirmation state
81
+ # after those actions are completed. Your server needs to then
82
+ # explicitly re-confirm the PaymentIntent to initiate the next payment
83
+ # attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual)
84
+ # to learn more about manual confirmation.
51
85
  def confirm(params = {}, opts = {})
52
86
  request_stripe_object(
53
87
  method: :post,
@@ -57,6 +91,30 @@ module Stripe
57
91
  )
58
92
  end
59
93
 
94
+ # Perform an incremental authorization on an eligible
95
+ # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
96
+ # PaymentIntent's status must be requires_capture and
97
+ # [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported)
98
+ # must be true.
99
+ #
100
+ # Incremental authorizations attempt to increase the authorized amount on
101
+ # your customer's card to the new, higher amount provided. Similar to the
102
+ # initial authorization, incremental authorizations can be declined. A
103
+ # single PaymentIntent can call this endpoint multiple times to further
104
+ # increase the authorized amount.
105
+ #
106
+ # If the incremental authorization succeeds, the PaymentIntent object
107
+ # returns with the updated
108
+ # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
109
+ # If the incremental authorization fails, a
110
+ # [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
111
+ # fields on the PaymentIntent or Charge update. The PaymentIntent
112
+ # object remains capturable for the previously authorized amount.
113
+ #
114
+ # Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
115
+ # After it's captured, a PaymentIntent can no longer be incremented.
116
+ #
117
+ # Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
60
118
  def increment_authorization(params = {}, opts = {})
61
119
  request_stripe_object(
62
120
  method: :post,
@@ -66,6 +124,7 @@ module Stripe
66
124
  )
67
125
  end
68
126
 
127
+ # Verifies microdeposits on a PaymentIntent object.
69
128
  def verify_microdeposits(params = {}, opts = {})
70
129
  request_stripe_object(
71
130
  method: :post,
@@ -75,6 +134,7 @@ module Stripe
75
134
  )
76
135
  end
77
136
 
137
+ # Manually reconcile the remaining amount for a customer_balance PaymentIntent.
78
138
  def self.apply_customer_balance(intent, params = {}, opts = {})
79
139
  request_stripe_object(
80
140
  method: :post,
@@ -84,6 +144,11 @@ module Stripe
84
144
  )
85
145
  end
86
146
 
147
+ # You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing.
148
+ #
149
+ # After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded.
150
+ #
151
+ # You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
87
152
  def self.cancel(intent, params = {}, opts = {})
88
153
  request_stripe_object(
89
154
  method: :post,
@@ -93,6 +158,11 @@ module Stripe
93
158
  )
94
159
  end
95
160
 
161
+ # Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.
162
+ #
163
+ # Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
164
+ #
165
+ # Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
96
166
  def self.capture(intent, params = {}, opts = {})
97
167
  request_stripe_object(
98
168
  method: :post,
@@ -102,6 +172,29 @@ module Stripe
102
172
  )
103
173
  end
104
174
 
175
+ # Confirm that your customer intends to pay with current or provided
176
+ # payment method. Upon confirmation, the PaymentIntent will attempt to initiate
177
+ # a payment.
178
+ # If the selected payment method requires additional authentication steps, the
179
+ # PaymentIntent will transition to the requires_action status and
180
+ # suggest additional actions via next_action. If payment fails,
181
+ # the PaymentIntent transitions to the requires_payment_method status or the
182
+ # canceled status if the confirmation limit is reached. If
183
+ # payment succeeds, the PaymentIntent will transition to the succeeded
184
+ # status (or requires_capture, if capture_method is set to manual).
185
+ # If the confirmation_method is automatic, payment may be attempted
186
+ # using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
187
+ # and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret).
188
+ # After next_actions are handled by the client, no additional
189
+ # confirmation is required to complete the payment.
190
+ # If the confirmation_method is manual, all payment attempts must be
191
+ # initiated using a secret key.
192
+ # If any actions are required for the payment, the PaymentIntent will
193
+ # return to the requires_confirmation state
194
+ # after those actions are completed. Your server needs to then
195
+ # explicitly re-confirm the PaymentIntent to initiate the next payment
196
+ # attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual)
197
+ # to learn more about manual confirmation.
105
198
  def self.confirm(intent, params = {}, opts = {})
106
199
  request_stripe_object(
107
200
  method: :post,
@@ -111,6 +204,30 @@ module Stripe
111
204
  )
112
205
  end
113
206
 
207
+ # Perform an incremental authorization on an eligible
208
+ # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
209
+ # PaymentIntent's status must be requires_capture and
210
+ # [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported)
211
+ # must be true.
212
+ #
213
+ # Incremental authorizations attempt to increase the authorized amount on
214
+ # your customer's card to the new, higher amount provided. Similar to the
215
+ # initial authorization, incremental authorizations can be declined. A
216
+ # single PaymentIntent can call this endpoint multiple times to further
217
+ # increase the authorized amount.
218
+ #
219
+ # If the incremental authorization succeeds, the PaymentIntent object
220
+ # returns with the updated
221
+ # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
222
+ # If the incremental authorization fails, a
223
+ # [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
224
+ # fields on the PaymentIntent or Charge update. The PaymentIntent
225
+ # object remains capturable for the previously authorized amount.
226
+ #
227
+ # Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
228
+ # After it's captured, a PaymentIntent can no longer be incremented.
229
+ #
230
+ # Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
114
231
  def self.increment_authorization(intent, params = {}, opts = {})
115
232
  request_stripe_object(
116
233
  method: :post,
@@ -120,6 +237,7 @@ module Stripe
120
237
  )
121
238
  end
122
239
 
240
+ # Verifies microdeposits on a PaymentIntent object.
123
241
  def self.verify_microdeposits(intent, params = {}, opts = {})
124
242
  request_stripe_object(
125
243
  method: :post,
@@ -14,6 +14,7 @@ module Stripe
14
14
 
15
15
  OBJECT_NAME = "payment_link"
16
16
 
17
+ # When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
17
18
  def list_line_items(params = {}, opts = {})
18
19
  request_stripe_object(
19
20
  method: :get,
@@ -23,6 +24,7 @@ module Stripe
23
24
  )
24
25
  end
25
26
 
27
+ # When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
26
28
  def self.list_line_items(payment_link, params = {}, opts = {})
27
29
  request_stripe_object(
28
30
  method: :get,
@@ -14,6 +14,19 @@ module Stripe
14
14
 
15
15
  OBJECT_NAME = "payment_method"
16
16
 
17
+ # Attaches a PaymentMethod object to a Customer.
18
+ #
19
+ # To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents)
20
+ # or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage).
21
+ # These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach
22
+ # endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for
23
+ # future use, which makes later declines and payment friction more likely.
24
+ # See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up
25
+ # future payments.
26
+ #
27
+ # To use this PaymentMethod as the default for invoice or subscription payments,
28
+ # set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method),
29
+ # on the Customer to the PaymentMethod's ID.
17
30
  def attach(params = {}, opts = {})
18
31
  request_stripe_object(
19
32
  method: :post,
@@ -23,6 +36,7 @@ module Stripe
23
36
  )
24
37
  end
25
38
 
39
+ # Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.
26
40
  def detach(params = {}, opts = {})
27
41
  request_stripe_object(
28
42
  method: :post,
@@ -32,6 +46,19 @@ module Stripe
32
46
  )
33
47
  end
34
48
 
49
+ # Attaches a PaymentMethod object to a Customer.
50
+ #
51
+ # To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents)
52
+ # or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage).
53
+ # These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach
54
+ # endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for
55
+ # future use, which makes later declines and payment friction more likely.
56
+ # See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up
57
+ # future payments.
58
+ #
59
+ # To use this PaymentMethod as the default for invoice or subscription payments,
60
+ # set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method),
61
+ # on the Customer to the PaymentMethod's ID.
35
62
  def self.attach(payment_method, params = {}, opts = {})
36
63
  request_stripe_object(
37
64
  method: :post,
@@ -41,6 +68,7 @@ module Stripe
41
68
  )
42
69
  end
43
70
 
71
+ # Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.
44
72
  def self.detach(payment_method, params = {}, opts = {})
45
73
  request_stripe_object(
46
74
  method: :post,
@@ -13,6 +13,12 @@ module Stripe
13
13
 
14
14
  OBJECT_NAME = "payment_method_domain"
15
15
 
16
+ # Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain.
17
+ # The payment method doesn't appear in Elements for this domain until it is active.
18
+ #
19
+ # To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint.
20
+ #
21
+ # Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
16
22
  def validate(params = {}, opts = {})
17
23
  request_stripe_object(
18
24
  method: :post,
@@ -22,6 +28,12 @@ module Stripe
22
28
  )
23
29
  end
24
30
 
31
+ # Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain.
32
+ # The payment method doesn't appear in Elements for this domain until it is active.
33
+ #
34
+ # To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint.
35
+ #
36
+ # Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
25
37
  def self.validate(payment_method_domain, params = {}, opts = {})
26
38
  request_stripe_object(
27
39
  method: :post,
@@ -17,6 +17,7 @@ module Stripe
17
17
 
18
18
  OBJECT_NAME = "payout"
19
19
 
20
+ # You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts.
20
21
  def cancel(params = {}, opts = {})
21
22
  request_stripe_object(
22
23
  method: :post,
@@ -26,6 +27,9 @@ module Stripe
26
27
  )
27
28
  end
28
29
 
30
+ # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead.
31
+ #
32
+ # By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
29
33
  def reverse(params = {}, opts = {})
30
34
  request_stripe_object(
31
35
  method: :post,
@@ -35,6 +39,7 @@ module Stripe
35
39
  )
36
40
  end
37
41
 
42
+ # You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts.
38
43
  def self.cancel(payout, params = {}, opts = {})
39
44
  request_stripe_object(
40
45
  method: :post,
@@ -44,6 +49,9 @@ module Stripe
44
49
  )
45
50
  end
46
51
 
52
+ # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead.
53
+ #
54
+ # By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
47
55
  def self.reverse(payout, params = {}, opts = {})
48
56
  request_stripe_object(
49
57
  method: :post,
@@ -8,13 +8,10 @@ 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
 
15
- nested_resource_class_methods :preview_invoice, operations: %i[list]
16
- nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
17
-
14
+ # Accepts the specified quote.
18
15
  def accept(params = {}, opts = {})
19
16
  request_stripe_object(
20
17
  method: :post,
@@ -24,6 +21,7 @@ module Stripe
24
21
  )
25
22
  end
26
23
 
24
+ # Cancels the quote.
27
25
  def cancel(params = {}, opts = {})
28
26
  request_stripe_object(
29
27
  method: :post,
@@ -33,6 +31,7 @@ module Stripe
33
31
  )
34
32
  end
35
33
 
34
+ # Finalizes the quote.
36
35
  def finalize_quote(params = {}, opts = {})
37
36
  request_stripe_object(
38
37
  method: :post,
@@ -42,6 +41,7 @@ module Stripe
42
41
  )
43
42
  end
44
43
 
44
+ # When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
45
45
  def list_computed_upfront_line_items(params = {}, opts = {})
46
46
  request_stripe_object(
47
47
  method: :get,
@@ -51,6 +51,7 @@ module Stripe
51
51
  )
52
52
  end
53
53
 
54
+ # When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
54
55
  def list_line_items(params = {}, opts = {})
55
56
  request_stripe_object(
56
57
  method: :get,
@@ -60,42 +61,7 @@ module Stripe
60
61
  )
61
62
  end
62
63
 
63
- def list_lines(params = {}, opts = {})
64
- request_stripe_object(
65
- method: :get,
66
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
67
- params: params,
68
- opts: opts
69
- )
70
- end
71
-
72
- def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
73
- request_stripe_object(
74
- method: :get,
75
- path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
76
- params: params,
77
- opts: opts
78
- )
79
- end
80
-
81
- def mark_draft(params = {}, opts = {})
82
- request_stripe_object(
83
- method: :post,
84
- path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
85
- params: params,
86
- opts: opts
87
- )
88
- end
89
-
90
- def mark_stale(params = {}, opts = {})
91
- request_stripe_object(
92
- method: :post,
93
- path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
94
- params: params,
95
- opts: opts
96
- )
97
- end
98
-
64
+ # Download the PDF for a finalized quote
99
65
  def pdf(params = {}, opts = {}, &read_body_chunk_block)
100
66
  config = opts[:client]&.config || Stripe.config
101
67
  opts = { api_base: config.uploads_base }.merge(opts)
@@ -108,15 +74,7 @@ module Stripe
108
74
  )
109
75
  end
110
76
 
111
- def reestimate(params = {}, opts = {})
112
- request_stripe_object(
113
- method: :post,
114
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
115
- params: params,
116
- opts: opts
117
- )
118
- end
119
-
77
+ # Accepts the specified quote.
120
78
  def self.accept(quote, params = {}, opts = {})
121
79
  request_stripe_object(
122
80
  method: :post,
@@ -126,6 +84,7 @@ module Stripe
126
84
  )
127
85
  end
128
86
 
87
+ # Cancels the quote.
129
88
  def self.cancel(quote, params = {}, opts = {})
130
89
  request_stripe_object(
131
90
  method: :post,
@@ -135,6 +94,7 @@ module Stripe
135
94
  )
136
95
  end
137
96
 
97
+ # Finalizes the quote.
138
98
  def self.finalize_quote(quote, params = {}, opts = {})
139
99
  request_stripe_object(
140
100
  method: :post,
@@ -144,6 +104,7 @@ module Stripe
144
104
  )
145
105
  end
146
106
 
107
+ # When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
147
108
  def self.list_computed_upfront_line_items(quote, params = {}, opts = {})
148
109
  request_stripe_object(
149
110
  method: :get,
@@ -153,6 +114,7 @@ module Stripe
153
114
  )
154
115
  end
155
116
 
117
+ # When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
156
118
  def self.list_line_items(quote, params = {}, opts = {})
157
119
  request_stripe_object(
158
120
  method: :get,
@@ -162,42 +124,7 @@ module Stripe
162
124
  )
163
125
  end
164
126
 
165
- def self.list_lines(quote, params = {}, opts = {})
166
- request_stripe_object(
167
- method: :get,
168
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
169
- params: params,
170
- opts: opts
171
- )
172
- end
173
-
174
- def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
175
- request_stripe_object(
176
- method: :get,
177
- path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
178
- params: params,
179
- opts: opts
180
- )
181
- end
182
-
183
- def self.mark_draft(quote, params = {}, opts = {})
184
- request_stripe_object(
185
- method: :post,
186
- path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
187
- params: params,
188
- opts: opts
189
- )
190
- end
191
-
192
- def self.mark_stale(quote, params = {}, opts = {})
193
- request_stripe_object(
194
- method: :post,
195
- path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
196
- params: params,
197
- opts: opts
198
- )
199
- end
200
-
127
+ # Download the PDF for a finalized quote
201
128
  def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
202
129
  config = opts[:client]&.config || Stripe.config
203
130
  opts = { api_base: config.uploads_base }.merge(opts)
@@ -209,14 +136,5 @@ module Stripe
209
136
  &read_body_chunk_block
210
137
  )
211
138
  end
212
-
213
- def self.reestimate(quote, params = {}, opts = {})
214
- request_stripe_object(
215
- method: :post,
216
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
217
- params: params,
218
- opts: opts
219
- )
220
- end
221
139
  end
222
140
  end
@@ -14,6 +14,9 @@ module Stripe
14
14
 
15
15
  OBJECT_NAME = "refund"
16
16
 
17
+ # Cancels a refund with a status of requires_action.
18
+ #
19
+ # You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state.
17
20
  def cancel(params = {}, opts = {})
18
21
  request_stripe_object(
19
22
  method: :post,
@@ -23,6 +26,9 @@ module Stripe
23
26
  )
24
27
  end
25
28
 
29
+ # Cancels a refund with a status of requires_action.
30
+ #
31
+ # You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state.
26
32
  def self.cancel(refund, params = {}, opts = {})
27
33
  request_stripe_object(
28
34
  method: :post,
@@ -39,6 +45,7 @@ module Stripe
39
45
  class TestHelpers < APIResourceTestHelpers
40
46
  RESOURCE_CLASS = Refund
41
47
 
48
+ # Expire a refund with a status of requires_action.
42
49
  def self.expire(refund, params = {}, opts = {})
43
50
  request_stripe_object(
44
51
  method: :post,
@@ -48,6 +55,7 @@ module Stripe
48
55
  )
49
56
  end
50
57
 
58
+ # Expire a refund with a status of requires_action.
51
59
  def expire(params = {}, opts = {})
52
60
  @resource.request_stripe_object(
53
61
  method: :post,
@@ -11,6 +11,7 @@ module Stripe
11
11
 
12
12
  OBJECT_NAME = "review"
13
13
 
14
+ # Approves a Review object, closing it and removing it from the list of reviews.
14
15
  def approve(params = {}, opts = {})
15
16
  request_stripe_object(
16
17
  method: :post,
@@ -20,6 +21,7 @@ module Stripe
20
21
  )
21
22
  end
22
23
 
24
+ # Approves a Review object, closing it and removing it from the list of reviews.
23
25
  def self.approve(review, params = {}, opts = {})
24
26
  request_stripe_object(
25
27
  method: :post,