stripe 10.11.0 → 10.12.0.pre.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +292 -48
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +11 -0
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_operations/request.rb +2 -1
  7. data/lib/stripe/api_version.rb +1 -0
  8. data/lib/stripe/object_types.rb +22 -0
  9. data/lib/stripe/request_signing_authenticator.rb +79 -0
  10. data/lib/stripe/resources/account.rb +69 -69
  11. data/lib/stripe/resources/account_notice.rb +32 -0
  12. data/lib/stripe/resources/apple_pay_domain.rb +4 -4
  13. data/lib/stripe/resources/apps/secret.rb +5 -5
  14. data/lib/stripe/resources/capital/financing_offer.rb +49 -0
  15. data/lib/stripe/resources/capital/financing_summary.rb +15 -0
  16. data/lib/stripe/resources/capital/financing_transaction.rb +27 -0
  17. data/lib/stripe/resources/checkout/session.rb +21 -21
  18. data/lib/stripe/resources/confirmation_token.rb +16 -0
  19. data/lib/stripe/resources/credit_note.rb +35 -35
  20. data/lib/stripe/resources/customer.rb +66 -55
  21. data/lib/stripe/resources/customer_entitlement.rb +12 -0
  22. data/lib/stripe/resources/customer_entitlement_summary.rb +12 -0
  23. data/lib/stripe/resources/entitlements/feature.rb +38 -0
  24. data/lib/stripe/resources/ephemeral_key.rb +9 -9
  25. data/lib/stripe/resources/file.rb +5 -5
  26. data/lib/stripe/resources/financial_connections/account.rb +37 -34
  27. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +14 -0
  28. data/lib/stripe/resources/gift_cards/card.rb +59 -0
  29. data/lib/stripe/resources/gift_cards/transaction.rb +93 -0
  30. data/lib/stripe/resources/identity/verification_session.rb +38 -38
  31. data/lib/stripe/resources/invoice.rb +113 -60
  32. data/lib/stripe/resources/invoice_payment.rb +12 -0
  33. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  34. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +88 -0
  35. data/lib/stripe/resources/issuing/dispute.rb +16 -16
  36. data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
  37. data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
  38. data/lib/stripe/resources/margin.rb +37 -0
  39. data/lib/stripe/resources/order.rb +120 -0
  40. data/lib/stripe/resources/payment_intent.rb +150 -100
  41. data/lib/stripe/resources/payment_link.rb +10 -10
  42. data/lib/stripe/resources/payment_method.rb +17 -17
  43. data/lib/stripe/resources/payment_method_domain.rb +29 -29
  44. data/lib/stripe/resources/payout.rb +22 -22
  45. data/lib/stripe/resources/quote.rb +136 -32
  46. data/lib/stripe/resources/quote_phase.rb +39 -0
  47. data/lib/stripe/resources/quote_preview_invoice.rb +43 -0
  48. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +11 -0
  49. data/lib/stripe/resources/setup_intent.rb +32 -32
  50. data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -4
  51. data/lib/stripe/resources/source.rb +17 -17
  52. data/lib/stripe/resources/subscription.rb +36 -36
  53. data/lib/stripe/resources/subscription_schedule.rb +31 -11
  54. data/lib/stripe/resources/tax/calculation.rb +10 -10
  55. data/lib/stripe/resources/tax/form.rb +49 -0
  56. data/lib/stripe/resources/tax/transaction.rb +10 -10
  57. data/lib/stripe/resources/terminal/reader.rb +101 -41
  58. data/lib/stripe/resources/treasury/financial_account.rb +25 -25
  59. data/lib/stripe/resources/treasury/transaction_entry.rb +4 -4
  60. data/lib/stripe/resources.rb +21 -0
  61. data/lib/stripe/stripe_client.rb +62 -28
  62. data/lib/stripe/stripe_configuration.rb +2 -1
  63. data/lib/stripe/util.rb +8 -1
  64. data/lib/stripe/version.rb +1 -1
  65. data/lib/stripe.rb +54 -0
  66. metadata +25 -3
@@ -34,6 +34,16 @@ module Stripe
34
34
  )
