stripe 10.5.0.pre.beta.1 → 10.6.0.pre.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -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/capital/financing_offer.rb +4 -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/gift_cards/card.rb +1 -0
- data/lib/stripe/resources/gift_cards/transaction.rb +4 -0
- data/lib/stripe/resources/identity/verification_session.rb +44 -0
- data/lib/stripe/resources/invoice.rb +38 -0
- data/lib/stripe/resources/issuing/authorization.rb +17 -0
- data/lib/stripe/resources/issuing/card.rb +8 -0
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +6 -0
- data/lib/stripe/resources/issuing/dispute.rb +2 -0
- data/lib/stripe/resources/issuing/personalization_design.rb +6 -0
- data/lib/stripe/resources/issuing/transaction.rb +4 -0
- data/lib/stripe/resources/order.rb +8 -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 +22 -0
- data/lib/stripe/resources/quote_phase.rb +2 -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 +6 -0
- data/lib/stripe/resources/tax/calculation.rb +2 -0
- data/lib/stripe/resources/tax/form.rb +2 -0
- data/lib/stripe/resources/tax/transaction.rb +4 -0
- data/lib/stripe/resources/terminal/reader.rb +18 -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
@@ -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,
|
@@ -15,6 +15,7 @@ module Stripe
|
|
15
15
|
nested_resource_class_methods :preview_invoice, operations: %i[list]
|
16
16
|
nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
|
17
17
|
|
18
|
+
# Accepts the specified quote.
|
18
19
|
def accept(params = {}, opts = {})
|
19
20
|
request_stripe_object(
|
20
21
|
method: :post,
|
@@ -24,6 +25,7 @@ module Stripe
|
|
24
25
|
)
|
25
26
|
end
|
26
27
|
|
28
|
+
# Cancels the quote.
|
27
29
|
def cancel(params = {}, opts = {})
|
28
30
|
request_stripe_object(
|
29
31
|
method: :post,
|
@@ -33,6 +35,7 @@ module Stripe
|
|
33
35
|
)
|
34
36
|
end
|
35
37
|
|
38
|
+
# Finalizes the quote.
|
36
39
|
def finalize_quote(params = {}, opts = {})
|
37
40
|
request_stripe_object(
|
38
41
|
method: :post,
|
@@ -42,6 +45,7 @@ module Stripe
|
|
42
45
|
)
|
43
46
|
end
|
44
47
|
|
48
|
+
# When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
|
45
49
|
def list_computed_upfront_line_items(params = {}, opts = {})
|
46
50
|
request_stripe_object(
|
47
51
|
method: :get,
|
@@ -51,6 +55,7 @@ module Stripe
|
|
51
55
|
)
|
52
56
|
end
|
53
57
|
|
58
|
+
# When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
|
54
59
|
def list_line_items(params = {}, opts = {})
|
55
60
|
request_stripe_object(
|
56
61
|
method: :get,
|
@@ -60,6 +65,7 @@ module Stripe
|
|
60
65
|
)
|
61
66
|
end
|
62
67
|
|
68
|
+
# Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
|
63
69
|
def list_lines(params = {}, opts = {})
|
64
70
|
request_stripe_object(
|
65
71
|
method: :get,
|
@@ -69,6 +75,7 @@ module Stripe
|
|
69
75
|
)
|
70
76
|
end
|
71
77
|
|
78
|
+
# Preview the invoice line items that would be generated by accepting the quote.
|
72
79
|
def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
|
73
80
|
request_stripe_object(
|
74
81
|
method: :get,
|
@@ -78,6 +85,7 @@ module Stripe
|
|
78
85
|
)
|
79
86
|
end
|
80
87
|
|
88
|
+
# Converts a stale quote to draft.
|
81
89
|
def mark_draft(params = {}, opts = {})
|
82
90
|
request_stripe_object(
|
83
91
|
method: :post,
|
@@ -87,6 +95,7 @@ module Stripe
|
|
87
95
|
)
|
88
96
|
end
|
89
97
|
|
98
|
+
# Converts a draft or open quote to stale.
|
90
99
|
def mark_stale(params = {}, opts = {})
|
91
100
|
request_stripe_object(
|
92
101
|
method: :post,
|
@@ -96,6 +105,7 @@ module Stripe
|
|
96
105
|
)
|
97
106
|
end
|
98
107
|
|
108
|
+
# Download the PDF for a finalized quote
|
99
109
|
def pdf(params = {}, opts = {}, &read_body_chunk_block)
|
100
110
|
config = opts[:client]&.config || Stripe.config
|
101
111
|
opts = { api_base: config.uploads_base }.merge(opts)
|
@@ -108,6 +118,7 @@ module Stripe
|
|
108
118
|
)
|
109
119
|
end
|
110
120
|
|
121
|
+
# Recompute the upcoming invoice estimate for the quote.
|
111
122
|
def reestimate(params = {}, opts = {})
|
112
123
|
request_stripe_object(
|
113
124
|
method: :post,
|
@@ -117,6 +128,7 @@ module Stripe
|
|
117
128
|
)
|
118
129
|
end
|
119
130
|
|
131
|
+
# Accepts the specified quote.
|
120
132
|
def self.accept(quote, params = {}, opts = {})
|
121
133
|
request_stripe_object(
|
122
134
|
method: :post,
|
@@ -126,6 +138,7 @@ module Stripe
|
|
126
138
|
)
|
127
139
|
end
|
128
140
|
|
141
|
+
# Cancels the quote.
|
129
142
|
def self.cancel(quote, params = {}, opts = {})
|
130
143
|
request_stripe_object(
|
131
144
|
method: :post,
|
@@ -135,6 +148,7 @@ module Stripe
|
|
135
148
|
)
|
136
149
|
end
|
137
150
|
|
151
|
+
# Finalizes the quote.
|
138
152
|
def self.finalize_quote(quote, params = {}, opts = {})
|
139
153
|
request_stripe_object(
|
140
154
|
method: :post,
|
@@ -144,6 +158,7 @@ module Stripe
|
|
144
158
|
)
|
145
159
|
end
|
146
160
|
|
161
|
+
# When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
|
147
162
|
def self.list_computed_upfront_line_items(quote, params = {}, opts = {})
|
148
163
|
request_stripe_object(
|
149
164
|
method: :get,
|
@@ -153,6 +168,7 @@ module Stripe
|
|
153
168
|
)
|
154
169
|
end
|
155
170
|
|
171
|
+
# When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
|
156
172
|
def self.list_line_items(quote, params = {}, opts = {})
|
157
173
|
request_stripe_object(
|
158
174
|
method: :get,
|
@@ -162,6 +178,7 @@ module Stripe
|
|
162
178
|
)
|
163
179
|
end
|
164
180
|
|
181
|
+
# Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
|
165
182
|
def self.list_lines(quote, params = {}, opts = {})
|
166
183
|
request_stripe_object(
|
167
184
|
method: :get,
|
@@ -171,6 +188,7 @@ module Stripe
|
|
171
188
|
)
|
172
189
|
end
|
173
190
|
|
191
|
+
# Preview the invoice line items that would be generated by accepting the quote.
|
174
192
|
def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
|
175
193
|
request_stripe_object(
|
176
194
|
method: :get,
|
@@ -180,6 +198,7 @@ module Stripe
|
|
180
198
|
)
|
181
199
|
end
|
182
200
|
|
201
|
+
# Converts a stale quote to draft.
|
183
202
|
def self.mark_draft(quote, params = {}, opts = {})
|
184
203
|
request_stripe_object(
|
185
204
|
method: :post,
|
@@ -189,6 +208,7 @@ module Stripe
|
|
189
208
|
)
|
190
209
|
end
|
191
210
|
|
211
|
+
# Converts a draft or open quote to stale.
|
192
212
|
def self.mark_stale(quote, params = {}, opts = {})
|
193
213
|
request_stripe_object(
|
194
214
|
method: :post,
|
@@ -198,6 +218,7 @@ module Stripe
|
|
198
218
|
)
|
199
219
|
end
|
200
220
|
|
221
|
+
# Download the PDF for a finalized quote
|
201
222
|
def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
202
223
|
config = opts[:client]&.config || Stripe.config
|
203
224
|
opts = { api_base: config.uploads_base }.merge(opts)
|
@@ -210,6 +231,7 @@ module Stripe
|
|
210
231
|
)
|
211
232
|
end
|
212
233
|
|
234
|
+
# Recompute the upcoming invoice estimate for the quote.
|
213
235
|
def self.reestimate(quote, params = {}, opts = {})
|
214
236
|
request_stripe_object(
|
215
237
|
method: :post,
|
@@ -8,6 +8,7 @@ module Stripe
|
|
8
8
|
|
9
9
|
OBJECT_NAME = "quote_phase"
|
10
10
|
|
11
|
+
# When retrieving a quote phase, 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.
|
11
12
|
def list_line_items(params = {}, opts = {})
|
12
13
|
request_stripe_object(
|
13
14
|
method: :get,
|
@@ -17,6 +18,7 @@ module Stripe
|
|
17
18
|
)
|
18
19
|
end
|
19
20
|
|
21
|
+
# When retrieving a quote phase, 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.
|
20
22
|
def self.list_line_items(quote_phase, params = {}, opts = {})
|
21
23
|
request_stripe_object(
|
22
24
|
method: :get,
|
@@ -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,
|
@@ -13,6 +13,11 @@ module Stripe
|
|
13
13
|
|
14
14
|
OBJECT_NAME = "subscription"
|
15
15
|
|
16
|
+
# Cancels a customer's subscription immediately. The customer will not be charged again for the subscription.
|
17
|
+
#
|
18
|
+
# Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
|
19
|
+
#
|
20
|
+
# By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
|
16
21
|
def cancel(params = {}, opts = {})
|
17
22
|
request_stripe_object(
|
18
23
|
method: :delete,
|
@@ -22,6 +27,7 @@ module Stripe
|
|
22
27
|
)
|
23
28
|
end
|
24
29
|
|
30
|
+
# Removes the currently applied discount on a subscription.
|
25
31
|
def delete_discount(params = {}, opts = {})
|
26
32
|
request_stripe_object(
|
27
33
|
method: :delete,
|
@@ -31,6 +37,7 @@ module Stripe
|
|
31
37
|
)
|
32
38
|
end
|
33
39
|
|
40
|
+
# Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
|
34
41
|
def resume(params = {}, opts = {})
|
35
42
|
request_stripe_object(
|
36
43
|
method: :post,
|
@@ -40,6 +47,11 @@ module Stripe
|
|
40
47
|
)
|
41
48
|
end
|
42
49
|
|
50
|
+
# Cancels a customer's subscription immediately. The customer will not be charged again for the subscription.
|
51
|
+
#
|
52
|
+
# Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
|
53
|
+
#
|
54
|
+
# By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
|
43
55
|
def self.cancel(subscription_exposed_id, params = {}, opts = {})
|
44
56
|
request_stripe_object(
|
45
57
|
method: :delete,
|
@@ -49,6 +61,7 @@ module Stripe
|
|
49
61
|
)
|
50
62
|
end
|
51
63
|
|
64
|
+
# Removes the currently applied discount on a subscription.
|
52
65
|
def self.delete_discount(subscription_exposed_id, params = {}, opts = {})
|
53
66
|
request_stripe_object(
|
54
67
|
method: :delete,
|
@@ -58,6 +71,7 @@ module Stripe
|
|
58
71
|
)
|
59
72
|
end
|
60
73
|
|
74
|
+
# Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
|
61
75
|
def self.resume(subscription, params = {}, opts = {})
|
62
76
|
request_stripe_object(
|
63
77
|
method: :post,
|
@@ -12,6 +12,7 @@ module Stripe
|
|
12
12
|
|
13
13
|
OBJECT_NAME = "subscription_schedule"
|
14
14
|
|
15
|
+
# Amends an existing subscription schedule.
|
15
16
|
def amend(params = {}, opts = {})
|
16
17
|
request_stripe_object(
|
17
18
|
method: :post,
|
@@ -21,6 +22,7 @@ module Stripe
|
|
21
22
|
)
|
22
23
|
end
|
23
24
|
|
25
|
+
# Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
|
24
26
|
def cancel(params = {}, opts = {})
|
25
27
|
request_stripe_object(
|
26
28
|
method: :post,
|
@@ -30,6 +32,7 @@ module Stripe
|
|
30
32
|
)
|
31
33
|
end
|
32
34
|
|
35
|
+
# Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
|
33
36
|
def release(params = {}, opts = {})
|
34
37
|
request_stripe_object(
|
35
38
|
method: :post,
|
@@ -39,6 +42,7 @@ module Stripe
|
|
39
42
|
)
|
40
43
|
end
|
41
44
|
|
45
|
+
# Amends an existing subscription schedule.
|
42
46
|
def self.amend(schedule, params = {}, opts = {})
|
43
47
|
request_stripe_object(
|
44
48
|
method: :post,
|
@@ -48,6 +52,7 @@ module Stripe
|
|
48
52
|
)
|
49
53
|
end
|
50
54
|
|
55
|
+
# Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
|
51
56
|
def self.cancel(schedule, params = {}, opts = {})
|
52
57
|
request_stripe_object(
|
53
58
|
method: :post,
|
@@ -57,6 +62,7 @@ module Stripe
|
|
57
62
|
)
|
58
63
|
end
|
59
64
|
|
65
|
+
# Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
|
60
66
|
def self.release(schedule, params = {}, opts = {})
|
61
67
|
request_stripe_object(
|
62
68
|
method: :post,
|
@@ -11,6 +11,7 @@ module Stripe
|
|
11
11
|
|
12
12
|
OBJECT_NAME = "tax.calculation"
|
13
13
|
|
14
|
+
# Retrieves the line items of a persisted tax calculation as a collection.
|
14
15
|
def list_line_items(params = {}, opts = {})
|
15
16
|
request_stripe_object(
|
16
17
|
method: :get,
|
@@ -20,6 +21,7 @@ module Stripe
|
|
20
21
|
)
|
21
22
|
end
|
22
23
|
|
24
|
+
# Retrieves the line items of a persisted tax calculation as a collection.
|
23
25
|
def self.list_line_items(calculation, params = {}, opts = {})
|
24
26
|
request_stripe_object(
|
25
27
|
method: :get,
|
@@ -11,6 +11,7 @@ module Stripe
|
|
11
11
|
|
12
12
|
OBJECT_NAME = "tax.form"
|
13
13
|
|
14
|
+
# Download the PDF for a tax form.
|
14
15
|
def pdf(params = {}, opts = {}, &read_body_chunk_block)
|
15
16
|
config = opts[:client]&.config || Stripe.config
|
16
17
|
opts = { api_base: config.uploads_base }.merge(opts)
|
@@ -23,6 +24,7 @@ module Stripe
|
|
23
24
|
)
|
24
25
|
end
|
25
26
|
|
27
|
+
# Download the PDF for a tax form.
|
26
28
|
def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block)
|
27
29
|
config = opts[:client]&.config || Stripe.config
|
28
30
|
opts = { api_base: config.uploads_base }.merge(opts)
|
@@ -9,6 +9,7 @@ module Stripe
|
|
9
9
|
class Transaction < APIResource
|
10
10
|
OBJECT_NAME = "tax.transaction"
|
11
11
|
|
12
|
+
# Retrieves the line items of a committed standalone transaction as a collection.
|
12
13
|
def list_line_items(params = {}, opts = {})
|
13
14
|
request_stripe_object(
|
14
15
|
method: :get,
|
@@ -18,6 +19,7 @@ module Stripe
|
|
18
19
|
)
|
19
20
|
end
|
20
21
|
|
22
|
+
# Creates a Tax Transaction from a calculation.
|
21
23
|
def self.create_from_calculation(params = {}, opts = {})
|
22
24
|
request_stripe_object(
|
23
25
|
method: :post,
|
@@ -27,6 +29,7 @@ module Stripe
|
|
27
29
|
)
|
28
30
|
end
|
29
31
|
|
32
|
+
# Partially or fully reverses a previously created Transaction.
|
30
33
|
def self.create_reversal(params = {}, opts = {})
|
31
34
|
request_stripe_object(
|
32
35
|
method: :post,
|
@@ -36,6 +39,7 @@ module Stripe
|
|
36
39
|
)
|
37
40
|
end
|
38
41
|
|
42
|
+
# Retrieves the line items of a committed standalone transaction as a collection.
|
39
43
|
def self.list_line_items(transaction, params = {}, opts = {})
|
40
44
|
request_stripe_object(
|
41
45
|
method: :get,
|
@@ -14,6 +14,7 @@ module Stripe
|
|
14
14
|
|
15
15
|
OBJECT_NAME = "terminal.reader"
|
16
16
|
|
17
|
+
# Cancels the current reader action.
|
17
18
|
def cancel_action(params = {}, opts = {})
|
18
19
|
request_stripe_object(
|
19
20
|
method: :post,
|
@@ -23,6 +24,7 @@ module Stripe
|
|
23
24
|
)
|
24
25
|
end
|
25
26
|
|
27
|
+
# Initiates an input collection flow on a Reader.
|
26
28
|
def collect_inputs(params = {}, opts = {})
|
27
29
|
request_stripe_object(
|
28
30
|
method: :post,
|
@@ -32,6 +34,7 @@ module Stripe
|
|
32
34
|
)
|
33
35
|
end
|
34
36
|
|
37
|
+
# Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
|
35
38
|
def collect_payment_method(params = {}, opts = {})
|
36
39
|
request_stripe_object(
|
37
40
|
method: :post,
|
@@ -41,6 +44,7 @@ module Stripe
|
|
41
44
|
)
|
42
45
|
end
|
43
46
|
|
47
|
+
# Finalizes a payment on a Reader.
|
44
48
|
def confirm_payment_intent(params = {}, opts = {})
|
45
49
|
request_stripe_object(
|
46
50
|
method: :post,
|
@@ -50,6 +54,7 @@ module Stripe
|
|
50
54
|
)
|
51
55
|
end
|
52
56
|
|
57
|
+
# Initiates a payment flow on a Reader.
|
53
58
|
def process_payment_intent(params = {}, opts = {})
|
54
59
|
request_stripe_object(
|
55
60
|
method: :post,
|
@@ -59,6 +64,7 @@ module Stripe
|
|
59
64
|
)
|
60
65
|
end
|
61
66
|
|
67
|
+
# Initiates a setup intent flow on a Reader.
|
62
68
|
def process_setup_intent(params = {}, opts = {})
|
63
69
|
request_stripe_object(
|
64
70
|
method: :post,
|
@@ -68,6 +74,7 @@ module Stripe
|
|
68
74
|
)
|
69
75
|
end
|
70
76
|
|
77
|
+
# Initiates a refund on a Reader
|
71
78
|
def refund_payment(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
|
+
# Sets reader display to show cart details.
|
80
88
|
def set_reader_display(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
|
+
# Cancels the current reader action.
|
89
98
|
def self.cancel_action(reader, 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
|
+
# Initiates an input collection flow on a Reader.
|
98
108
|
def self.collect_inputs(reader, params = {}, opts = {})
|
99
109
|
request_stripe_object(
|
100
110
|
method: :post,
|
@@ -104,6 +114,7 @@ module Stripe
|
|
104
114
|
)
|
105
115
|
end
|
106
116
|
|
117
|
+
# Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
|
107
118
|
def self.collect_payment_method(reader, params = {}, opts = {})
|
108
119
|
request_stripe_object(
|
109
120
|
method: :post,
|
@@ -113,6 +124,7 @@ module Stripe
|
|
113
124
|
)
|
114
125
|
end
|
115
126
|
|
127
|
+
# Finalizes a payment on a Reader.
|
116
128
|
def self.confirm_payment_intent(reader, params = {}, opts = {})
|
117
129
|
request_stripe_object(
|
118
130
|
method: :post,
|
@@ -122,6 +134,7 @@ module Stripe
|
|
122
134
|
)
|
123
135
|
end
|
124
136
|
|
137
|
+
# Initiates a payment flow on a Reader.
|
125
138
|
def self.process_payment_intent(reader, params = {}, opts = {})
|
126
139
|
request_stripe_object(
|
127
140
|
method: :post,
|
@@ -131,6 +144,7 @@ module Stripe
|
|
131
144
|
)
|
132
145
|
end
|
133
146
|
|
147
|
+
# Initiates a setup intent flow on a Reader.
|
134
148
|
def self.process_setup_intent(reader, params = {}, opts = {})
|
135
149
|
request_stripe_object(
|
136
150
|
method: :post,
|
@@ -140,6 +154,7 @@ module Stripe
|
|
140
154
|
)
|
141
155
|
end
|
142
156
|
|
157
|
+
# Initiates a refund on a Reader
|
143
158
|
def self.refund_payment(reader, params = {}, opts = {})
|
144
159
|
request_stripe_object(
|
145
160
|
method: :post,
|
@@ -149,6 +164,7 @@ module Stripe
|
|
149
164
|
)
|
150
165
|
end
|
151
166
|
|
167
|
+
# Sets reader display to show cart details.
|
152
168
|
def self.set_reader_display(reader, params = {}, opts = {})
|
153
169
|
request_stripe_object(
|
154
170
|
method: :post,
|
@@ -165,6 +181,7 @@ module Stripe
|
|
165
181
|
class TestHelpers < APIResourceTestHelpers
|
166
182
|
RESOURCE_CLASS = Reader
|
167
183
|
|
184
|
+
# Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
|
168
185
|
def self.present_payment_method(reader, params = {}, opts = {})
|
169
186
|
request_stripe_object(
|
170
187
|
method: :post,
|
@@ -174,6 +191,7 @@ module Stripe
|
|
174
191
|
)
|
175
192
|
end
|
176
193
|
|
194
|
+
# Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
|
177
195
|
def present_payment_method(params = {}, opts = {})
|
178
196
|
@resource.request_stripe_object(
|
179
197
|
method: :post,
|
@@ -13,6 +13,7 @@ module Stripe
|
|
13
13
|
|
14
14
|
OBJECT_NAME = "test_helpers.test_clock"
|
15
15
|
|
16
|
+
# Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready.
|
16
17
|
def advance(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
|
+
# Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready.
|
25
27
|
def self.advance(test_clock, params = {}, opts = {})
|
26
28
|
request_stripe_object(
|
27
29
|
method: :post,
|