stripe 10.4.0 → 10.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/OPENAPI_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/stripe/resources/account.rb +8 -0
- data/lib/stripe/resources/apps/secret.rb +2 -0
- data/lib/stripe/resources/charge.rb +10 -0
- data/lib/stripe/resources/checkout/session.rb +8 -0
- data/lib/stripe/resources/climate/order.rb +8 -0
- data/lib/stripe/resources/credit_note.rb +4 -0
- data/lib/stripe/resources/customer.rb +16 -0
- data/lib/stripe/resources/dispute.rb +6 -0
- data/lib/stripe/resources/financial_connections/account.rb +10 -0
- data/lib/stripe/resources/identity/verification_session.rb +44 -0
- data/lib/stripe/resources/invoice.rb +20 -0
- data/lib/stripe/resources/issuing/authorization.rb +17 -0
- data/lib/stripe/resources/issuing/card.rb +8 -0
- data/lib/stripe/resources/issuing/dispute.rb +2 -0
- data/lib/stripe/resources/issuing/transaction.rb +4 -0
- data/lib/stripe/resources/payment_intent.rb +118 -0
- data/lib/stripe/resources/payment_link.rb +2 -0
- data/lib/stripe/resources/payment_method.rb +28 -0
- data/lib/stripe/resources/payment_method_domain.rb +12 -0
- data/lib/stripe/resources/payout.rb +8 -0
- data/lib/stripe/resources/quote.rb +12 -0
- data/lib/stripe/resources/refund.rb +8 -0
- data/lib/stripe/resources/review.rb +2 -0
- data/lib/stripe/resources/setup_intent.rb +36 -0
- data/lib/stripe/resources/source.rb +2 -0
- data/lib/stripe/resources/subscription.rb +14 -0
- data/lib/stripe/resources/subscription_schedule.rb +4 -0
- data/lib/stripe/resources/tax/calculation.rb +2 -0
- data/lib/stripe/resources/tax/transaction.rb +4 -0
- data/lib/stripe/resources/terminal/reader.rb +12 -0
- data/lib/stripe/resources/test_helpers/test_clock.rb +2 -0
- data/lib/stripe/resources/topup.rb +2 -0
- data/lib/stripe/resources/treasury/financial_account.rb +4 -0
- data/lib/stripe/resources/treasury/inbound_transfer.rb +8 -0
- data/lib/stripe/resources/treasury/outbound_payment.rb +8 -0
- data/lib/stripe/resources/treasury/outbound_transfer.rb +8 -0
- data/lib/stripe/resources/treasury/received_credit.rb +1 -0
- data/lib/stripe/resources/treasury/received_debit.rb +1 -0
- data/lib/stripe/version.rb +1 -1
- metadata +2 -2
@@ -18,6 +18,7 @@ module Stripe
|
|
18
18
|
class TestHelpers < APIResourceTestHelpers
|
19
19
|
RESOURCE_CLASS = Card
|
20
20
|
|
21
|
+
# Updates the shipping status of the specified Issuing Card object to delivered.
|
21
22
|
def self.deliver_card(card, params = {}, opts = {})
|
22
23
|
request_stripe_object(
|
23
24
|
method: :post,
|
@@ -27,6 +28,7 @@ module Stripe
|
|
27
28
|
)
|
28
29
|
end
|
29
30
|
|
31
|
+
# Updates the shipping status of the specified Issuing Card object to failure.
|
30
32
|
def self.fail_card(card, params = {}, opts = {})
|
31
33
|
request_stripe_object(
|
32
34
|
method: :post,
|
@@ -36,6 +38,7 @@ module Stripe
|
|
36
38
|
)
|
37
39
|
end
|
38
40
|
|
41
|
+
# Updates the shipping status of the specified Issuing Card object to returned.
|
39
42
|
def self.return_card(card, params = {}, opts = {})
|
40
43
|
request_stripe_object(
|
41
44
|
method: :post,
|
@@ -45,6 +48,7 @@ module Stripe
|
|
45
48
|
)
|
46
49
|
end
|
47
50
|
|
51
|
+
# Updates the shipping status of the specified Issuing Card object to shipped.
|
48
52
|
def self.ship_card(card, params = {}, opts = {})
|
49
53
|
request_stripe_object(
|
50
54
|
method: :post,
|
@@ -54,6 +58,7 @@ module Stripe
|
|
54
58
|
)
|
55
59
|
end
|
56
60
|
|
61
|
+
# Updates the shipping status of the specified Issuing Card object to delivered.
|
57
62
|
def deliver_card(params = {}, opts = {})
|
58
63
|
@resource.request_stripe_object(
|
59
64
|
method: :post,
|
@@ -63,6 +68,7 @@ module Stripe
|
|
63
68
|
)
|
64
69
|
end
|
65
70
|
|
71
|
+
# Updates the shipping status of the specified Issuing Card object to failure.
|
66
72
|
def fail_card(params = {}, opts = {})
|
67
73
|
@resource.request_stripe_object(
|
68
74
|
method: :post,
|
@@ -72,6 +78,7 @@ module Stripe
|
|
72
78
|
)
|
73
79
|
end
|
74
80
|
|
81
|
+
# Updates the shipping status of the specified Issuing Card object to returned.
|
75
82
|
def return_card(params = {}, opts = {})
|
76
83
|
@resource.request_stripe_object(
|
77
84
|
method: :post,
|
@@ -81,6 +88,7 @@ module Stripe
|
|
81
88
|
)
|
82
89
|
end
|
83
90
|
|
91
|
+
# Updates the shipping status of the specified Issuing Card object to shipped.
|
84
92
|
def ship_card(params = {}, opts = {})
|
85
93
|
@resource.request_stripe_object(
|
86
94
|
method: :post,
|
@@ -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,
|
@@ -11,6 +11,7 @@ module Stripe
|
|
11
11
|
|
12
12
|
OBJECT_NAME = "quote"
|
13
13
|
|
14
|
+
# Accepts the specified quote.
|
14
15
|
def accept(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
|
+
# Cancels the quote.
|
23
25
|
def cancel(params = {}, opts = {})
|
24
26
|
request_stripe_object(
|
25
27
|
method: :post,
|
@@ -29,6 +31,7 @@ module Stripe
|
|
29
31
|
)
|
30
32
|
end
|
31
33
|
|
34
|
+
# Finalizes the quote.
|
32
35
|
def finalize_quote(params = {}, opts = {})
|
33
36
|
request_stripe_object(
|
34
37
|
method: :post,
|
@@ -38,6 +41,7 @@ module Stripe
|
|
38
41
|
)
|
39
42
|
end
|
40
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.
|
41
45
|
def list_computed_upfront_line_items(params = {}, opts = {})
|
42
46
|
request_stripe_object(
|
43
47
|
method: :get,
|
@@ -47,6 +51,7 @@ module Stripe
|
|
47
51
|
)
|
48
52
|
end
|
49
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.
|
50
55
|
def list_line_items(params = {}, opts = {})
|
51
56
|
request_stripe_object(
|
52
57
|
method: :get,
|
@@ -56,6 +61,7 @@ module Stripe
|
|
56
61
|
)
|
57
62
|
end
|
58
63
|
|
64
|
+
# Download the PDF for a finalized quote
|
59
65
|
def pdf(params = {}, opts = {}, &read_body_chunk_block)
|
60
66
|
config = opts[:client]&.config || Stripe.config
|
61
67
|
opts = { api_base: config.uploads_base }.merge(opts)
|
@@ -68,6 +74,7 @@ module Stripe
|
|
68
74
|
)
|
69
75
|
end
|
70
76
|
|
77
|
+
# Accepts the specified quote.
|
71
78
|
def self.accept(quote, params = {}, opts = {})
|
72
79
|
request_stripe_object(
|
73
80
|
method: :post,
|
@@ -77,6 +84,7 @@ module Stripe
|
|
77
84
|
)
|
78
85
|
end
|
79
86
|
|
87
|
+
# Cancels the quote.
|
80
88
|
def self.cancel(quote, params = {}, opts = {})
|
81
89
|
request_stripe_object(
|
82
90
|
method: :post,
|
@@ -86,6 +94,7 @@ module Stripe
|
|
86
94
|
)
|
87
95
|
end
|
88
96
|
|
97
|
+
# Finalizes the quote.
|
89
98
|
def self.finalize_quote(quote, params = {}, opts = {})
|
90
99
|
request_stripe_object(
|
91
100
|
method: :post,
|
@@ -95,6 +104,7 @@ module Stripe
|
|
95
104
|
)
|
96
105
|
end
|
97
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.
|
98
108
|
def self.list_computed_upfront_line_items(quote, params = {}, opts = {})
|
99
109
|
request_stripe_object(
|
100
110
|
method: :get,
|
@@ -104,6 +114,7 @@ module Stripe
|
|
104
114
|
)
|
105
115
|
end
|
106
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.
|
107
118
|
def self.list_line_items(quote, params = {}, opts = {})
|
108
119
|
request_stripe_object(
|
109
120
|
method: :get,
|
@@ -113,6 +124,7 @@ module Stripe
|
|
113
124
|
)
|
114
125
|
end
|
115
126
|
|
127
|
+
# Download the PDF for a finalized quote
|
116
128
|
def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
117
129
|
config = opts[:client]&.config || Stripe.config
|
118
130
|
opts = { api_base: config.uploads_base }.merge(opts)
|
@@ -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,
|
@@ -30,6 +30,9 @@ module Stripe
|
|
30
30
|
|
31
31
|
OBJECT_NAME = "setup_intent"
|
32
32
|
|
33
|
+
# You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
|
34
|
+
#
|
35
|
+
# After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
|
33
36
|
def cancel(params = {}, opts = {})
|
34
37
|
request_stripe_object(
|
35
38
|
method: :post,
|
@@ -39,6 +42,20 @@ module Stripe
|
|
39
42
|
)
|
40
43
|
end
|
41
44
|
|
45
|
+
# Confirm that your customer intends to set up the current or
|
46
|
+
# provided payment method. For example, you would confirm a SetupIntent
|
47
|
+
# when a customer hits the “Save” button on a payment method management
|
48
|
+
# page on your website.
|
49
|
+
#
|
50
|
+
# If the selected payment method does not require any additional
|
51
|
+
# steps from the customer, the SetupIntent will transition to the
|
52
|
+
# succeeded status.
|
53
|
+
#
|
54
|
+
# Otherwise, it will transition to the requires_action status and
|
55
|
+
# suggest additional actions via next_action. If setup fails,
|
56
|
+
# the SetupIntent will transition to the
|
57
|
+
# requires_payment_method status or the canceled status if the
|
58
|
+
# confirmation limit is reached.
|
42
59
|
def confirm(params = {}, opts = {})
|
43
60
|
request_stripe_object(
|
44
61
|
method: :post,
|
@@ -48,6 +65,7 @@ module Stripe
|
|
48
65
|
)
|
49
66
|
end
|
50
67
|
|
68
|
+
# Verifies microdeposits on a SetupIntent object.
|
51
69
|
def verify_microdeposits(params = {}, opts = {})
|
52
70
|
request_stripe_object(
|
53
71
|
method: :post,
|
@@ -57,6 +75,9 @@ module Stripe
|
|
57
75
|
)
|
58
76
|
end
|
59
77
|
|
78
|
+
# You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
|
79
|
+
#
|
80
|
+
# After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
|
60
81
|
def self.cancel(intent, params = {}, opts = {})
|
61
82
|
request_stripe_object(
|
62
83
|
method: :post,
|
@@ -66,6 +87,20 @@ module Stripe
|
|
66
87
|
)
|
67
88
|
end
|
68
89
|
|
90
|
+
# Confirm that your customer intends to set up the current or
|
91
|
+
# provided payment method. For example, you would confirm a SetupIntent
|
92
|
+
# when a customer hits the “Save” button on a payment method management
|
93
|
+
# page on your website.
|
94
|
+
#
|
95
|
+
# If the selected payment method does not require any additional
|
96
|
+
# steps from the customer, the SetupIntent will transition to the
|
97
|
+
# succeeded status.
|
98
|
+
#
|
99
|
+
# Otherwise, it will transition to the requires_action status and
|
100
|
+
# suggest additional actions via next_action. If setup fails,
|
101
|
+
# the SetupIntent will transition to the
|
102
|
+
# requires_payment_method status or the canceled status if the
|
103
|
+
# confirmation limit is reached.
|
69
104
|
def self.confirm(intent, params = {}, opts = {})
|
70
105
|
request_stripe_object(
|
71
106
|
method: :post,
|
@@ -75,6 +110,7 @@ module Stripe
|
|
75
110
|
)
|
76
111
|
end
|
77
112
|
|
113
|
+
# Verifies microdeposits on a SetupIntent object.
|
78
114
|
def self.verify_microdeposits(intent, params = {}, opts = {})
|
79
115
|
request_stripe_object(
|
80
116
|
method: :post,
|
@@ -21,6 +21,7 @@ module Stripe
|
|
21
21
|
|
22
22
|
nested_resource_class_methods :source_transaction, operations: %i[retrieve list]
|
23
23
|
|
24
|
+
# Verify a given source.
|
24
25
|
def verify(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
|
+
# Verify a given source.
|
33
35
|
def self.verify(source, params = {}, opts = {})
|
34
36
|
request_stripe_object(
|
35
37
|
method: :post,
|