35
35
  end
36
36
 
37
+ # Manually reconcile the remaining amount for a customer_balance PaymentIntent.
38
+ def self.apply_customer_balance(intent, params = {}, opts = {})
39
+ request_stripe_object(
40
+ method: :post,
41
+ path: format("/v1/payment_intents/%<intent>s/apply_customer_balance", { intent: CGI.escape(intent) }),
42
+ params: params,
43
+ opts: opts
44
+ )
45
+ end
46
+
37
47
  # 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.
38
48
  #
39
49
  # 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.
@@ -48,6 +58,20 @@ module Stripe
48
58
  )
49
59
  end
50
60
 
61
+ # 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.
62
+ #
63
+ # 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.
64
+ #
65
+ # You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
66
+ def self.cancel(intent, params = {}, opts = {})
67
+ request_stripe_object(
68
+ method: :post,
69
+ path: format("/v1/payment_intents/%<intent>s/cancel", { intent: CGI.escape(intent) }),
70
+ params: params,
71
+ opts: opts
72
+ )
73
+ end
74
+
51
75
  # Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.
52
76
  #
53
77
  # Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
@@ -62,6 +86,20 @@ module Stripe
62
86
  )
63
87
  end
64
88
 
89
+ # Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.
90
+ #
91
+ # Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
92
+ #
93
+ # Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
94
+ def self.capture(intent, params = {}, opts = {})
95
+ request_stripe_object(
96
+ method: :post,
97
+ path: format("/v1/payment_intents/%<intent>s/capture", { intent: CGI.escape(intent) }),
98
+ params: params,
99
+ opts: opts
100
+ )
101
+ end
102
+
65
103
  # Confirm that your customer intends to pay with current or provided
66
104
  # payment method. Upon confirmation, the PaymentIntent will attempt to initiate
67
105
  # a payment.
@@ -93,87 +131,6 @@ module Stripe
93
131
  )
94
132
  end
95
133
 
96
- # Perform an incremental 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
- # [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported)
100
- # must be true.
101
- #
102
- # Incremental authorizations attempt to increase the authorized amount on
103
- # your customer's card to the new, higher amount provided. Similar to the
104
- # initial authorization, incremental authorizations can be declined. A
105
- # single PaymentIntent can call this endpoint multiple times to further
106
- # increase the authorized amount.
107
- #
108
- # If the incremental authorization succeeds, the PaymentIntent object
109
- # returns with the updated
110
- # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
111
- # If the incremental authorization fails, a
112
- # [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
113
- # fields on the PaymentIntent or Charge update. The PaymentIntent
114
- # object remains capturable for the previously authorized amount.
115
- #
116
- # Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
117
- # After it's captured, a PaymentIntent can no longer be incremented.
118
- #
119
- # Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
120
- def increment_authorization(params = {}, opts = {})
121
- request_stripe_object(
122
- method: :post,
123
- path: format("/v1/payment_intents/%<intent>s/increment_authorization", { intent: CGI.escape(self["id"]) }),
124
- params: params,
125
- opts: opts
126
- )
127
- end
128
-
129
- # Verifies microdeposits on a PaymentIntent object.
130
- def verify_microdeposits(params = {}, opts = {})
131
- request_stripe_object(
132
- method: :post,
133
- path: format("/v1/payment_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(self["id"]) }),
134
- params: params,
135
- opts: opts
136
- )
137
- end
138
-
139
- # Manually reconcile the remaining amount for a customer_balance PaymentIntent.
140
- def self.apply_customer_balance(intent, params = {}, opts = {})
141
- request_stripe_object(
142
- method: :post,
143
- path: format("/v1/payment_intents/%<intent>s/apply_customer_balance", { intent: CGI.escape(intent) }),
144
- params: params,
145
- opts: opts
146
- )
147
- end
148
-
149
- # 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.
150
- #
151
- # 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.
152
- #
153
- # You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
154
- def self.cancel(intent, params = {}, opts = {})
155
- request_stripe_object(
156
- method: :post,
157
- path: format("/v1/payment_intents/%<intent>s/cancel", { intent: CGI.escape(intent) }),
158
- params: params,
159
- opts: opts
160
- )
161
- end
162
-
163
- # Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.
164
- #
165
- # Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
166
- #
167
- # Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
168
- def self.capture(intent, params = {}, opts = {})
169
- request_stripe_object(
170
- method: :post,
171
- path: format("/v1/payment_intents/%<intent>s/capture", { intent: CGI.escape(intent) }),
172
- params: params,
173
- opts: opts
174
- )
175
- end
176
-
177
134
  # Confirm that your customer intends to pay with current or provided
178
135
  # payment method. Upon confirmation, the PaymentIntent will attempt to initiate
179
136
  # a payment.
@@ -205,6 +162,70 @@ module Stripe
205
162
  )
