stripe 11.7.0 → 12.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +53 -0
- data/Gemfile +0 -1
- data/OPENAPI_VERSION +1 -1
- data/README.md +17 -1
- data/VERSION +1 -1
- data/lib/stripe/api_operations/request.rb +4 -0
- data/lib/stripe/api_version.rb +1 -1
- data/lib/stripe/object_types.rb +2 -0
- data/lib/stripe/resources/account.rb +2 -2
- data/lib/stripe/resources/bank_account.rb +27 -16
- data/lib/stripe/resources/billing/alert.rb +87 -0
- data/lib/stripe/resources/billing_portal/session.rb +1 -1
- data/lib/stripe/resources/card.rb +10 -12
- data/lib/stripe/resources/checkout/session.rb +11 -0
- data/lib/stripe/resources/climate/order.rb +2 -2
- data/lib/stripe/resources/customer_session.rb +7 -3
- data/lib/stripe/resources/file.rb +17 -13
- data/lib/stripe/resources/identity/verification_report.rb +1 -1
- data/lib/stripe/resources/invoice.rb +60 -0
- data/lib/stripe/resources/invoice_line_item.rb +3 -0
- data/lib/stripe/resources/invoice_rendering_template.rb +63 -0
- data/lib/stripe/resources/issuing/authorization.rb +20 -0
- data/lib/stripe/resources/payment_intent.rb +6 -0
- data/lib/stripe/resources/payment_method_domain.rb +1 -1
- data/lib/stripe/resources/quote.rb +2 -2
- data/lib/stripe/resources/refund.rb +1 -1
- data/lib/stripe/resources/setup_intent.rb +2 -2
- data/lib/stripe/resources/subscription.rb +3 -3
- data/lib/stripe/resources/tax/calculation.rb +3 -3
- data/lib/stripe/resources/tax/transaction.rb +1 -1
- data/lib/stripe/resources/treasury/inbound_transfer.rb +3 -1
- data/lib/stripe/resources/treasury/outbound_payment.rb +3 -1
- data/lib/stripe/resources/treasury/outbound_transfer.rb +3 -1
- data/lib/stripe/resources.rb +2 -0
- data/lib/stripe/stripe_client.rb +3 -1
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +25 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cec3b48108a6e34b1ebda0be0cfb3ed6eb9aa124d71577b99fdb4b6b2407e0ad
|
|
4
|
+
data.tar.gz: 11d1823bf601fd83aa44cd8262af329eb0ce1a52885c982f6a58466837a1d89a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b3931f9c3637f350e0590ad6fce034cb8449e20e5c37da258971b9e6577ea9be65cab45196798b6ae88ac04d4cf1ad99c85caa18c315c1be17ea3808133c57c
|
|
7
|
+
data.tar.gz: 94d11382678b989b6cd8dc9e81219e9a07338bc83ae704b8bcf7c1a410e7fa6e13d0aa4e22eb4256975218b20ed469ce1f28de7b1b910aa44f078b37240b9172
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,57 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## 12.6.0 - 2024-09-12
|
|
3
|
+
* [#1442](https://github.com/stripe/stripe-ruby/pull/1442) Update generated code
|
|
4
|
+
* Add support for new resource `InvoiceRenderingTemplate`
|
|
5
|
+
* Add support for `archive`, `list`, `retrieve`, and `unarchive` methods on resource `InvoiceRenderingTemplate`
|
|
6
|
+
* [#1443](https://github.com/stripe/stripe-ruby/pull/1443) Removed v1/files override
|
|
7
|
+
|
|
8
|
+
## 12.5.0 - 2024-08-08
|
|
9
|
+
* [#1440](https://github.com/stripe/stripe-ruby/pull/1440) Update generated code
|
|
10
|
+
* Add support for new resources `Billing.AlertTriggered` and `Billing.Alert`
|
|
11
|
+
* Add support for `activate`, `archive`, `create`, `deactivate`, `list`, and `retrieve` methods on resource `Alert`
|
|
12
|
+
* Add support for `retrieve` method on resource `Tax.Calculation`
|
|
13
|
+
|
|
14
|
+
## 12.4.0 - 2024-07-25
|
|
15
|
+
* [#1437](https://github.com/stripe/stripe-ruby/pull/1437) Update generated code
|
|
16
|
+
* Add support for `update` method on resource `Checkout.Session`
|
|
17
|
+
|
|
18
|
+
## 12.3.0 - 2024-07-18
|
|
19
|
+
* [#1436](https://github.com/stripe/stripe-ruby/pull/1436) Fixed changelog for major release 12.0.0
|
|
20
|
+
* [#1435](https://github.com/stripe/stripe-ruby/pull/1435) Add deprecation warning for `APIResource.request`
|
|
21
|
+
|
|
22
|
+
## 12.2.0 - 2024-07-12
|
|
23
|
+
* [#1430](https://github.com/stripe/stripe-ruby/pull/1430) Update generated code
|
|
24
|
+
|
|
25
|
+
* [#1433](https://github.com/stripe/stripe-ruby/pull/1433) Add usage to raw_request call
|
|
26
|
+
* [#1431](https://github.com/stripe/stripe-ruby/pull/1431) Add `raw_request`
|
|
27
|
+
|
|
28
|
+
- Adds the ability to make raw requests to the Stripe API, by providing an HTTP method and url. This is an alternative to using `Stripe::APIResource.request(...)` to make custom requests, which is discouraged and will be broken in a future major version.
|
|
29
|
+
|
|
30
|
+
## 12.1.0 - 2024-07-05
|
|
31
|
+
* [#1425](https://github.com/stripe/stripe-ruby/pull/1425) Update generated code
|
|
32
|
+
* Add support for `add_lines`, `remove_lines`, and `update_lines` methods on resource `Invoice`
|
|
33
|
+
* [#1420](https://github.com/stripe/stripe-ruby/pull/1420) Update static methods for delete/list on BankAccount/Card to throw NotImplementedError
|
|
34
|
+
* The below methods have been throwing `InvalidRequestError` because the urls used to make the requests have been buggy. Updating them to throw `NotImplementedError` instead just like their counterparts for update & retrieve because they cannot be implemented without the parent id.
|
|
35
|
+
|
|
36
|
+
Methods affected | Use these instead in the context of payment method | Use these in the context of external accounts
|
|
37
|
+
------ | ------ | ----
|
|
38
|
+
Stripe:: BankAccount.delete | Stripe::Customer.delete_source | Stripe::Account.delete_external_account
|
|
39
|
+
Stripe:: BankAccount.list | Stripe::Customer.list_sources | Stripe::Customer.list_external_accounts
|
|
40
|
+
Stripe:: Card.delete | Stripe::Customer.delete_source | Stripe::Account.delete_external_account
|
|
41
|
+
Stripe:: Card.list | Stripe::Customer.list_sources | Stripe::Customer.list_external_accounts
|
|
42
|
+
* [#1427](https://github.com/stripe/stripe-ruby/pull/1427) Regenerate rbis
|
|
43
|
+
* [#1426](https://github.com/stripe/stripe-ruby/pull/1426) Remove coveralls and re-added JRuby
|
|
44
|
+
|
|
45
|
+
## 12.0.0 - 2024-06-24
|
|
46
|
+
* [#1418](https://github.com/stripe/stripe-ruby/pull/1418) Add missing static method for verify on BankAccount
|
|
47
|
+
* [#1419](https://github.com/stripe/stripe-ruby/pull/1419)
|
|
48
|
+
|
|
49
|
+
This release changes the pinned API version to 2024-06-20. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-06-20) and carefully review the API changes before upgrading.
|
|
50
|
+
|
|
51
|
+
### Additions
|
|
52
|
+
|
|
53
|
+
* Add support for `finalize_amount` test helper method on resource `Issuing.Authorization`
|
|
54
|
+
|
|
2
55
|
## 11.7.0 - 2024-06-13
|
|
3
56
|
* [#1415](https://github.com/stripe/stripe-ruby/pull/1415) Deprecate StripeClient#request
|
|
4
57
|
* Add deprecation warning for `StripeClient#request`. This helper method will be removed in a future major version. To access response objects, use the `last_response` property on the returned resource instead. Refer to [Accessing a response object](https://github.com/stripe/stripe-ruby?tab=readme-ov-file#accessing-a-response-object) in the README for usage details.
|
data/Gemfile
CHANGED
data/OPENAPI_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v1255
|
data/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/rb/stripe)
|
|
4
4
|
[](https://github.com/stripe/stripe-ruby/actions?query=branch%3Amaster)
|
|
5
|
-
[](https://coveralls.io/github/stripe/stripe-ruby?branch=master)
|
|
6
5
|
|
|
7
6
|
The Stripe Ruby library provides convenient access to the Stripe API from
|
|
8
7
|
applications written in the Ruby language. It includes a pre-defined set of
|
|
@@ -339,6 +338,23 @@ If your beta feature requires a `Stripe-Version` header to be sent, set the `Str
|
|
|
339
338
|
Stripe.add_beta_version("feature_beta", "v3")
|
|
340
339
|
```
|
|
341
340
|
|
|
341
|
+
### Custom requests
|
|
342
|
+
|
|
343
|
+
If you:
|
|
344
|
+
|
|
345
|
+
- would like to send a request to an undocumented API (for example you are in a private beta)
|
|
346
|
+
- prefer to bypass the method definitions in the library and specify your request details directly,
|
|
347
|
+
- used the method `Stripe::APIResource.request(...)` to specify your own requests, which will soon be broken
|
|
348
|
+
|
|
349
|
+
you can now use the `raw_request` method on `Stripe`.
|
|
350
|
+
|
|
351
|
+
```ruby
|
|
352
|
+
resp = Stripe.raw_request(:post, "/v1/beta_endpoint", {param: 123}, {stripe_version: "2022-11-15; feature_beta=v3"})
|
|
353
|
+
|
|
354
|
+
# (Optional) resp is a StripeResponse. You can use `Stripe.deserialize` to get a StripeObject.
|
|
355
|
+
deserialized_resp = Stripe.deserialize(resp.http_body)
|
|
356
|
+
```
|
|
357
|
+
|
|
342
358
|
## Support
|
|
343
359
|
|
|
344
360
|
New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
12.6.0
|
|
@@ -78,6 +78,8 @@ module Stripe
|
|
|
78
78
|
# place for backwards compatibility. Consider removing it on the next
|
|
79
79
|
# major.
|
|
80
80
|
alias request execute_resource_request
|
|
81
|
+
extend Gem::Deprecate
|
|
82
|
+
deprecate :request, "Stripe.raw_request", 2024, 7
|
|
81
83
|
|
|
82
84
|
private def error_on_non_string_user_opts(opts)
|
|
83
85
|
Util::OPTS_USER_SPECIFIED.each do |opt|
|
|
@@ -134,6 +136,8 @@ module Stripe
|
|
|
134
136
|
|
|
135
137
|
# See notes on `alias` above.
|
|
136
138
|
alias request execute_resource_request
|
|
139
|
+
extend Gem::Deprecate
|
|
140
|
+
deprecate :request, "Stripe.raw_request", 2024, 7
|
|
137
141
|
end
|
|
138
142
|
end
|
|
139
143
|
end
|
data/lib/stripe/api_version.rb
CHANGED
data/lib/stripe/object_types.rb
CHANGED
|
@@ -23,6 +23,7 @@ module Stripe
|
|
|
23
23
|
Balance.object_name => Balance,
|
|
24
24
|
BalanceTransaction.object_name => BalanceTransaction,
|
|
25
25
|
BankAccount.object_name => BankAccount,
|
|
26
|
+
Billing::Alert.object_name => Billing::Alert,
|
|
26
27
|
Billing::Meter.object_name => Billing::Meter,
|
|
27
28
|
Billing::MeterEvent.object_name => Billing::MeterEvent,
|
|
28
29
|
Billing::MeterEventAdjustment.object_name => Billing::MeterEventAdjustment,
|
|
@@ -67,6 +68,7 @@ module Stripe
|
|
|
67
68
|
Invoice.object_name => Invoice,
|
|
68
69
|
InvoiceItem.object_name => InvoiceItem,
|
|
69
70
|
InvoiceLineItem.object_name => InvoiceLineItem,
|
|
71
|
+
InvoiceRenderingTemplate.object_name => InvoiceRenderingTemplate,
|
|
70
72
|
Issuing::Authorization.object_name => Issuing::Authorization,
|
|
71
73
|
Issuing::Card.object_name => Issuing::Card,
|
|
72
74
|
Issuing::Cardholder.object_name => Issuing::Cardholder,
|
|
@@ -48,7 +48,7 @@ module Stripe
|
|
|
48
48
|
#
|
|
49
49
|
# Test-mode accounts can be deleted at any time.
|
|
50
50
|
#
|
|
51
|
-
# Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/
|
|
51
|
+
# Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero.
|
|
52
52
|
#
|
|
53
53
|
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
|
54
54
|
def self.delete(id, params = {}, opts = {})
|
|
@@ -64,7 +64,7 @@ module Stripe
|
|
|
64
64
|
#
|
|
65
65
|
# Test-mode accounts can be deleted at any time.
|
|
66
66
|
#
|
|
67
|
-
# Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/
|
|
67
|
+
# Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero.
|
|
68
68
|
#
|
|
69
69
|
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
|
70
70
|
def delete(params = {}, opts = {})
|
|
@@ -5,8 +5,7 @@ module Stripe
|
|
|
5
5
|
# These bank accounts are payment methods on `Customer` objects.
|
|
6
6
|
#
|
|
7
7
|
# On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer
|
|
8
|
-
# destinations on `Account` objects for accounts
|
|
9
|
-
# is `application`, which includes [Custom accounts](https://stripe.com/connect/custom-accounts).
|
|
8
|
+
# destinations on `Account` objects for connected accounts.
|
|
10
9
|
# They can be bank accounts or debit cards as well, and are documented in the links above.
|
|
11
10
|
#
|
|
12
11
|
# Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers)
|
|
@@ -21,8 +20,21 @@ module Stripe
|
|
|
21
20
|
end
|
|
22
21
|
|
|
23
22
|
def verify(params = {}, opts = {})
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
request_stripe_object(
|
|
24
|
+
method: :post,
|
|
25
|
+
path: "#{Customer.resource_url}/#{customer}/sources/#{id}/verify",
|
|
26
|
+
params: params,
|
|
27
|
+
opts: opts
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.verify(customer, id, params = {}, opts = {})
|
|
32
|
+
request_stripe_object(
|
|
33
|
+
method: :post,
|
|
34
|
+
path: "#{Customer.resource_url}/#{customer}/sources/#{id}/verify",
|
|
35
|
+
params: params,
|
|
36
|
+
opts: opts
|
|
37
|
+
)
|
|
26
38
|
end
|
|
27
39
|
|
|
28
40
|
def resource_url
|
|
@@ -52,12 +64,12 @@ module Stripe
|
|
|
52
64
|
end
|
|
53
65
|
|
|
54
66
|
def self.delete(id, params = {}, opts = {})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
raise NotImplementedError,
|
|
68
|
+
"Bank accounts cannot be deleted without a customer ID or an " \
|
|
69
|
+
"account ID. Delete a bank account using " \
|
|
70
|
+
"`Customer.delete_source('customer_id', 'bank_account_id')` " \
|
|
71
|
+
"or `Account.delete_external_account('account_id', " \
|
|
72
|
+
"'bank_account_id')`"
|
|
61
73
|
end
|
|
62
74
|
|
|
63
75
|
def delete(params = {}, opts = {})
|
|
@@ -70,12 +82,11 @@ module Stripe
|
|
|
70
82
|
end
|
|
71
83
|
|
|
72
84
|
def self.list(filters = {}, opts = {})
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)
|
|
85
|
+
raise NotImplementedError,
|
|
86
|
+
"Bank accounts cannot be listed without a customer ID or an " \
|
|
87
|
+
"account ID. List bank accounts using " \
|
|
88
|
+
"`Customer.list_sources('customer_id')` " \
|
|
89
|
+
"or `Account.list_external_accounts('account_id')`"
|
|
79
90
|
end
|
|
80
91
|
end
|
|
81
92
|
end
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Stripe
|
|
5
|
+
module Billing
|
|
6
|
+
# A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
|
|
7
|
+
class Alert < APIResource
|
|
8
|
+
extend Stripe::APIOperations::Create
|
|
9
|
+
extend Stripe::APIOperations::List
|
|
10
|
+
|
|
11
|
+
OBJECT_NAME = "billing.alert"
|
|
12
|
+
def self.object_name
|
|
13
|
+
"billing.alert"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Reactivates this alert, allowing it to trigger again.
|
|
17
|
+
def activate(params = {}, opts = {})
|
|
18
|
+
request_stripe_object(
|
|
19
|
+
method: :post,
|
|
20
|
+
path: format("/v1/billing/alerts/%<id>s/activate", { id: CGI.escape(self["id"]) }),
|
|
21
|
+
params: params,
|
|
22
|
+
opts: opts
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Reactivates this alert, allowing it to trigger again.
|
|
27
|
+
def self.activate(id, params = {}, opts = {})
|
|
28
|
+
request_stripe_object(
|
|
29
|
+
method: :post,
|
|
30
|
+
path: format("/v1/billing/alerts/%<id>s/activate", { id: CGI.escape(id) }),
|
|
31
|
+
params: params,
|
|
32
|
+
opts: opts
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Archives this alert, removing it from the list view and APIs. This is non-reversible.
|
|
37
|
+
def archive(params = {}, opts = {})
|
|
38
|
+
request_stripe_object(
|
|
39
|
+
method: :post,
|
|
40
|
+
path: format("/v1/billing/alerts/%<id>s/archive", { id: CGI.escape(self["id"]) }),
|
|
41
|
+
params: params,
|
|
42
|
+
opts: opts
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Archives this alert, removing it from the list view and APIs. This is non-reversible.
|
|
47
|
+
def self.archive(id, params = {}, opts = {})
|
|
48
|
+
request_stripe_object(
|
|
49
|
+
method: :post,
|
|
50
|
+
path: format("/v1/billing/alerts/%<id>s/archive", { id: CGI.escape(id) }),
|
|
51
|
+
params: params,
|
|
52
|
+
opts: opts
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Creates a billing alert
|
|
57
|
+
def self.create(params = {}, opts = {})
|
|
58
|
+
request_stripe_object(method: :post, path: "/v1/billing/alerts", params: params, opts: opts)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Deactivates this alert, preventing it from triggering.
|
|
62
|
+
def deactivate(params = {}, opts = {})
|
|
63
|
+
request_stripe_object(
|
|
64
|
+
method: :post,
|
|
65
|
+
path: format("/v1/billing/alerts/%<id>s/deactivate", { id: CGI.escape(self["id"]) }),
|
|
66
|
+
params: params,
|
|
67
|
+
opts: opts
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Deactivates this alert, preventing it from triggering.
|
|
72
|
+
def self.deactivate(id, params = {}, opts = {})
|
|
73
|
+
request_stripe_object(
|
|
74
|
+
method: :post,
|
|
75
|
+
path: format("/v1/billing/alerts/%<id>s/deactivate", { id: CGI.escape(id) }),
|
|
76
|
+
params: params,
|
|
77
|
+
opts: opts
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Lists billing active and inactive alerts
|
|
82
|
+
def self.list(filters = {}, opts = {})
|
|
83
|
+
request_stripe_object(method: :get, path: "/v1/billing/alerts", params: filters, opts: opts)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -16,7 +16,7 @@ module Stripe
|
|
|
16
16
|
# Create sessions on-demand when customers intend to manage their subscriptions
|
|
17
17
|
# and billing details.
|
|
18
18
|
#
|
|
19
|
-
#
|
|
19
|
+
# Related guide: [Customer management](https://stripe.com/customer-management)
|
|
20
20
|
class Session < APIResource
|
|
21
21
|
extend Stripe::APIOperations::Create
|
|
22
22
|
|
|
@@ -42,12 +42,11 @@ module Stripe
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def self.delete(id, params = {}, opts = {})
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
)
|
|
45
|
+
raise NotImplementedError,
|
|
46
|
+
"Card cannot be deleted without a customer ID or an account " \
|
|
47
|
+
"ID. Delete a card using `Customer.delete_source(" \
|
|
48
|
+
"'customer_id', 'card_id')` or " \
|
|
49
|
+
"`Account.delete_external_account('account_id', 'card_id')`"
|
|
51
50
|
end
|
|
52
51
|
|
|
53
52
|
def delete(params = {}, opts = {})
|
|
@@ -60,12 +59,11 @@ module Stripe
|
|
|
60
59
|
end
|
|
61
60
|
|
|
62
61
|
def self.list(filters = {}, opts = {})
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
)
|
|
62
|
+
raise NotImplementedError,
|
|
63
|
+
"Cards cannot be listed without a customer ID or an account " \
|
|
64
|
+
"ID. List cards using `Customer.list_sources(" \
|
|
65
|
+
"'customer_id')` or " \
|
|
66
|
+
"`Account.list_external_accounts('account_id')`"
|
|
69
67
|
end
|
|
70
68
|
end
|
|
71
69
|
end
|
|
@@ -20,6 +20,7 @@ module Stripe
|
|
|
20
20
|
class Session < APIResource
|
|
21
21
|
extend Stripe::APIOperations::Create
|
|
22
22
|
extend Stripe::APIOperations::List
|
|
23
|
+
include Stripe::APIOperations::Save
|
|
23
24
|
|
|
24
25
|
OBJECT_NAME = "checkout.session"
|
|
25
26
|
def self.object_name
|
|
@@ -89,6 +90,16 @@ module Stripe
|
|
|
89
90
|
opts: opts
|
|
90
91
|
)
|
|
91
92
|
end
|
|
93
|
+
|
|
94
|
+
# Updates a Session object.
|
|
95
|
+
def self.update(id, params = {}, opts = {})
|
|
96
|
+
request_stripe_object(
|
|
97
|
+
method: :post,
|
|
98
|
+
path: format("/v1/checkout/sessions/%<id>s", { id: CGI.escape(id) }),
|
|
99
|
+
params: params,
|
|
100
|
+
opts: opts
|
|
101
|
+
)
|
|
102
|
+
end
|
|
92
103
|
end
|
|
93
104
|
end
|
|
94
105
|
end
|
|
@@ -15,7 +15,7 @@ module Stripe
|
|
|
15
15
|
"climate.order"
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
# Cancels a Climate order. You can cancel an order within
|
|
18
|
+
# Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the
|
|
19
19
|
# reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier
|
|
20
20
|
# might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe
|
|
21
21
|
# provides 90 days advance notice and refunds the amount_total.
|
|
@@ -28,7 +28,7 @@ module Stripe
|
|
|
28
28
|
)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
# Cancels a Climate order. You can cancel an order within
|
|
31
|
+
# Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the
|
|
32
32
|
# reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier
|
|
33
33
|
# might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe
|
|
34
34
|
# provides 90 days advance notice and refunds the amount_total.
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
module Stripe
|
|
5
|
-
# A
|
|
6
|
-
# control over a
|
|
5
|
+
# A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
|
|
6
|
+
# control over a Customer.
|
|
7
|
+
#
|
|
8
|
+
# Related guides: [Customer Session with the Payment Element](https://stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#save-payment-methods),
|
|
9
|
+
# [Customer Session with the Pricing Table](https://stripe.com/payments/checkout/pricing-table#customer-session),
|
|
10
|
+
# [Customer Session with the Buy Button](https://stripe.com/payment-links/buy-button#pass-an-existing-customer).
|
|
7
11
|
class CustomerSession < APIResource
|
|
8
12
|
extend Stripe::APIOperations::Create
|
|
9
13
|
|
|
@@ -12,7 +16,7 @@ module Stripe
|
|
|
12
16
|
"customer_session"
|
|
13
17
|
end
|
|
14
18
|
|
|
15
|
-
# Creates a
|
|
19
|
+
# Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
|
|
16
20
|
def self.create(params = {}, opts = {})
|
|
17
21
|
request_stripe_object(
|
|
18
22
|
method: :post,
|
|
@@ -18,6 +18,23 @@ module Stripe
|
|
|
18
18
|
"file"
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
+
# To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file.
|
|
22
|
+
#
|
|
23
|
+
# All of Stripe's officially supported Client libraries support sending multipart/form-data.
|
|
24
|
+
def self.create(params = {}, opts = {})
|
|
25
|
+
config = opts[:client]&.config || Stripe.config
|
|
26
|
+
upload_base = config.uploads_base
|
|
27
|
+
opts = { api_base: upload_base }.merge(Util.normalize_opts(opts))
|
|
28
|
+
|
|
29
|
+
if params[:file] && !params[:file].is_a?(String) && !params[:file].respond_to?(:read)
|
|
30
|
+
raise ArgumentError, "file must respond to `#read`"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
opts = { content_type: MultipartEncoder::MULTIPART_FORM_DATA }.merge(Util.normalize_opts(opts))
|
|
34
|
+
|
|
35
|
+
request_stripe_object(method: :post, path: "/v1/files", params: params, opts: opts)
|
|
36
|
+
end
|
|
37
|
+
|
|
21
38
|
# Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
|
|
22
39
|
def self.list(filters = {}, opts = {})
|
|
23
40
|
request_stripe_object(method: :get, path: "/v1/files", params: filters, opts: opts)
|
|
@@ -35,18 +52,5 @@ module Stripe
|
|
|
35
52
|
def self.resource_url
|
|
36
53
|
"/v1/files"
|
|
37
54
|
end
|
|
38
|
-
|
|
39
|
-
def self.create(params = {}, opts = {})
|
|
40
|
-
if params[:file] && !params[:file].is_a?(String) && !params[:file].respond_to?(:read)
|
|
41
|
-
raise ArgumentError, "file must respond to `#read`"
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
config = opts[:client]&.config || Stripe.config
|
|
45
|
-
opts = {
|
|
46
|
-
api_base: config.uploads_base,
|
|
47
|
-
content_type: MultipartEncoder::MULTIPART_FORM_DATA,
|
|
48
|
-
}.merge(Util.normalize_opts(opts))
|
|
49
|
-
super
|
|
50
|
-
end
|
|
51
55
|
end
|
|
52
56
|
end
|
|
@@ -13,7 +13,7 @@ module Stripe
|
|
|
13
13
|
# API. To configure and create VerificationReports, use the
|
|
14
14
|
# [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API.
|
|
15
15
|
#
|
|
16
|
-
# Related
|
|
16
|
+
# Related guide: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results).
|
|
17
17
|
class VerificationReport < APIResource
|
|
18
18
|
extend Stripe::APIOperations::List
|
|
19
19
|
|
|
@@ -49,6 +49,26 @@ module Stripe
|
|
|
49
49
|
|
|
50
50
|
nested_resource_class_methods :line, operations: %i[list]
|
|
51
51
|
|
|
52
|
+
# Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
|
|
53
|
+
def add_lines(params = {}, opts = {})
|
|
54
|
+
request_stripe_object(
|
|
55
|
+
method: :post,
|
|
56
|
+
path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(self["id"]) }),
|
|
57
|
+
params: params,
|
|
58
|
+
opts: opts
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
|
|
63
|
+
def self.add_lines(invoice, params = {}, opts = {})
|
|
64
|
+
request_stripe_object(
|
|
65
|
+
method: :post,
|
|
66
|
+
path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(invoice) }),
|
|
67
|
+
params: params,
|
|
68
|
+
opts: opts
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
|
|
52
72
|
# This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
|
|
53
73
|
def self.create(params = {}, opts = {})
|
|
54
74
|
request_stripe_object(method: :post, path: "/v1/invoices", params: params, opts: opts)
|
|
@@ -165,6 +185,26 @@ module Stripe
|
|
|
165
185
|
)
|
|
166
186
|
end
|
|
167
187
|
|
|
188
|
+
# Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
|
|
189
|
+
def remove_lines(params = {}, opts = {})
|
|
190
|
+
request_stripe_object(
|
|
191
|
+
method: :post,
|
|
192
|
+
path: format("/v1/invoices/%<invoice>s/remove_lines", { invoice: CGI.escape(self["id"]) }),
|
|
193
|
+
params: params,
|
|
194
|
+
opts: opts
|
|
195
|
+
)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
|
|
199
|
+
def self.remove_lines(invoice, params = {}, opts = {})
|
|
200
|
+
request_stripe_object(
|
|
201
|
+
method: :post,
|
|
202
|
+
path: format("/v1/invoices/%<invoice>s/remove_lines", { invoice: CGI.escape(invoice) }),
|
|
203
|
+
params: params,
|
|
204
|
+
opts: opts
|
|
205
|
+
)
|
|
206
|
+
end
|
|
207
|
+
|
|
168
208
|
def self.search(params = {}, opts = {})
|
|
169
209
|
request_stripe_object(method: :get, path: "/v1/invoices/search", params: params, opts: opts)
|
|
170
210
|
end
|
|
@@ -223,6 +263,26 @@ module Stripe
|
|
|
223
263
|
)
|
|
224
264
|
end
|
|
225
265
|
|
|
266
|
+
# Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
|
|
267
|
+
def update_lines(params = {}, opts = {})
|
|
268
|
+
request_stripe_object(
|
|
269
|
+
method: :post,
|
|
270
|
+
path: format("/v1/invoices/%<invoice>s/update_lines", { invoice: CGI.escape(self["id"]) }),
|
|
271
|
+
params: params,
|
|
272
|
+
opts: opts
|
|
273
|
+
)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
|
|
277
|
+
def self.update_lines(invoice, params = {}, opts = {})
|
|
278
|
+
request_stripe_object(
|
|
279
|
+
method: :post,
|
|
280
|
+
path: format("/v1/invoices/%<invoice>s/update_lines", { invoice: CGI.escape(invoice) }),
|
|
281
|
+
params: params,
|
|
282
|
+
opts: opts
|
|
283
|
+
)
|
|
284
|
+
end
|
|
285
|
+
|
|
226
286
|
# Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
|
|
227
287
|
#
|
|
228
288
|
# Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
module Stripe
|
|
5
|
+
# Invoice Line Items represent the individual lines within an [invoice](https://stripe.com/docs/api/invoices) and only exist within the context of an invoice.
|
|
6
|
+
#
|
|
7
|
+
# Each line item is backed by either an [invoice item](https://stripe.com/docs/api/invoiceitems) or a [subscription item](https://stripe.com/docs/api/subscription_items).
|
|
5
8
|
class InvoiceLineItem < StripeObject
|
|
6
9
|
include Stripe::APIOperations::Save
|
|
7
10
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Stripe
|
|
5
|
+
class InvoiceRenderingTemplate < APIResource
|
|
6
|
+
extend Stripe::APIOperations::List
|
|
7
|
+
|
|
8
|
+
OBJECT_NAME = "invoice_rendering_template"
|
|
9
|
+
def self.object_name
|
|
10
|
+
"invoice_rendering_template"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it.
|
|
14
|
+
def archive(params = {}, opts = {})
|
|
15
|
+
request_stripe_object(
|
|
16
|
+
method: :post,
|
|
17
|
+
path: format("/v1/invoice_rendering_templates/%<template>s/archive", { template: CGI.escape(self["id"]) }),
|
|
18
|
+
params: params,
|
|
19
|
+
opts: opts
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it.
|
|
24
|
+
def self.archive(template, params = {}, opts = {})
|
|
25
|
+
request_stripe_object(
|
|
26
|
+
method: :post,
|
|
27
|
+
path: format("/v1/invoice_rendering_templates/%<template>s/archive", { template: CGI.escape(template) }),
|
|
28
|
+
params: params,
|
|
29
|
+
opts: opts
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# List all templates, ordered by creation date, with the most recently created template appearing first.
|
|
34
|
+
def self.list(filters = {}, opts = {})
|
|
35
|
+
request_stripe_object(
|
|
36
|
+
method: :get,
|
|
37
|
+
path: "/v1/invoice_rendering_templates",
|
|
38
|
+
params: filters,
|
|
39
|
+
opts: opts
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Unarchive an invoice rendering template so it can be used on new Stripe objects again.
|
|
44
|
+
def unarchive(params = {}, opts = {})
|
|
45
|
+
request_stripe_object(
|
|
46
|
+
method: :post,
|
|
47
|
+
path: format("/v1/invoice_rendering_templates/%<template>s/unarchive", { template: CGI.escape(self["id"]) }),
|
|
48
|
+
params: params,
|
|
49
|
+
opts: opts
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Unarchive an invoice rendering template so it can be used on new Stripe objects again.
|
|
54
|
+
def self.unarchive(template, params = {}, opts = {})
|
|
55
|
+
request_stripe_object(
|
|
56
|
+
method: :post,
|
|
57
|
+
path: format("/v1/invoice_rendering_templates/%<template>s/unarchive", { template: CGI.escape(template) }),
|
|
58
|
+
params: params,
|
|
59
|
+
opts: opts
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -152,6 +152,26 @@ module Stripe
|
|
|
152
152
|
)
|
|
153
153
|
end
|
|
154
154
|
|
|
155
|
+
# Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.
|
|
156
|
+
def self.finalize_amount(authorization, params = {}, opts = {})
|
|
157
|
+
request_stripe_object(
|
|
158
|
+
method: :post,
|
|
159
|
+
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/finalize_amount", { authorization: CGI.escape(authorization) }),
|
|
160
|
+
params: params,
|
|
161
|
+
opts: opts
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.
|
|
166
|
+
def finalize_amount(params = {}, opts = {})
|
|
167
|
+
@resource.request_stripe_object(
|
|
168
|
+
method: :post,
|
|
169
|
+
path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/finalize_amount", { authorization: CGI.escape(@resource["id"]) }),
|
|
170
|
+
params: params,
|
|
171
|
+
opts: opts
|
|
172
|
+
)
|
|
173
|
+
end
|
|
174
|
+
|
|
155
175
|
# Increment a test-mode Authorization.
|
|
156
176
|
def self.increment(authorization, params = {}, opts = {})
|
|
157
177
|
request_stripe_object(
|
|
@@ -122,6 +122,9 @@ module Stripe
|
|
|
122
122
|
# after those actions are completed. Your server needs to then
|
|
123
123
|
# explicitly re-confirm the PaymentIntent to initiate the next payment
|
|
124
124
|
# attempt.
|
|
125
|
+
# There is a variable upper limit on how many times a PaymentIntent can be confirmed.
|
|
126
|
+
# After this limit is reached, any further calls to this endpoint will
|
|
127
|
+
# transition the PaymentIntent to the canceled state.
|
|
125
128
|
def confirm(params = {}, opts = {})
|
|
126
129
|
request_stripe_object(
|
|
127
130
|
method: :post,
|
|
@@ -153,6 +156,9 @@ module Stripe
|
|
|
153
156
|
# after those actions are completed. Your server needs to then
|
|
154
157
|
# explicitly re-confirm the PaymentIntent to initiate the next payment
|
|
155
158
|
# attempt.
|
|
159
|
+
# There is a variable upper limit on how many times a PaymentIntent can be confirmed.
|
|
160
|
+
# After this limit is reached, any further calls to this endpoint will
|
|
161
|
+
# transition the PaymentIntent to the canceled state.
|
|
156
162
|
def self.confirm(intent, params = {}, opts = {})
|
|
157
163
|
request_stripe_object(
|
|
158
164
|
method: :post,
|
|
@@ -5,7 +5,7 @@ module Stripe
|
|
|
5
5
|
# A payment method domain represents a web domain that you have registered with Stripe.
|
|
6
6
|
# Stripe Elements use registered payment method domains to control where certain payment methods are shown.
|
|
7
7
|
#
|
|
8
|
-
# Related
|
|
8
|
+
# Related guide: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
|
|
9
9
|
class PaymentMethodDomain < APIResource
|
|
10
10
|
extend Stripe::APIOperations::Create
|
|
11
11
|
extend Stripe::APIOperations::List
|
|
@@ -124,7 +124,7 @@ module Stripe
|
|
|
124
124
|
)
|
|
125
125
|
end
|
|
126
126
|
|
|
127
|
-
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.
|
|
127
|
+
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
|
|
128
128
|
def pdf(params = {}, opts = {}, &read_body_chunk_block)
|
|
129
129
|
config = opts[:client]&.config || Stripe.config
|
|
130
130
|
opts = { api_base: config.uploads_base }.merge(opts)
|
|
@@ -137,7 +137,7 @@ module Stripe
|
|
|
137
137
|
)
|
|
138
138
|
end
|
|
139
139
|
|
|
140
|
-
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.
|
|
140
|
+
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
|
|
141
141
|
def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
|
142
142
|
config = opts[:client]&.config || Stripe.config
|
|
143
143
|
opts = { api_base: config.uploads_base }.merge(opts)
|
|
@@ -56,7 +56,7 @@ module Stripe
|
|
|
56
56
|
request_stripe_object(method: :post, path: "/v1/refunds", params: params, opts: opts)
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
-
# Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object.
|
|
59
|
+
# Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object.
|
|
60
60
|
def self.list(filters = {}, opts = {})
|
|
61
61
|
request_stripe_object(method: :get, path: "/v1/refunds", params: filters, opts: opts)
|
|
62
62
|
end
|
|
@@ -35,7 +35,7 @@ module Stripe
|
|
|
35
35
|
|
|
36
36
|
# You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
|
|
37
37
|
#
|
|
38
|
-
# After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
|
|
38
|
+
# After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
|
|
39
39
|
def cancel(params = {}, opts = {})
|
|
40
40
|
request_stripe_object(
|
|
41
41
|
method: :post,
|
|
@@ -47,7 +47,7 @@ module Stripe
|
|
|
47
47
|
|
|
48
48
|
# You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
|
|
49
49
|
#
|
|
50
|
-
# After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
|
|
50
|
+
# After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
|
|
51
51
|
def self.cancel(intent, params = {}, opts = {})
|
|
52
52
|
request_stripe_object(
|
|
53
53
|
method: :post,
|
|
@@ -115,7 +115,7 @@ module Stripe
|
|
|
115
115
|
|
|
116
116
|
# Updates an existing subscription to match the specified parameters.
|
|
117
117
|
# When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
|
|
118
|
-
# To preview how the proration is calculated, use the [
|
|
118
|
+
# To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint.
|
|
119
119
|
#
|
|
120
120
|
# By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes.
|
|
121
121
|
#
|
|
@@ -123,11 +123,11 @@ module Stripe
|
|
|
123
123
|
#
|
|
124
124
|
#
|
|
125
125
|
# The billing interval is changed (for example, from monthly to yearly).
|
|
126
|
-
# The subscription moves from free to paid
|
|
126
|
+
# The subscription moves from free to paid.
|
|
127
127
|
# A trial starts or ends.
|
|
128
128
|
#
|
|
129
129
|
#
|
|
130
|
-
# In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date.
|
|
130
|
+
# In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment).
|
|
131
131
|
#
|
|
132
132
|
# If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create).
|
|
133
133
|
#
|
|
@@ -14,7 +14,7 @@ module Stripe
|
|
|
14
14
|
"tax.calculation"
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
# Calculates tax based on input and returns a Tax Calculation object.
|
|
17
|
+
# Calculates tax based on the input and returns a Tax Calculation object.
|
|
18
18
|
def self.create(params = {}, opts = {})
|
|
19
19
|
request_stripe_object(
|
|
20
20
|
method: :post,
|
|
@@ -24,7 +24,7 @@ module Stripe
|
|
|
24
24
|
)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
# Retrieves the line items of a
|
|
27
|
+
# Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired.
|
|
28
28
|
def list_line_items(params = {}, opts = {})
|
|
29
29
|
request_stripe_object(
|
|
30
30
|
method: :get,
|
|
@@ -34,7 +34,7 @@ module Stripe
|
|
|
34
34
|
)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
# Retrieves the line items of a
|
|
37
|
+
# Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired.
|
|
38
38
|
def self.list_line_items(calculation, params = {}, opts = {})
|
|
39
39
|
request_stripe_object(
|
|
40
40
|
method: :get,
|
|
@@ -12,7 +12,7 @@ module Stripe
|
|
|
12
12
|
"tax.transaction"
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
# Creates a Tax Transaction from a calculation.
|
|
15
|
+
# Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days.
|
|
16
16
|
def self.create_from_calculation(params = {}, opts = {})
|
|
17
17
|
request_stripe_object(
|
|
18
18
|
method: :post,
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
module Stripe
|
|
5
5
|
module Treasury
|
|
6
|
-
# Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.
|
|
6
|
+
# Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.
|
|
7
|
+
#
|
|
8
|
+
# Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers)
|
|
7
9
|
class InboundTransfer < APIResource
|
|
8
10
|
extend Stripe::APIOperations::Create
|
|
9
11
|
extend Stripe::APIOperations::List
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
module Stripe
|
|
5
5
|
module Treasury
|
|
6
|
-
# Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers).
|
|
6
|
+
# Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers).
|
|
7
7
|
#
|
|
8
8
|
# Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects.
|
|
9
|
+
#
|
|
10
|
+
# Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments)
|
|
9
11
|
class OutboundPayment < APIResource
|
|
10
12
|
extend Stripe::APIOperations::Create
|
|
11
13
|
extend Stripe::APIOperations::List
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
module Stripe
|
|
5
5
|
module Treasury
|
|
6
|
-
# Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
|
|
6
|
+
# Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
|
|
7
7
|
#
|
|
8
8
|
# Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects.
|
|
9
|
+
#
|
|
10
|
+
# Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers)
|
|
9
11
|
class OutboundTransfer < APIResource
|
|
10
12
|
extend Stripe::APIOperations::Create
|
|
11
13
|
extend Stripe::APIOperations::List
|
data/lib/stripe/resources.rb
CHANGED
|
@@ -11,6 +11,7 @@ require "stripe/resources/apps/secret"
|
|
|
11
11
|
require "stripe/resources/balance"
|
|
12
12
|
require "stripe/resources/balance_transaction"
|
|
13
13
|
require "stripe/resources/bank_account"
|
|
14
|
+
require "stripe/resources/billing/alert"
|
|
14
15
|
require "stripe/resources/billing/meter"
|
|
15
16
|
require "stripe/resources/billing/meter_event"
|
|
16
17
|
require "stripe/resources/billing/meter_event_adjustment"
|
|
@@ -55,6 +56,7 @@ require "stripe/resources/identity/verification_session"
|
|
|
55
56
|
require "stripe/resources/invoice"
|
|
56
57
|
require "stripe/resources/invoice_item"
|
|
57
58
|
require "stripe/resources/invoice_line_item"
|
|
59
|
+
require "stripe/resources/invoice_rendering_template"
|
|
58
60
|
require "stripe/resources/issuing/authorization"
|
|
59
61
|
require "stripe/resources/issuing/card"
|
|
60
62
|
require "stripe/resources/issuing/cardholder"
|
data/lib/stripe/stripe_client.rb
CHANGED
|
@@ -366,7 +366,7 @@ module Stripe
|
|
|
366
366
|
# garbage in `Thread.current`.
|
|
367
367
|
attr_accessor :last_responses
|
|
368
368
|
|
|
369
|
-
# A map of connection
|
|
369
|
+
# A map of connection managers for the thread. Normally shared between
|
|
370
370
|
# all `StripeClient` objects on a particular thread, and created so as to
|
|
371
371
|
# minimize the number of open connections that an application needs.
|
|
372
372
|
def default_connection_managers
|
|
@@ -462,6 +462,7 @@ module Stripe
|
|
|
462
462
|
|
|
463
463
|
headers = request_headers(api_key, method)
|
|
464
464
|
.update(Util.normalize_headers(headers))
|
|
465
|
+
|
|
465
466
|
url = api_url(path, api_base)
|
|
466
467
|
|
|
467
468
|
# Merge given query parameters with any already encoded in the path.
|
|
@@ -879,6 +880,7 @@ module Stripe
|
|
|
879
880
|
end
|
|
880
881
|
|
|
881
882
|
headers["Stripe-Version"] = config.api_version if config.api_version
|
|
883
|
+
|
|
882
884
|
headers["Stripe-Account"] = config.stripe_account if config.stripe_account
|
|
883
885
|
|
|
884
886
|
user_agent = @system_profiler.user_agent
|
data/lib/stripe/version.rb
CHANGED
data/lib/stripe.rb
CHANGED
|
@@ -117,6 +117,31 @@ module Stripe
|
|
|
117
117
|
version: version,
|
|
118
118
|
}
|
|
119
119
|
end
|
|
120
|
+
|
|
121
|
+
class RawRequest
|
|
122
|
+
include Stripe::APIOperations::Request
|
|
123
|
+
|
|
124
|
+
def initialize
|
|
125
|
+
@opts = {}
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def execute(method, url, params = {}, opts = {}, usage = [])
|
|
129
|
+
resp, = execute_resource_request(method, url, params, opts, usage)
|
|
130
|
+
|
|
131
|
+
resp
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Sends a request to Stripe REST API
|
|
136
|
+
def self.raw_request(method, url, params = {}, opts = {})
|
|
137
|
+
req = RawRequest.new
|
|
138
|
+
req.execute(method, url, params, opts, ["raw_request"])
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def self.deserialize(data)
|
|
142
|
+
data = JSON.parse(data) if data.is_a?(String)
|
|
143
|
+
Util.convert_to_stripe_object(data, {})
|
|
144
|
+
end
|
|
120
145
|
end
|
|
121
146
|
|
|
122
147
|
Stripe.log_level = ENV["STRIPE_LOG"] unless ENV["STRIPE_LOG"].nil?
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stripe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 12.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stripe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-09-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Stripe is the easiest way to accept payments online. See https://stripe.com
|
|
14
14
|
for details.
|
|
@@ -63,6 +63,7 @@ files:
|
|
|
63
63
|
- lib/stripe/resources/balance.rb
|
|
64
64
|
- lib/stripe/resources/balance_transaction.rb
|
|
65
65
|
- lib/stripe/resources/bank_account.rb
|
|
66
|
+
- lib/stripe/resources/billing/alert.rb
|
|
66
67
|
- lib/stripe/resources/billing/meter.rb
|
|
67
68
|
- lib/stripe/resources/billing/meter_event.rb
|
|
68
69
|
- lib/stripe/resources/billing/meter_event_adjustment.rb
|
|
@@ -107,6 +108,7 @@ files:
|
|
|
107
108
|
- lib/stripe/resources/invoice.rb
|
|
108
109
|
- lib/stripe/resources/invoice_item.rb
|
|
109
110
|
- lib/stripe/resources/invoice_line_item.rb
|
|
111
|
+
- lib/stripe/resources/invoice_rendering_template.rb
|
|
110
112
|
- lib/stripe/resources/issuing/authorization.rb
|
|
111
113
|
- lib/stripe/resources/issuing/card.rb
|
|
112
114
|
- lib/stripe/resources/issuing/cardholder.rb
|