stripe 10.11.0.pre.beta.1 → 10.12.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 +15 -1
- data/Gemfile +1 -1
- data/OPENAPI_VERSION +1 -1
- data/README.md +2 -3
- data/VERSION +1 -1
- data/lib/stripe/object_types.rb +0 -1
- data/lib/stripe/resources/account.rb +69 -69
- data/lib/stripe/resources/apple_pay_domain.rb +4 -4
- data/lib/stripe/resources/apps/secret.rb +5 -5
- data/lib/stripe/resources/capital/financing_offer.rb +10 -10
- data/lib/stripe/resources/charge.rb +3 -0
- data/lib/stripe/resources/checkout/session.rb +21 -21
- data/lib/stripe/resources/credit_note.rb +35 -35
- data/lib/stripe/resources/customer.rb +63 -63
- data/lib/stripe/resources/ephemeral_key.rb +9 -9
- data/lib/stripe/resources/file.rb +5 -5
- data/lib/stripe/resources/financial_connections/account.rb +34 -34
- data/lib/stripe/resources/gift_cards/card.rb +10 -10
- data/lib/stripe/resources/gift_cards/transaction.rb +6 -6
- data/lib/stripe/resources/identity/verification_session.rb +38 -38
- data/lib/stripe/resources/invoice.rb +90 -90
- data/lib/stripe/resources/issuing/authorization.rb +8 -8
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +17 -17
- data/lib/stripe/resources/issuing/dispute.rb +16 -16
- data/lib/stripe/resources/order.rb +32 -32
- data/lib/stripe/resources/payment_intent.rb +125 -125
- data/lib/stripe/resources/payment_link.rb +10 -10
- data/lib/stripe/resources/payment_method.rb +17 -17
- data/lib/stripe/resources/payment_method_domain.rb +29 -29
- data/lib/stripe/resources/payout.rb +22 -22
- data/lib/stripe/resources/quote.rb +89 -89
- data/lib/stripe/resources/quote_phase.rb +5 -5
- data/lib/stripe/resources/refund.rb +5 -9
- data/lib/stripe/resources/setup_intent.rb +32 -32
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -4
- data/lib/stripe/resources/source.rb +17 -17
- data/lib/stripe/resources/subscription.rb +36 -36
- data/lib/stripe/resources/subscription_schedule.rb +25 -25
- data/lib/stripe/resources/tax/calculation.rb +10 -10
- data/lib/stripe/resources/tax/form.rb +5 -5
- data/lib/stripe/resources/tax/transaction.rb +10 -10
- data/lib/stripe/resources/terminal/reader.rb +63 -63
- data/lib/stripe/resources/treasury/financial_account.rb +25 -25
- data/lib/stripe/resources/treasury/transaction_entry.rb +4 -4
- data/lib/stripe/resources.rb +0 -1
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +8 -0
- metadata +2 -3
- data/lib/stripe/resources/entitlements/event.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c161ad9743ceceb2624b6df2f851bb5c58ce3a7dd25c00e0406a41ee307af98d
|
4
|
+
data.tar.gz: d1fea5ff8da6ad1baa4a0e8256d869cf7104ef75175ab14ff3e08b887b695b84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8557c142f12cb1dcedba2fc486966ba9bbfb73fb4dfd2bea71490c906484bdd1972d982aefe41f00a0e28f2d9220d7de5cc7bbbf4a575ab1d807bd33408a7fe7
|
7
|
+
data.tar.gz: 9be2fb4c050e44b88a888bd835840ae84371527e5feb56f7d7883e4e0064271f4821b5a2f0ecdf7d6213efaf7aca6fd9ccdb96a209ea32ddaa7ba12fbf9d878a
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,23 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 10.12.0-beta.1 - 2024-02-29
|
4
|
+
* [#1352](https://github.com/stripe/stripe-ruby/pull/1352) Update generated code for beta
|
5
|
+
Release specs are identical.
|
6
|
+
* [#1350](https://github.com/stripe/stripe-ruby/pull/1350) Update generated code for beta
|
7
|
+
|
8
|
+
* [#1341](https://github.com/stripe/stripe-ruby/pull/1341) Update generated code for beta
|
9
|
+
* Remove support for resource `Entitlements.Event`
|
10
|
+
* [#1343](https://github.com/stripe/stripe-ruby/pull/1343) Add a helper to add a beta version
|
11
|
+
|
12
|
+
## 10.11.0 - 2024-02-29
|
13
|
+
* [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static
|
14
|
+
* [#1342](https://github.com/stripe/stripe-ruby/pull/1342) Update generated code
|
15
|
+
* Add `list_refunds` and `retrieve_refund` methods on resource `Charge`.
|
16
|
+
* [#1345](https://github.com/stripe/stripe-ruby/pull/1345) Update README to use add_beta_version
|
17
|
+
|
3
18
|
## 10.11.0-beta.1 - 2024-02-22
|
4
19
|
* [#1335](https://github.com/stripe/stripe-ruby/pull/1335) Update generated code for beta
|
5
20
|
|
6
|
-
|
7
21
|
## 10.10.0 - 2024-02-22
|
8
22
|
* [#1336](https://github.com/stripe/stripe-ruby/pull/1336) Update generated code
|
9
23
|
- Add `InvoiceLineItem.update` method.
|
data/Gemfile
CHANGED
data/OPENAPI_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
v857
|
data/README.md
CHANGED
@@ -23,7 +23,6 @@ See the [Ruby API docs](https://stripe.com/docs/api?lang=ruby).
|
|
23
23
|
|
24
24
|
See [video demonstrations][youtube-playlist] covering how to use the library.
|
25
25
|
|
26
|
-
|
27
26
|
## Installation
|
28
27
|
|
29
28
|
You don't need this source code unless you want to modify the gem. If you just
|
@@ -336,10 +335,10 @@ gem install stripe -v 7.1.0.pre.beta.2
|
|
336
335
|
|
337
336
|
We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version.
|
338
337
|
|
339
|
-
If your beta feature requires a `Stripe-Version` header to be sent,
|
338
|
+
If your beta feature requires a `Stripe-Version` header to be sent, set the `Stripe.api_version` field using `Stripe.add_beta_version`:
|
340
339
|
|
341
340
|
```python
|
342
|
-
Stripe.
|
341
|
+
Stripe.add_beta_version("feature_beta", "v3")
|
343
342
|
```
|
344
343
|
|
345
344
|
### Custom requests
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
10.
|
1
|
+
10.12.0-beta.1
|
data/lib/stripe/object_types.rb
CHANGED
@@ -51,7 +51,6 @@ module Stripe
|
|
51
51
|
CustomerSession.object_name => CustomerSession,
|
52
52
|
Discount.object_name => Discount,
|
53
53
|
Dispute.object_name => Dispute,
|
54
|
-
Entitlements::Event.object_name => Entitlements::Event,
|
55
54
|
Entitlements::Feature.object_name => Entitlements::Feature,
|
56
55
|
EphemeralKey.object_name => EphemeralKey,
|
57
56
|
Event.object_name => Event,
|
@@ -29,6 +29,49 @@ module Stripe
|
|
29
29
|
nested_resource_class_methods :login_link, operations: %i[create]
|
30
30
|
nested_resource_class_methods :person, operations: %i[create retrieve update delete list]
|
31
31
|
|
32
|
+
# With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
|
33
|
+
# To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
|
34
|
+
#
|
35
|
+
# If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
|
36
|
+
# creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
|
37
|
+
# You can prefill any information on the account.
|
38
|
+
def self.create(params = {}, opts = {})
|
39
|
+
request_stripe_object(method: :post, path: "/v1/accounts", params: params, opts: opts)
|
40
|
+
end
|
41
|
+
|
42
|
+
# With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
|
43
|
+
#
|
44
|
+
# Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
|
45
|
+
#
|
46
|
+
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
47
|
+
def self.delete(id, params = {}, opts = {})
|
48
|
+
request_stripe_object(
|
49
|
+
method: :delete,
|
50
|
+
path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
|
51
|
+
params: params,
|
52
|
+
opts: opts
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
# With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
|
57
|
+
#
|
58
|
+
# Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
|
59
|
+
#
|
60
|
+
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
61
|
+
def delete(params = {}, opts = {})
|
62
|
+
request_stripe_object(
|
63
|
+
method: :delete,
|
64
|
+
path: format("/v1/accounts/%<account>s", { account: CGI.escape(self["id"]) }),
|
65
|
+
params: params,
|
66
|
+
opts: opts
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
|
71
|
+
def self.list(filters = {}, opts = {})
|
72
|
+
request_stripe_object(method: :get, path: "/v1/accounts", params: filters, opts: opts)
|
73
|
+
end
|
74
|
+
|
32
75
|
# Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
|
33
76
|
def persons(params = {}, opts = {})
|
34
77
|
request_stripe_object(
|
@@ -39,6 +82,16 @@ module Stripe
|
|
39
82
|
)
|
40
83
|
end
|
41
84
|
|
85
|
+
# Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
|
86
|
+
def self.persons(account, params = {}, opts = {})
|
87
|
+
request_stripe_object(
|
88
|
+
method: :get,
|
89
|
+
path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(account) }),
|
90
|
+
params: params,
|
91
|
+
opts: opts
|
92
|
+
)
|
93
|
+
end
|
94
|
+
|
42
95
|
# With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
|
43
96
|
#
|
44
97
|
# Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
|
@@ -51,23 +104,31 @@ module Stripe
|
|
51
104
|
)
|
52
105
|
end
|
53
106
|
|
54
|
-
#
|
55
|
-
|
107
|
+
# With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
|
108
|
+
#
|
109
|
+
# Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
|
110
|
+
def self.reject(account, params = {}, opts = {})
|
56
111
|
request_stripe_object(
|
57
|
-
method: :
|
58
|
-
path: format("/v1/accounts/%<account>s/
|
112
|
+
method: :post,
|
113
|
+
path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(account) }),
|
59
114
|
params: params,
|
60
115
|
opts: opts
|
61
116
|
)
|
62
117
|
end
|
63
118
|
|
64
|
-
#
|
119
|
+
# Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
|
120
|
+
# left unchanged.
|
65
121
|
#
|
66
|
-
#
|
67
|
-
|
122
|
+
# For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that
|
123
|
+
# account has started to go through Connect Onboarding. Once you create an [Account Link or <a href="/docs/api/account_sessions">Account Session](https://stripe.com/docs/api/account_links),
|
124
|
+
# some properties can only be changed or updated for Custom accounts.
|
125
|
+
#
|
126
|
+
# To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
|
127
|
+
# [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
|
128
|
+
def self.update(id, params = {}, opts = {})
|
68
129
|
request_stripe_object(
|
69
130
|
method: :post,
|
70
|
-
path: format("/v1/accounts/%<
|
131
|
+
path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
|
71
132
|
params: params,
|
72
133
|
opts: opts
|
73
134
|
)
|
@@ -196,66 +257,5 @@ module Stripe
|
|
196
257
|
end
|
197
258
|
update_hash
|
198
259
|
end
|
199
|
-
|
200
|
-
# With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
|
201
|
-
# To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
|
202
|
-
#
|
203
|
-
# If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
|
204
|
-
# creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
|
205
|
-
# You can prefill any information on the account.
|
206
|
-
def self.create(params = {}, opts = {})
|
207
|
-
request_stripe_object(method: :post, path: "/v1/accounts", params: params, opts: opts)
|
208
|
-
end
|
209
|
-
|
210
|
-
# With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
|
211
|
-
#
|
212
|
-
# Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
|
213
|
-
#
|
214
|
-
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
215
|
-
def self.delete(id, params = {}, opts = {})
|
216
|
-
request_stripe_object(
|
217
|
-
method: :delete,
|
218
|
-
path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
|
219
|
-
params: params,
|
220
|
-
opts: opts
|
221
|
-
)
|
222
|
-
end
|
223
|
-
|
224
|
-
# With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
|
225
|
-
#
|
226
|
-
# Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
|
227
|
-
#
|
228
|
-
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
229
|
-
def delete(params = {}, opts = {})
|
230
|
-
request_stripe_object(
|
231
|
-
method: :delete,
|
232
|
-
path: format("/v1/accounts/%<account>s", { account: CGI.escape(self["id"]) }),
|
233
|
-
params: params,
|
234
|
-
opts: opts
|
235
|
-
)
|
236
|
-
end
|
237
|
-
|
238
|
-
# Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
|
239
|
-
def self.list(filters = {}, opts = {})
|
240
|
-
request_stripe_object(method: :get, path: "/v1/accounts", params: filters, opts: opts)
|
241
|
-
end
|
242
|
-
|
243
|
-
# Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
|
244
|
-
# left unchanged.
|
245
|
-
#
|
246
|
-
# For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that
|
247
|
-
# account has started to go through Connect Onboarding. Once you create an [Account Link or <a href="/docs/api/account_sessions">Account Session](https://stripe.com/docs/api/account_links),
|
248
|
-
# some properties can only be changed or updated for Custom accounts.
|
249
|
-
#
|
250
|
-
# To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
|
251
|
-
# [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
|
252
|
-
def self.update(id, params = {}, opts = {})
|
253
|
-
request_stripe_object(
|
254
|
-
method: :post,
|
255
|
-
path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
|
256
|
-
params: params,
|
257
|
-
opts: opts
|
258
|
-
)
|
259
|
-
end
|
260
260
|
end
|
261
261
|
end
|
@@ -13,10 +13,6 @@ module Stripe
|
|
13
13
|
"apple_pay_domain"
|
14
14
|
end
|
15
15
|
|
16
|
-
def self.resource_url
|
17
|
-
"/v1/apple_pay/domains"
|
18
|
-
end
|
19
|
-
|
20
16
|
# Create an apple pay domain.
|
21
17
|
def self.create(params = {}, opts = {})
|
22
18
|
request_stripe_object(
|
@@ -56,5 +52,9 @@ module Stripe
|
|
56
52
|
opts: opts
|
57
53
|
)
|
58
54
|
end
|
55
|
+
|
56
|
+
def self.resource_url
|
57
|
+
"/v1/apple_pay/domains"
|
58
|
+
end
|
59
59
|
end
|
60
60
|
end
|
@@ -21,6 +21,11 @@ module Stripe
|
|
21
21
|
"apps.secret"
|
22
22
|
end
|
23
23
|
|
24
|
+
# Create or replace a secret in the secret store.
|
25
|
+
def self.create(params = {}, opts = {})
|
26
|
+
request_stripe_object(method: :post, path: "/v1/apps/secrets", params: params, opts: opts)
|
27
|
+
end
|
28
|
+
|
24
29
|
# Deletes a secret from the secret store by name and scope.
|
25
30
|
def self.delete_where(params = {}, opts = {})
|
26
31
|
request_stripe_object(
|
@@ -41,11 +46,6 @@ module Stripe
|
|
41
46
|
)
|
42
47
|
end
|
43
48
|
|
44
|
-
# Create or replace a secret in the secret store.
|
45
|
-
def self.create(params = {}, opts = {})
|
46
|
-
request_stripe_object(method: :post, path: "/v1/apps/secrets", params: params, opts: opts)
|
47
|
-
end
|
48
|
-
|
49
49
|
# List all secrets stored on the given scope.
|
50
50
|
def self.list(filters = {}, opts = {})
|
51
51
|
request_stripe_object(method: :get, path: "/v1/apps/secrets", params: filters, opts: opts)
|
@@ -13,6 +13,16 @@ module Stripe
|
|
13
13
|
"capital.financing_offer"
|
14
14
|
end
|
15
15
|
|
16
|
+
# Retrieves the financing offers available for Connected accounts that belong to your platform.
|
17
|
+
def self.list(filters = {}, opts = {})
|
18
|
+
request_stripe_object(
|
19
|
+
method: :get,
|
20
|
+
path: "/v1/capital/financing_offers",
|
21
|
+
params: filters,
|
22
|
+
opts: opts
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
16
26
|
# Acknowledges that platform has received and delivered the financing_offer to
|
17
27
|
# the intended merchant recipient.
|
18
28
|
def mark_delivered(params = {}, opts = {})
|
@@ -34,16 +44,6 @@ module Stripe
|
|
34
44
|
opts: opts
|
35
45
|
)
|
36
46
|
end
|
37
|
-
|
38
|
-
# Retrieves the financing offers available for Connected accounts that belong to your platform.
|
39
|
-
def self.list(filters = {}, opts = {})
|
40
|
-
request_stripe_object(
|
41
|
-
method: :get,
|
42
|
-
path: "/v1/capital/financing_offers",
|
43
|
-
params: filters,
|
44
|
-
opts: opts
|
45
|
-
)
|
46
|
-
end
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -11,12 +11,15 @@ module Stripe
|
|
11
11
|
extend Stripe::APIOperations::List
|
12
12
|
extend Stripe::APIOperations::Search
|
13
13
|
include Stripe::APIOperations::Save
|
14
|
+
extend Stripe::APIOperations::NestedResource
|
14
15
|
|
15
16
|
OBJECT_NAME = "charge"
|
16
17
|
def self.object_name
|
17
18
|
"charge"
|
18
19
|
end
|
19
20
|
|
21
|
+
nested_resource_class_methods :refund, operations: %i[retrieve list]
|
22
|
+
|
20
23
|
# Capture the payment of an existing, uncaptured charge that was created with the capture option set to false.
|
21
24
|
#
|
22
25
|
# Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail.
|
@@ -26,23 +26,23 @@ module Stripe
|
|
26
26
|
"checkout.session"
|
27
27
|
end
|
28
28
|
|
29
|
-
#
|
30
|
-
|
31
|
-
# After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired.
|
32
|
-
def expire(params = {}, opts = {})
|
29
|
+
# Creates a Session object.
|
30
|
+
def self.create(params = {}, opts = {})
|
33
31
|
request_stripe_object(
|
34
32
|
method: :post,
|
35
|
-
path:
|
33
|
+
path: "/v1/checkout/sessions",
|
36
34
|
params: params,
|
37
35
|
opts: opts
|
38
36
|
)
|
39
37
|
end
|
40
38
|
|
41
|
-
#
|
42
|
-
|
39
|
+
# A Session can be expired when it is in one of these statuses: open
|
40
|
+
#
|
41
|
+
# After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired.
|
42
|
+
def expire(params = {}, opts = {})
|
43
43
|
request_stripe_object(
|
44
|
-
method: :
|
45
|
-
path: format("/v1/checkout/sessions/%<session>s/
|
44
|
+
method: :post,
|
45
|
+
path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(self["id"]) }),
|
46
46
|
params: params,
|
47
47
|
opts: opts
|
48
48
|
)
|
@@ -60,32 +60,32 @@ module Stripe
|
|
60
60
|
)
|
61
61
|
end
|
62
62
|
|
63
|
-
#
|
64
|
-
def self.
|
63
|
+
# Returns a list of Checkout Sessions.
|
64
|
+
def self.list(filters = {}, opts = {})
|
65
65
|
request_stripe_object(
|
66
66
|
method: :get,
|
67
|
-
path:
|
68
|
-
params:
|
67
|
+
path: "/v1/checkout/sessions",
|
68
|
+
params: filters,
|
69
69
|
opts: opts
|
70
70
|
)
|
71
71
|
end
|
72
72
|
|
73
|
-
#
|
74
|
-
def
|
73
|
+
# When retrieving a Checkout Session, 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.
|
74
|
+
def list_line_items(params = {}, opts = {})
|
75
75
|
request_stripe_object(
|
76
|
-
method: :
|
77
|
-
path: "/v1/checkout/sessions",
|
76
|
+
method: :get,
|
77
|
+
path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(self["id"]) }),
|
78
78
|
params: params,
|
79
79
|
opts: opts
|
80
80
|
)
|
81
81
|
end
|
82
82
|
|
83
|
-
#
|
84
|
-
def self.
|
83
|
+
# When retrieving a Checkout Session, 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.
|
84
|
+
def self.list_line_items(session, params = {}, opts = {})
|
85
85
|
request_stripe_object(
|
86
86
|
method: :get,
|
87
|
-
path: "/v1/checkout/sessions",
|
88
|
-
params:
|
87
|
+
path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(session) }),
|
88
|
+
params: params,
|
89
89
|
opts: opts
|
90
90
|
)
|
91
91
|
end
|
@@ -15,14 +15,27 @@ module Stripe
|
|
15
15
|
"credit_note"
|
16
16
|
end
|
17
17
|
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
# Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces
|
19
|
+
# its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result
|
20
|
+
# in any combination of the following:
|
21
|
+
#
|
22
|
+
#
|
23
|
+
# Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
|
24
|
+
# Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
|
25
|
+
# Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
|
26
|
+
#
|
27
|
+
#
|
28
|
+
# For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
|
29
|
+
#
|
30
|
+
# You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
|
31
|
+
# or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
|
32
|
+
def self.create(params = {}, opts = {})
|
33
|
+
request_stripe_object(method: :post, path: "/v1/credit_notes", params: params, opts: opts)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Returns a list of credit notes.
|
37
|
+
def self.list(filters = {}, opts = {})
|
38
|
+
request_stripe_object(method: :get, path: "/v1/credit_notes", params: filters, opts: opts)
|
26
39
|
end
|
27
40
|
|
28
41
|
# When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
|
@@ -45,44 +58,31 @@ module Stripe
|
|
45
58
|
)
|
46
59
|
end
|
47
60
|
|
48
|
-
#
|
49
|
-
def self.
|
61
|
+
# Updates an existing credit note.
|
62
|
+
def self.update(id, params = {}, opts = {})
|
50
63
|
request_stripe_object(
|
51
64
|
method: :post,
|
52
|
-
path: format("/v1/credit_notes/%<id>s
|
65
|
+
path: format("/v1/credit_notes/%<id>s", { id: CGI.escape(id) }),
|
53
66
|
params: params,
|
54
67
|
opts: opts
|
55
68
|
)
|
56
69
|
end
|
57
70
|
|
58
|
-
#
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
#
|
67
|
-
#
|
68
|
-
# For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
|
69
|
-
#
|
70
|
-
# You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
|
71
|
-
# or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
|
72
|
-
def self.create(params = {}, opts = {})
|
73
|
-
request_stripe_object(method: :post, path: "/v1/credit_notes", params: params, opts: opts)
|
74
|
-
end
|
75
|
-
|
76
|
-
# Returns a list of credit notes.
|
77
|
-
def self.list(filters = {}, opts = {})
|
78
|
-
request_stripe_object(method: :get, path: "/v1/credit_notes", params: filters, opts: opts)
|
71
|
+
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
72
|
+
def void_credit_note(params = {}, opts = {})
|
73
|
+
request_stripe_object(
|
74
|
+
method: :post,
|
75
|
+
path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(self["id"]) }),
|
76
|
+
params: params,
|
77
|
+
opts: opts
|
78
|
+
)
|
79
79
|
end
|
80
80
|
|
81
|
-
#
|
82
|
-
def self.
|
81
|
+
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
82
|
+
def self.void_credit_note(id, params = {}, opts = {})
|
83
83
|
request_stripe_object(
|
84
84
|
method: :post,
|
85
|
-
path: format("/v1/credit_notes/%<id>s", { id: CGI.escape(id) }),
|
85
|
+
path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(id) }),
|
86
86
|
params: params,
|
87
87
|
opts: opts
|
88
88
|
)
|