206
163
  end
207
164
 
165
+ # Creates a PaymentIntent object.
166
+ #
167
+ # After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm)
168
+ # to continue the payment. Learn more about <a href="/docs/payments/payment-intents">the available payment flows
169
+ # with the Payment Intents API.
170
+ #
171
+ # When you use confirm=true during creation, it's equivalent to creating
172
+ # and confirming the PaymentIntent in the same call. You can use any parameters
173
+ # available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply
174
+ # confirm=true.
175
+ def self.create(params = {}, opts = {})
176
+ request_stripe_object(method: :post, path: "/v1/payment_intents", params: params, opts: opts)
177
+ end
178
+
179
+ # Perform an decremental authorization on an eligible
180
+ # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
181
+ # PaymentIntent's status must be requires_capture and
182
+ # [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization)
183
+ # must be available.
184
+ #
185
+ # Decremental authorizations decrease the authorized amount on your customer's card
186
+ # to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount.
187
+ #
188
+ # After decrement, the PaymentIntent object
189
+ # returns with the updated
190
+ # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
191
+ # The PaymentIntent will now be capturable up to the new authorized amount.
192
+ #
193
+ # Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines.
194
+ # After it's captured, a PaymentIntent can no longer be decremented.
195
+ def decrement_authorization(params = {}, opts = {})
196
+ request_stripe_object(
197
+ method: :post,
198
+ path: format("/v1/payment_intents/%<intent>s/decrement_authorization", { intent: CGI.escape(self["id"]) }),
199
+ params: params,
200
+ opts: opts
201
+ )
202
+ end
203
+
204
+ # Perform an decremental authorization on an eligible
205
+ # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
206
+ # PaymentIntent's status must be requires_capture and
207
+ # [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization)
208
+ # must be available.
209
+ #
210
+ # Decremental authorizations decrease the authorized amount on your customer's card
211
+ # to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount.
212
+ #
213
+ # After decrement, the PaymentIntent object
214
+ # returns with the updated
215
+ # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
216
+ # The PaymentIntent will now be capturable up to the new authorized amount.
217
+ #
218
+ # Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines.
219
+ # After it's captured, a PaymentIntent can no longer be decremented.
220
+ def self.decrement_authorization(intent, params = {}, opts = {})
221
+ request_stripe_object(
222
+ method: :post,
223
+ path: format("/v1/payment_intents/%<intent>s/decrement_authorization", { intent: CGI.escape(intent) }),
224
+ params: params,
225
+ opts: opts
226
+ )
227
+ end
228
+
208
229
  # Perform an incremental authorization on an eligible
209
230
  # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
210
231
  # PaymentIntent's status must be requires_capture and
@@ -229,39 +250,48 @@ module Stripe
229
250
  # After it's captured, a PaymentIntent can no longer be incremented.
230
251
  #
231
252
  # Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
232
- def self.increment_authorization(intent, params = {}, opts = {})
253
+ def increment_authorization(params = {}, opts = {})
233
254
  request_stripe_object(
234
255
  method: :post,
235
- path: format("/v1/payment_intents/%<intent>s/increment_authorization", { intent: CGI.escape(intent) }),
256
+ path: format("/v1/payment_intents/%<intent>s/increment_authorization", { intent: CGI.escape(self["id"]) }),
236
257
  params: params,
237
258
  opts: opts
238
259
  )
