stripe 10.11.0 → 10.12.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 +10 -9
  3. data/OPENAPI_VERSION +1 -1
  4. data/VERSION +1 -1
  5. data/lib/stripe/object_types.rb +6 -5
  6. data/lib/stripe/resources/account.rb +70 -70
  7. data/lib/stripe/resources/apple_pay_domain.rb +4 -4
  8. data/lib/stripe/resources/apps/secret.rb +5 -5
  9. data/lib/stripe/resources/charge.rb +1 -1
  10. data/lib/stripe/resources/checkout/session.rb +21 -21
  11. data/lib/stripe/resources/credit_note.rb +35 -35
  12. data/lib/stripe/resources/customer.rb +58 -58
  13. data/lib/stripe/resources/ephemeral_key.rb +9 -9
  14. data/lib/stripe/resources/file.rb +5 -5
  15. data/lib/stripe/resources/financial_connections/account.rb +34 -34
  16. data/lib/stripe/resources/identity/verification_session.rb +38 -38
  17. data/lib/stripe/resources/invoice.rb +72 -72
  18. data/lib/stripe/resources/issuing/authorization.rb +32 -32
  19. data/lib/stripe/resources/issuing/card.rb +22 -22
  20. data/lib/stripe/resources/issuing/dispute.rb +16 -16
  21. data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
  22. data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
  23. data/lib/stripe/resources/payment_intent.rb +100 -100
  24. data/lib/stripe/resources/payment_link.rb +10 -10
  25. data/lib/stripe/resources/payment_method.rb +17 -17
  26. data/lib/stripe/resources/payment_method_domain.rb +29 -29
  27. data/lib/stripe/resources/payout.rb +22 -22
  28. data/lib/stripe/resources/quote.rb +51 -51
  29. data/lib/stripe/resources/setup_intent.rb +32 -32
  30. data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -4
  31. data/lib/stripe/resources/source.rb +18 -18
  32. data/lib/stripe/resources/subscription.rb +36 -36
  33. data/lib/stripe/resources/subscription_item.rb +1 -1
  34. data/lib/stripe/resources/subscription_schedule.rb +19 -19
  35. data/lib/stripe/resources/tax/calculation.rb +10 -10
  36. data/lib/stripe/resources/tax/settings.rb +0 -1
  37. data/lib/stripe/resources/tax/transaction.rb +10 -10
  38. data/lib/stripe/resources/terminal/reader.rb +46 -46
  39. data/lib/stripe/resources/transfer.rb +1 -1
  40. data/lib/stripe/resources/treasury/financial_account.rb +25 -25
  41. data/lib/stripe/resources/treasury/inbound_transfer.rb +14 -14
  42. data/lib/stripe/resources/treasury/outbound_payment.rb +14 -14
  43. data/lib/stripe/resources/treasury/outbound_transfer.rb +14 -14
  44. data/lib/stripe/resources/treasury/transaction_entry.rb +4 -4
  45. data/lib/stripe/resources.rb +2 -0
  46. data/lib/stripe/version.rb +1 -1
  47. metadata +4 -2
@@ -0,0 +1,26 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Issuing
6
+ # A Physical Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card.
7
+ class PhysicalBundle < APIResource
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "issuing.physical_bundle"
11
+ def self.object_name
12
+ "issuing.physical_bundle"
13
+ end
14
+
15
+ # Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
16
+ def self.list(filters = {}, opts = {})
17
+ request_stripe_object(
18
+ method: :get,
19
+ path: "/v1/issuing/physical_bundles",
20
+ params: filters,
21
+ opts: opts
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
@@ -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,20 @@ 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
+
208
179
  # Perform an incremental authorization on an eligible
209
180
  # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
210
181
  # PaymentIntent's status must be requires_capture and
@@ -229,39 +200,48 @@ module Stripe
229
200
  # After it's captured, a PaymentIntent can no longer be incremented.
230
201
  #
231
202
  # Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
232
- def self.increment_authorization(intent, params = {}, opts = {})
203
+ def increment_authorization(params = {}, opts = {})
233
204
  request_stripe_object(
234
205
  method: :post,
235
- path: format("/v1/payment_intents/%<intent>s/increment_authorization", { intent: CGI.escape(intent) }),
206
+ path: format("/v1/payment_intents/%<intent>s/increment_authorization", { intent: CGI.escape(self["id"]) }),
236
207
  params: params,
237
208
  opts: opts
238
209
  )
239
210
  end
240
211
 
241
- # Verifies microdeposits on a PaymentIntent object.
242
- def self.verify_microdeposits(intent, params = {}, opts = {})
212
+ # Perform an incremental authorization on an eligible
213
+ # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
214
+ # PaymentIntent's status must be requires_capture and
215
+ # [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported)
216
+ # must be true.
217
+ #
218
+ # Incremental authorizations attempt to increase the authorized amount on
219
+ # your customer's card to the new, higher amount provided. Similar to the
220
+ # initial authorization, incremental authorizations can be declined. A
221
+ # single PaymentIntent can call this endpoint multiple times to further
222
+ # increase the authorized amount.
223
+ #
224
+ # If the incremental authorization succeeds, the PaymentIntent object
225
+ # returns with the updated
226
+ # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
227
+ # If the incremental authorization fails, a
228
+ # [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
229
+ # fields on the PaymentIntent or Charge update. The PaymentIntent
230
+ # object remains capturable for the previously authorized amount.
231
+ #
232
+ # Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
233
+ # After it's captured, a PaymentIntent can no longer be incremented.
234
+ #
235
+ # Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
236
+ def self.increment_authorization(intent, params = {}, opts = {})
243
237
  request_stripe_object(
244
238
  method: :post,
245
- path: format("/v1/payment_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(intent) }),
239
+ path: format("/v1/payment_intents/%<intent>s/increment_authorization", { intent: CGI.escape(intent) }),
246
240
  params: params,
247
241
  opts: opts
248
242
  )
249
243
  end
250
244
 
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
245
  # Returns a list of PaymentIntents.
266
246
  def self.list(filters = {}, opts = {})
267
247
  request_stripe_object(method: :get, path: "/v1/payment_intents", params: filters, opts: opts)
@@ -295,5 +275,25 @@ module Stripe
295
275
  opts: opts
296
276
  )
297
277
  end
278
+
279
+ # Verifies microdeposits on a PaymentIntent object.
280
+ def verify_microdeposits(params = {}, opts = {})
281
+ request_stripe_object(
282
+ method: :post,
283
+ path: format("/v1/payment_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(self["id"]) }),
284
+ params: params,
285
+ opts: opts
286
+ )
287
+ end
288
+
289
+ # Verifies microdeposits on a PaymentIntent object.
290
+ def self.verify_microdeposits(intent, params = {}, opts = {})
291
+ request_stripe_object(
292
+ method: :post,
293
+ path: format("/v1/payment_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(intent) }),
294
+ params: params,
295
+ opts: opts
296
+ )
297
+ end
298
298
  end
299
299
  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(