239
260
  end
240
261
 
241
- # Verifies microdeposits on a PaymentIntent object.
242
- def self.verify_microdeposits(intent, params = {}, opts = {})
262
+ # Perform an incremental authorization on an eligible
263
+ # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
264
+ # PaymentIntent's status must be requires_capture and
265
+ # [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported)
266
+ # must be true.
267
+ #
268
+ # Incremental authorizations attempt to increase the authorized amount on
269
+ # your customer's card to the new, higher amount provided. Similar to the
270
+ # initial authorization, incremental authorizations can be declined. A
271
+ # single PaymentIntent can call this endpoint multiple times to further
272
+ # increase the authorized amount.
273
+ #
274
+ # If the incremental authorization succeeds, the PaymentIntent object
275
+ # returns with the updated
276
+ # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
277
+ # If the incremental authorization fails, a
278
+ # [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
279
+ # fields on the PaymentIntent or Charge update. The PaymentIntent
280
+ # object remains capturable for the previously authorized amount.
281
+ #
282
+ # Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
283
+ # After it's captured, a PaymentIntent can no longer be incremented.
284
+ #
285
+ # Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
286
+ def self.increment_authorization(intent, params = {}, opts = {})
243
287
  request_stripe_object(
244
288
  method: :post,
245
- path: format("/v1/payment_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(intent) }),
289
+ path: format("/v1/payment_intents/%<intent>s/increment_authorization", { intent: CGI.escape(intent) }),
246
290
  params: params,
247
291
  opts: opts
248
292
  )
249
293
  end
250
294
 
251
- # Creates a PaymentIntent object.
252
- #
253
- # After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm)
254
- # to continue the payment. Learn more about <a href="/docs/payments/payment-intents">the available payment flows
255
- # with the Payment Intents API.
256
- #
257
- # When you use confirm=true during creation, it's equivalent to creating
258
- # and confirming the PaymentIntent in the same call. You can use any parameters
259
- # available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply
260
- # confirm=true.
261
- def self.create(params = {}, opts = {})
262
- request_stripe_object(method: :post, path: "/v1/payment_intents", params: params, opts: opts)
263
- end
264
-
265
295
  # Returns a list of PaymentIntents.
266
296
  def self.list(filters = {}, opts = {})
267
297
  request_stripe_object(method: :get, path: "/v1/payment_intents", params: filters, opts: opts)
@@ -295,5 +325,25 @@ module Stripe
295
325
  opts: opts
296
326
  )
297
327
  end
328
+
329
+ # Verifies microdeposits on a PaymentIntent object.
330
+ def verify_microdeposits(params = {}, opts = {})
331
+ request_stripe_object(
332
+ method: :post,
333
+ path: format("/v1/payment_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(self["id"]) }),
334
+ params: params,
335
+ opts: opts
336
+ )
337
+ end
338
+
339
+ # Verifies microdeposits on a PaymentIntent object.
340
+ def self.verify_microdeposits(intent, params = {}, opts = {})
341
+ request_stripe_object(
342
+ method: :post,
343
+ path: format("/v1/payment_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(intent) }),
344
+ params: params,
345
+ opts: opts
346
+ )
347
+ end
298
348
  end
299
349
  end
@@ -17,6 +17,16 @@ module Stripe
17
17
  "payment_link"
18
18
  end
19
19
 
20
+ # Creates a payment link.
21
+ def self.create(params = {}, opts = {})
22
+ request_stripe_object(method: :post, path: "/v1/payment_links", params: params, opts: opts)
23
+ end
24
+
25
+ # Returns a list of your payment links.
26
+ def self.list(filters = {}, opts = {})
27
+ request_stripe_object(method: :get, path: "/v1/payment_links", params: filters, opts: opts)
28
+ end
29
+
20
30
  # 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.
21
31
  def list_line_items(params = {}, opts = {})
22
32
  request_stripe_object(
@@ -37,16 +47,6 @@ module Stripe
37
47
  )
38
48
  end
39
49
 
40
- # Creates a payment link.
41
- def self.create(params = {}, opts = {})
42
- request_stripe_object(method: :post, path: "/v1/payment_links", params: params, opts: opts)
43
- end
44
-
45
- # Returns a list of your payment links.
46
- def self.list(filters = {}, opts = {})
47
- request_stripe_object(method: :get, path: "/v1/payment_links", params: filters, opts: opts)
48
- end
49
-
50
50
  # Updates a payment link.
51
51
  def self.update(id, params = {}, opts = {})
52
52
  request_stripe_object(
@@ -39,16 +39,6 @@ module Stripe
39
39
  )
40
40
  end
41
41
 
42
- # 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.
43
- def detach(params = {}, opts = {})
44
- request_stripe_object(
45
- method: :post,
46
- path: format("/v1/payment_methods/%<payment_method>s/detach", { payment_method: CGI.escape(self["id"]) }),
47
- params: params,
48
- opts: opts
49
- )
50
- end
51
-
52
42
  # Attaches a PaymentMethod object to a Customer.
53
43
  #
54
44
  # To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents)
@@ -71,6 +61,23 @@ module Stripe
71
61
  )
72
62
  end
73
63
 
64
+ # Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js.
65
+ #
66
+ # Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the <a href="/docs/payments/save-and-reuse">SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment.
67
+ def self.create(params = {}, opts = {})
68
+ request_stripe_object(method: :post, path: "/v1/payment_methods", params: params, opts: opts)
69
+ end
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.
72
+ def detach(params = {}, opts = {})
73
+ request_stripe_object(
74
+ method: :post,
75
+ path: format("/v1/payment_methods/%<payment_method>s/detach", { payment_method: CGI.escape(self["id"]) }),
76
+ params: params,
77
+ opts: opts
78
+ )
79
+ end
80
+
74
81
  # 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.
75
82
  def self.detach(payment_method, params = {}, opts = {})
76
83
  request_stripe_object(
@@ -81,13 +88,6 @@ module Stripe
81
88
  )
82
89
  end
83
90
 
84
- # Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js.
85
- #
86
- # Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the <a href="/docs/payments/save-and-reuse">SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment.
87
- def self.create(params = {}, opts = {})
88
- request_stripe_object(method: :post, path: "/v1/payment_methods", params: params, opts: opts)
89
- end
90
-
91
91
  # Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead.
92
92
  def self.list(filters = {}, opts = {})
93
93
  request_stripe_object(method: :get, path: "/v1/payment_methods", params: filters, opts: opts)
@@ -16,61 +16,61 @@ module Stripe
16
16
  "payment_method_domain"
17
17
  end
18
18
 
19
- # 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.
20
- # The payment method doesn't appear in Elements for this domain until it is active.
21
- #
22
- # 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.
23
- #
24
- # Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
25
- def validate(params = {}, opts = {})
19
+ # Creates a payment method domain.
20
+ def self.create(params = {}, opts = {})
26
21
  request_stripe_object(
27
22
  method: :post,
28
- path: format("/v1/payment_method_domains/%<payment_method_domain>s/validate", { payment_method_domain: CGI.escape(self["id"]) }),
23
+ path: "/v1/payment_method_domains",
29
24
  params: params,
30
25
  opts: opts
31
26
  )
32
27
  end
33
28
 
34
- # 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.
35
- # The payment method doesn't appear in Elements for this domain until it is active.
36
- #
37
- # 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.
38
- #
39
- # Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
40
- def self.validate(payment_method_domain, params = {}, opts = {})
29
+ # Lists the details of existing payment method domains.
30
+ def self.list(filters = {}, opts = {})
41
31
  request_stripe_object(
42
- method: :post,
43
- path: format("/v1/payment_method_domains/%<payment_method_domain>s/validate", { payment_method_domain: CGI.escape(payment_method_domain) }),
44
- params: params,
32
+ method: :get,
33
+ path: "/v1/payment_method_domains",
34
+ params: filters,
45
35
  opts: opts
46
36
  )
47
37
  end
48
38
 
49
- # Creates a payment method domain.
50
- def self.create(params = {}, opts = {})
39
+ # Updates an existing payment method domain.
40
+ def self.update(id, params = {}, opts = {})
51
41
  request_stripe_object(
52
42
  method: :post,
53
- path: "/v1/payment_method_domains",
43
+ path: format("/v1/payment_method_domains/%<id>s", { id: CGI.escape(id) }),
54
44
  params: params,
55
45
  opts: opts
56
46
  )
57
47
  end
58
48
 
59
- # Lists the details of existing payment method domains.
60
- def self.list(filters = {}, opts = {})
49
+ # 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.
50
+ # The payment method doesn't appear in Elements for this domain until it is active.
51
+ #
52
+ # 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.
53
+ #
54
+ # Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
55
+ def validate(params = {}, opts = {})
61
56
  request_stripe_object(
62
- method: :get,
63
- path: "/v1/payment_method_domains",
64
- params: filters,
57
+ method: :post,
58
+ path: format("/v1/payment_method_domains/%<payment_method_domain>s/validate", { payment_method_domain: CGI.escape(self["id"]) }),
59
+ params: params,
65
60
  opts: opts
66
61
  )
67
62
  end
68
63
 
69
- # Updates an existing payment method domain.
70
- def self.update(id, params = {}, opts = {})
64
+ # 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.
65
+ # The payment method doesn't appear in Elements for this domain until it is active.
66
+ #
67
+ # 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.
68
+ #
69
+ # Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
70
+ def self.validate(payment_method_domain, params = {}, opts = {})
71
71
  request_stripe_object(
72
72
  method: :post,
73
- path: format("/v1/payment_method_domains/%<id>s", { id: CGI.escape(id) }),
73
+ path: format("/v1/payment_method_domains/%<payment_method_domain>s/validate", { payment_method_domain: CGI.escape(payment_method_domain) }),
74
74
  params: params,
75
75
  opts: opts
76
76
  )
@@ -30,23 +30,37 @@ module Stripe
30
30
  )
31
31
  end
32
32
 
33
- # 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 manual and in the pending status, use /v1/payouts/:id/cancel instead.
34
- #
35
- # 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.
36
- def reverse(params = {}, opts = {})
33
+ # You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts.
34
+ def self.cancel(payout, params = {}, opts = {})
37
35
  request_stripe_object(
38
36
  method: :post,
39
- path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(self["id"]) }),
37
+ path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(payout) }),
40
38
  params: params,
41
39
  opts: opts
42
40
  )
43
41
  end
44
42
 
45
- # You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts.
46
- def self.cancel(payout, params = {}, opts = {})
43
+ # To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error.
44
+ #
45
+ # If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode.
46
+ #
47
+ # If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type.
48
+ def self.create(params = {}, opts = {})
49
+ request_stripe_object(method: :post, path: "/v1/payouts", params: params, opts: opts)
50
+ end
51
+
52
+ # Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first.
53
+ def self.list(filters = {}, opts = {})
54
+ request_stripe_object(method: :get, path: "/v1/payouts", params: filters, opts: opts)
55
+ end
56
+
57
+ # 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 manual and in the pending status, use /v1/payouts/:id/cancel instead.
58
+ #
59
+ # 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.
60
+ def reverse(params = {}, opts = {})
47
61
  request_stripe_object(
48
62
  method: :post,
49
- path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(payout) }),
63
+ path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(self["id"]) }),
50
64
  params: params,
51
65
  opts: opts
52
66
  )
@@ -64,20 +78,6 @@ module Stripe
64
78
  )
65
79
  end
66
80
 
67
- # To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error.
68
- #
69
- # If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode.
70
- #
71
- # If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type.
72
- def self.create(params = {}, opts = {})
73
- request_stripe_object(method: :post, path: "/v1/payouts", params: params, opts: opts)
74
- end
75
-
76
- # Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first.
77
- def self.list(filters = {}, opts = {})
78
- request_stripe_object(method: :get, path: "/v1/payouts", params: filters, opts: opts)
79
- end
80
-
81
81
  # Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments.
82
82
  def self.update(id, params = {}, opts = {})
83
83
  request_stripe_object(