stripe 5.38.0 → 6.0.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 +85 -0
- data/Makefile +7 -0
- data/README.md +3 -3
- data/VERSION +1 -1
- data/lib/stripe/api_operations/search.rb +19 -0
- data/lib/stripe/api_resource.rb +2 -17
- data/lib/stripe/api_resource_test_helpers.rb +47 -0
- data/lib/stripe/connection_manager.rb +22 -1
- data/lib/stripe/object_types.rb +12 -1
- data/lib/stripe/resources/cash_balance.rb +22 -0
- data/lib/stripe/resources/charge.rb +9 -0
- data/lib/stripe/resources/checkout/session.rb +11 -0
- data/lib/stripe/resources/customer.rb +33 -0
- data/lib/stripe/resources/discount.rb +1 -0
- data/lib/stripe/resources/financial_connections/account.rb +31 -0
- data/lib/stripe/resources/financial_connections/account_owner.rb +10 -0
- data/lib/stripe/resources/financial_connections/account_ownership.rb +10 -0
- data/lib/stripe/resources/financial_connections/session.rb +12 -0
- data/lib/stripe/resources/funding_instructions.rb +16 -0
- data/lib/stripe/resources/invoice.rb +9 -0
- data/lib/stripe/resources/issuing/card_details.rb +2 -1
- data/lib/stripe/resources/order.rb +26 -6
- data/lib/stripe/resources/payment_intent.rb +39 -0
- data/lib/stripe/resources/payment_link.rb +23 -0
- data/lib/stripe/resources/price.rb +9 -0
- data/lib/stripe/resources/product.rb +9 -0
- data/lib/stripe/resources/refund.rb +30 -0
- data/lib/stripe/resources/setup_intent.rb +10 -0
- data/lib/stripe/resources/shipping_rate.rb +12 -0
- data/lib/stripe/resources/source_transaction.rb +1 -0
- data/lib/stripe/resources/subscription.rb +9 -0
- data/lib/stripe/resources/terminal/configuration.rb +15 -0
- data/lib/stripe/resources/terminal/reader.rb +60 -0
- data/lib/stripe/resources/test_helpers/test_clock.rb +25 -0
- data/lib/stripe/resources.rb +10 -1
- data/lib/stripe/search_result_object.rb +86 -0
- data/lib/stripe/stripe_client.rb +12 -5
- data/lib/stripe/util.rb +47 -0
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +4 -1
- data/stripe.gemspec +3 -3
- metadata +19 -6
- data/lib/stripe/resources/order_return.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56384c5d588a2d922c4cd813adfd6015bce5169cd334ae8dd6f45c16fcb07392
|
4
|
+
data.tar.gz: 5f9460024d8c4d1b7cd0ac44883d4aa9a3ed52e0104b129bdf0eacfff62e1698
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b53fda899dfd3e44e27482860880228f93c3948425fef83c33ff106504cdae9441a3438488f80416946f653736389491cd5fc0c5e5e6d2ed604ffc50aa6a013
|
7
|
+
data.tar.gz: 602f93db8d61c5f7953e7f930eb7e74d09a0bc01fc02b32277cd6335a12cb93fa7f5c2767b111bac5c4d19a129fc1ed6749780cb8d1285d52e342f87523c47ee
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,90 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 6.0.0 - 2022-05-09
|
4
|
+
* [#1056](https://github.com/stripe/stripe-ruby/pull/1056) API Updates
|
5
|
+
Major version release. The [migration guide](https://github.com/stripe/stripe-ruby/wiki/Migration-Guide-for-v6) contains more information.
|
6
|
+
|
7
|
+
(⚠️ = breaking changes):
|
8
|
+
* ⚠️ Replace the legacy `Order` API with the new `Order` API.
|
9
|
+
* New methods: `cancel`, `list_line_items`, `reopen`, and `submit`
|
10
|
+
* Removed methods: `pay` and `return_order`
|
11
|
+
* Removed resources: `OrderItem` and `OrderReturn`
|
12
|
+
* ⚠️ Rename `FinancialConnections::Account.refresh` to `FinancialConnections::Account.refresh_account
|
13
|
+
|
14
|
+
## 5.55.0 - 2022-05-05
|
15
|
+
* [#1055](https://github.com/stripe/stripe-ruby/pull/1055) API Updates
|
16
|
+
* Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
|
17
|
+
|
18
|
+
|
19
|
+
## 5.54.0 - 2022-05-03
|
20
|
+
* [#1053](https://github.com/stripe/stripe-ruby/pull/1053) API Updates
|
21
|
+
* Add support for new resource `CashBalance`
|
22
|
+
|
23
|
+
## 5.53.0 - 2022-04-21
|
24
|
+
* [#1050](https://github.com/stripe/stripe-ruby/pull/1050) API Updates
|
25
|
+
* Add support for `expire` test helper method on resource `Refund`
|
26
|
+
|
27
|
+
## 5.52.0 - 2022-04-18
|
28
|
+
* [#1046](https://github.com/stripe/stripe-ruby/pull/1046) [#1047](https://github.com/stripe/stripe-ruby/pull/1047) API Updates
|
29
|
+
* Add support for new resources `FundingInstructions` and `Terminal.Configuration`
|
30
|
+
|
31
|
+
## 5.51.0 - 2022-04-15
|
32
|
+
* [#1046](https://github.com/stripe/stripe-ruby/pull/1046) This release was incomplete and was yanked from RubyGems immediately after it was published.
|
33
|
+
|
34
|
+
## 5.50.0 - 2022-04-13
|
35
|
+
* [#1045](https://github.com/stripe/stripe-ruby/pull/1045) API Updates
|
36
|
+
* Add support for `increment_authorization` method on resource `PaymentIntent`
|
37
|
+
|
38
|
+
## 5.49.0 - 2022-04-08
|
39
|
+
* [#1043](https://github.com/stripe/stripe-ruby/pull/1043) API Updates
|
40
|
+
* Add support for `apply_customer_balance` method on resource `PaymentIntent`
|
41
|
+
|
42
|
+
## 5.48.0 - 2022-03-30
|
43
|
+
* [#1041](https://github.com/stripe/stripe-ruby/pull/1041) API Updates
|
44
|
+
* Add support for `cancel_action`, `process_payment_intent`, `process_setup_intent`, and `set_reader_display` methods on resource `Terminal.Reader`
|
45
|
+
|
46
|
+
## 5.47.0 - 2022-03-29
|
47
|
+
* [#1040](https://github.com/stripe/stripe-ruby/pull/1040) API Updates
|
48
|
+
* Add support for Search API
|
49
|
+
* Add support for `search` method on resources `Charge`, `Customer`, `Invoice`, `PaymentIntent`, `Price`, `Product`, and `Subscription`
|
50
|
+
|
51
|
+
* [#1034](https://github.com/stripe/stripe-ruby/pull/1034) Add supporting classes for test helper generation
|
52
|
+
|
53
|
+
## 5.46.0 - 2022-03-23
|
54
|
+
* [#1039](https://github.com/stripe/stripe-ruby/pull/1039) API Updates
|
55
|
+
* Add support for `cancel` method on resource `Refund`
|
56
|
+
* [#992](https://github.com/stripe/stripe-ruby/pull/992) Add support for Search API
|
57
|
+
|
58
|
+
## 5.45.0 - 2022-03-01
|
59
|
+
* [#1035](https://github.com/stripe/stripe-ruby/pull/1035) API Updates
|
60
|
+
* Add support for new resource `TestHelpers.TestClock`
|
61
|
+
|
62
|
+
## 5.44.0 - 2022-02-16
|
63
|
+
* [#1032](https://github.com/stripe/stripe-ruby/pull/1032) API Updates
|
64
|
+
* Add support for `verify_microdeposits` method on resources `PaymentIntent` and `SetupIntent`
|
65
|
+
|
66
|
+
## 5.43.0 - 2022-01-20
|
67
|
+
* [#1031](https://github.com/stripe/stripe-ruby/pull/1031) API Updates
|
68
|
+
* Add support for new resource `PaymentLink`
|
69
|
+
|
70
|
+
## 5.42.0 - 2021-12-13
|
71
|
+
* [#1022](https://github.com/stripe/stripe-ruby/pull/1022) Add connection manager logging and include object IDs in logging.
|
72
|
+
|
73
|
+
## 5.41.0 - 2021-11-16
|
74
|
+
* [#1017](https://github.com/stripe/stripe-ruby/pull/1017) API Updates
|
75
|
+
* Add support for new resource `ShippingRate`
|
76
|
+
|
77
|
+
## 5.40.0 - 2021-11-11
|
78
|
+
* [#1015](https://github.com/stripe/stripe-ruby/pull/1015) API Updates
|
79
|
+
* Add support for `expire` method on resource `Checkout.Session`
|
80
|
+
* [#1013](https://github.com/stripe/stripe-ruby/pull/1013) Add tests for child resources.
|
81
|
+
* [#1012](https://github.com/stripe/stripe-ruby/pull/1012) Add tests for namespaced resources.
|
82
|
+
* [#1011](https://github.com/stripe/stripe-ruby/pull/1011) codegen: 3 more files
|
83
|
+
|
84
|
+
## 5.39.0 - 2021-10-11
|
85
|
+
* [#1010](https://github.com/stripe/stripe-ruby/pull/1010) API Updates
|
86
|
+
* Add support for `list_payment_methods` method on resource `Customer`
|
87
|
+
|
3
88
|
## 5.38.0 - 2021-08-10
|
4
89
|
* [#993](https://github.com/stripe/stripe-ruby/pull/993) Add `request_id` to RequestEndEvent
|
5
90
|
* [#991](https://github.com/stripe/stripe-ruby/pull/991) Codegen more files
|
data/Makefile
ADDED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ The library also provides other features. For example:
|
|
18
18
|
|
19
19
|
## Documentation
|
20
20
|
|
21
|
-
See the [Ruby API docs](https://stripe.com/docs/api
|
21
|
+
See the [Ruby API docs](https://stripe.com/docs/api?lang=ruby).
|
22
22
|
|
23
23
|
See [video demonstrations][youtube-playlist] covering how to use the library.
|
24
24
|
|
@@ -340,9 +340,9 @@ Update the bundled [stripe-mock] by editing the version number found in
|
|
340
340
|
[api-keys]: https://dashboard.stripe.com/account/apikeys
|
341
341
|
[connect]: https://stripe.com/connect
|
342
342
|
[curl]: http://curl.haxx.se/docs/caextract.html
|
343
|
-
[idempotency-keys]: https://stripe.com/docs/api/ruby
|
343
|
+
[idempotency-keys]: https://stripe.com/docs/api/idempotent_requests?lang=ruby
|
344
344
|
[stripe-mock]: https://github.com/stripe/stripe-mock
|
345
|
-
[versioning]: https://stripe.com/docs/api/ruby
|
345
|
+
[versioning]: https://stripe.com/docs/api/versioning?lang=ruby
|
346
346
|
[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M50RmP6ie-gdcSnfOuQCRYk
|
347
347
|
|
348
348
|
<!--
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6.0.0
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Stripe
|
4
|
+
module APIOperations
|
5
|
+
module Search
|
6
|
+
def _search(search_url, filters = {}, opts = {})
|
7
|
+
opts = Util.normalize_opts(opts)
|
8
|
+
|
9
|
+
resp, opts = execute_resource_request(:get, search_url, filters, opts)
|
10
|
+
obj = SearchResultObject.construct_from(resp.data, opts)
|
11
|
+
|
12
|
+
# set filters so that we can fetch the same limit and query
|
13
|
+
# when accessing the next page
|
14
|
+
obj.filters = filters.dup
|
15
|
+
obj
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/stripe/api_resource.rb
CHANGED
@@ -63,22 +63,7 @@ module Stripe
|
|
63
63
|
# adds a `capture` class method to the resource class that, when called,
|
64
64
|
# will send a POST request to `/v1/<object_name>/capture`.
|
65
65
|
def self.custom_method(name, http_verb:, http_path: nil)
|
66
|
-
|
67
|
-
raise ArgumentError,
|
68
|
-
"Invalid http_verb value: #{http_verb.inspect}. Should be one " \
|
69
|
-
"of :get, :post or :delete."
|
70
|
-
end
|
71
|
-
http_path ||= name.to_s
|
72
|
-
define_singleton_method(name) do |id, params = {}, opts = {}|
|
73
|
-
unless id.is_a?(String)
|
74
|
-
raise ArgumentError,
|
75
|
-
"id should be a string representing the ID of an API resource"
|
76
|
-
end
|
77
|
-
|
78
|
-
url = "#{resource_url}/#{CGI.escape(id)}/#{CGI.escape(http_path)}"
|
79
|
-
resp, opts = execute_resource_request(http_verb, url, params, opts)
|
80
|
-
Util.convert_to_stripe_object(resp.data, opts)
|
81
|
-
end
|
66
|
+
Util.custom_method self, self, name, http_verb, http_path
|
82
67
|
end
|
83
68
|
|
84
69
|
def resource_url
|
@@ -105,7 +90,7 @@ module Stripe
|
|
105
90
|
instance
|
106
91
|
end
|
107
92
|
|
108
|
-
|
93
|
+
def request_stripe_object(method:, path:, params:, opts: {})
|
109
94
|
resp, opts = execute_resource_request(method, path, params, opts)
|
110
95
|
|
111
96
|
# If we're getting back this thing, update; otherwise, instantiate.
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Stripe
|
4
|
+
# The base class for nested TestHelpers classes in resource objects.
|
5
|
+
# The APIResourceTestHelpers handles URL generation and custom method
|
6
|
+
# support for test-helper methods.
|
7
|
+
#
|
8
|
+
# class MyAPIResource < APIResource
|
9
|
+
# class TestHelpers < APIResourceTestHelpers
|
10
|
+
class APIResourceTestHelpers
|
11
|
+
def initialize(resource)
|
12
|
+
@resource = resource
|
13
|
+
end
|
14
|
+
|
15
|
+
# Adds a custom method to a test helper. This is used to add support for
|
16
|
+
# non-CRUDL API requests, e.g. capturing charges. custom_method takes the
|
17
|
+
# following parameters:
|
18
|
+
# - name: the name of the custom method to create (as a symbol)
|
19
|
+
# - http_verb: the HTTP verb for the API request (:get, :post, or :delete)
|
20
|
+
# - http_path: the path to append to the resource's URL. If not provided,
|
21
|
+
# the name is used as the path
|
22
|
+
#
|
23
|
+
# For example, this call:
|
24
|
+
# custom_method :capture, http_verb: post
|
25
|
+
# adds a `capture` class method to the resource class that, when called,
|
26
|
+
# will send a POST request to `/v1/<object_name>/capture`.
|
27
|
+
def self.custom_method(name, http_verb:, http_path: nil)
|
28
|
+
Util.custom_method self::RESOURCE_CLASS, self, name, http_verb, http_path
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.resource_url
|
32
|
+
"/v1/test_helpers/"\
|
33
|
+
"#{self::RESOURCE_CLASS::OBJECT_NAME.downcase.tr('.', '/')}s"
|
34
|
+
end
|
35
|
+
|
36
|
+
def resource_url
|
37
|
+
unless (id = @resource["id"])
|
38
|
+
raise InvalidRequestError.new(
|
39
|
+
"Could not determine which URL to request: #{self.class} instance " \
|
40
|
+
"has invalid ID: #{id.inspect}",
|
41
|
+
"id"
|
42
|
+
)
|
43
|
+
end
|
44
|
+
"#{self.class.resource_url}/#{CGI.escape(id)}"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -103,13 +103,34 @@ module Stripe
|
|
103
103
|
headers
|
104
104
|
)
|
105
105
|
|
106
|
-
|
106
|
+
Util.log_debug("ConnectionManager starting request",
|
107
|
+
method_name: method_name,
|
108
|
+
path: path,
|
109
|
+
process_id: Process.pid,
|
110
|
+
thread_object_id: Thread.current.object_id,
|
111
|
+
connection_manager_object_id: object_id,
|
112
|
+
connection_object_id: connection.object_id,
|
113
|
+
log_timestamp: Util.monotonic_time)
|
114
|
+
|
115
|
+
resp = @mutex.synchronize do
|
107
116
|
# The block parameter is special here. If a block is provided, the block
|
108
117
|
# is invoked with the Net::HTTPResponse. However, the body will not have
|
109
118
|
# been read yet in the block, and can be streamed by calling
|
110
119
|
# HTTPResponse#read_body.
|
111
120
|
connection.request(request, body, &block)
|
112
121
|
end
|
122
|
+
|
123
|
+
Util.log_debug("ConnectionManager request complete",
|
124
|
+
method_name: method_name,
|
125
|
+
path: path,
|
126
|
+
process_id: Process.pid,
|
127
|
+
thread_object_id: Thread.current.object_id,
|
128
|
+
connection_manager_object_id: object_id,
|
129
|
+
connection_object_id: connection.object_id,
|
130
|
+
response_object_id: resp.object_id,
|
131
|
+
log_timestamp: Util.monotonic_time)
|
132
|
+
|
133
|
+
resp
|
113
134
|
end
|
114
135
|
|
115
136
|
#
|
data/lib/stripe/object_types.rb
CHANGED
@@ -9,6 +9,7 @@ module Stripe
|
|
9
9
|
{
|
10
10
|
# data structures
|
11
11
|
ListObject::OBJECT_NAME => ListObject,
|
12
|
+
SearchResultObject::OBJECT_NAME => SearchResultObject,
|
12
13
|
|
13
14
|
# business objects
|
14
15
|
Account::OBJECT_NAME => Account,
|
@@ -26,6 +27,7 @@ module Stripe
|
|
26
27
|
BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
|
27
28
|
Capability::OBJECT_NAME => Capability,
|
28
29
|
Card::OBJECT_NAME => Card,
|
30
|
+
CashBalance::OBJECT_NAME => CashBalance,
|
29
31
|
Charge::OBJECT_NAME => Charge,
|
30
32
|
Checkout::Session::OBJECT_NAME => Checkout::Session,
|
31
33
|
CountrySpec::OBJECT_NAME => CountrySpec,
|
@@ -42,6 +44,12 @@ module Stripe
|
|
42
44
|
File::OBJECT_NAME => File,
|
43
45
|
File::OBJECT_NAME_ALT => File,
|
44
46
|
FileLink::OBJECT_NAME => FileLink,
|
47
|
+
FinancialConnections::Account::OBJECT_NAME => FinancialConnections::Account,
|
48
|
+
FinancialConnections::AccountOwner::OBJECT_NAME => FinancialConnections::AccountOwner,
|
49
|
+
FinancialConnections::AccountOwnership::OBJECT_NAME =>
|
50
|
+
FinancialConnections::AccountOwnership,
|
51
|
+
FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
|
52
|
+
FundingInstructions::OBJECT_NAME => FundingInstructions,
|
45
53
|
Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
|
46
54
|
Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
|
47
55
|
Invoice::OBJECT_NAME => Invoice,
|
@@ -57,8 +65,8 @@ module Stripe
|
|
57
65
|
LoginLink::OBJECT_NAME => LoginLink,
|
58
66
|
Mandate::OBJECT_NAME => Mandate,
|
59
67
|
Order::OBJECT_NAME => Order,
|
60
|
-
OrderReturn::OBJECT_NAME => OrderReturn,
|
61
68
|
PaymentIntent::OBJECT_NAME => PaymentIntent,
|
69
|
+
PaymentLink::OBJECT_NAME => PaymentLink,
|
62
70
|
PaymentMethod::OBJECT_NAME => PaymentMethod,
|
63
71
|
Payout::OBJECT_NAME => Payout,
|
64
72
|
Person::OBJECT_NAME => Person,
|
@@ -79,6 +87,7 @@ module Stripe
|
|
79
87
|
Review::OBJECT_NAME => Review,
|
80
88
|
SetupAttempt::OBJECT_NAME => SetupAttempt,
|
81
89
|
SetupIntent::OBJECT_NAME => SetupIntent,
|
90
|
+
ShippingRate::OBJECT_NAME => ShippingRate,
|
82
91
|
Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
|
83
92
|
SKU::OBJECT_NAME => SKU,
|
84
93
|
Source::OBJECT_NAME => Source,
|
@@ -89,9 +98,11 @@ module Stripe
|
|
89
98
|
TaxCode::OBJECT_NAME => TaxCode,
|
90
99
|
TaxId::OBJECT_NAME => TaxId,
|
91
100
|
TaxRate::OBJECT_NAME => TaxRate,
|
101
|
+
Terminal::Configuration::OBJECT_NAME => Terminal::Configuration,
|
92
102
|
Terminal::ConnectionToken::OBJECT_NAME => Terminal::ConnectionToken,
|
93
103
|
Terminal::Location::OBJECT_NAME => Terminal::Location,
|
94
104
|
Terminal::Reader::OBJECT_NAME => Terminal::Reader,
|
105
|
+
TestHelpers::TestClock::OBJECT_NAME => TestHelpers::TestClock,
|
95
106
|
ThreeDSecure::OBJECT_NAME => ThreeDSecure,
|
96
107
|
Token::OBJECT_NAME => Token,
|
97
108
|
Topup::OBJECT_NAME => Topup,
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class CashBalance < APIResource
|
6
|
+
OBJECT_NAME = "cash_balance"
|
7
|
+
|
8
|
+
def resource_url
|
9
|
+
if !respond_to?(:customer) || customer.nil?
|
10
|
+
raise NotImplementedError,
|
11
|
+
"Customer Cash Balance cannot be accessed without a customer ID."
|
12
|
+
end
|
13
|
+
"#{Customer.resource_url}/#{CGI.escape(customer)}/cash_balance"
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.retrieve(_id, _opts = {})
|
17
|
+
raise NotImplementedError,
|
18
|
+
"Customer Cash Balance cannot be retrieved without a customer ID. " \
|
19
|
+
"Retrieve a Customer Cash Balance using `Customer.retrieve_cash_balance('cus_123')`"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -5,6 +5,7 @@ module Stripe
|
|
5
5
|
class Charge < APIResource
|
6
6
|
extend Stripe::APIOperations::Create
|
7
7
|
extend Stripe::APIOperations::List
|
8
|
+
extend Stripe::APIOperations::Search
|
8
9
|
include Stripe::APIOperations::Save
|
9
10
|
|
10
11
|
OBJECT_NAME = "charge"
|
@@ -19,5 +20,13 @@ module Stripe
|
|
19
20
|
opts: opts
|
20
21
|
)
|
21
22
|
end
|
23
|
+
|
24
|
+
def self.search(params = {}, opts = {})
|
25
|
+
_search("/v1/charges/search", params, opts)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
29
|
+
search(params, opts).auto_paging_each(&blk)
|
30
|
+
end
|
22
31
|
end
|
23
32
|
end
|
@@ -10,7 +10,18 @@ module Stripe
|
|
10
10
|
|
11
11
|
OBJECT_NAME = "checkout.session"
|
12
12
|
|
13
|
+
custom_method :expire, http_verb: :post
|
14
|
+
|
13
15
|
nested_resource_class_methods :line_item, operations: %i[list]
|
16
|
+
|
17
|
+
def expire(params = {}, opts = {})
|
18
|
+
request_stripe_object(
|
19
|
+
method: :post,
|
20
|
+
path: resource_url + "/expire",
|
21
|
+
params: params,
|
22
|
+
opts: opts
|
23
|
+
)
|
24
|
+
end
|
14
25
|
end
|
15
26
|
end
|
16
27
|
end
|
@@ -6,16 +6,41 @@ module Stripe
|
|
6
6
|
extend Stripe::APIOperations::Create
|
7
7
|
include Stripe::APIOperations::Delete
|
8
8
|
extend Stripe::APIOperations::List
|
9
|
+
extend Stripe::APIOperations::Search
|
9
10
|
include Stripe::APIOperations::Save
|
10
11
|
extend Stripe::APIOperations::NestedResource
|
11
12
|
|
12
13
|
OBJECT_NAME = "customer"
|
13
14
|
|
15
|
+
custom_method :create_funding_instructions, http_verb: :post, http_path: "funding_instructions"
|
16
|
+
custom_method :list_payment_methods, http_verb: :get, http_path: "payment_methods"
|
17
|
+
|
18
|
+
nested_resource_class_methods :cash_balance,
|
19
|
+
operations: %i[retrieve update],
|
20
|
+
resource_plural: "cash_balance"
|
14
21
|
nested_resource_class_methods :balance_transaction,
|
15
22
|
operations: %i[create retrieve update list]
|
16
23
|
nested_resource_class_methods :tax_id,
|
17
24
|
operations: %i[create retrieve delete list]
|
18
25
|
|
26
|
+
def create_funding_instructions(params = {}, opts = {})
|
27
|
+
request_stripe_object(
|
28
|
+
method: :post,
|
29
|
+
path: resource_url + "/funding_instructions",
|
30
|
+
params: params,
|
31
|
+
opts: opts
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def list_payment_methods(params = {}, opts = {})
|
36
|
+
request_stripe_object(
|
37
|
+
method: :get,
|
38
|
+
path: resource_url + "/payment_methods",
|
39
|
+
params: params,
|
40
|
+
opts: opts
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
19
44
|
custom_method :delete_discount, http_verb: :delete, http_path: "discount"
|
20
45
|
|
21
46
|
save_nested_resource :source
|
@@ -37,5 +62,13 @@ module Stripe
|
|
37
62
|
resp, opts = execute_resource_request(:delete, resource_url + "/discount")
|
38
63
|
Util.convert_to_stripe_object(resp.data, opts)
|
39
64
|
end
|
65
|
+
|
66
|
+
def self.search(params = {}, opts = {})
|
67
|
+
_search("/v1/customers/search", params, opts)
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
71
|
+
search(params, opts).auto_paging_each(&blk)
|
72
|
+
end
|
40
73
|
end
|
41
74
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module FinancialConnections
|
6
|
+
class Account < APIResource
|
7
|
+
OBJECT_NAME = "financial_connections.account"
|
8
|
+
|
9
|
+
custom_method :disconnect, http_verb: :post
|
10
|
+
custom_method :refresh_account, http_verb: :post, http_path: "refresh"
|
11
|
+
|
12
|
+
def disconnect(params = {}, opts = {})
|
13
|
+
request_stripe_object(
|
14
|
+
method: :post,
|
15
|
+
path: resource_url + "/disconnect",
|
16
|
+
params: params,
|
17
|
+
opts: opts
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
def refresh_account(params = {}, opts = {})
|
22
|
+
request_stripe_object(
|
23
|
+
method: :post,
|
24
|
+
path: resource_url + "/refresh",
|
25
|
+
params: params,
|
26
|
+
opts: opts
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module FinancialConnections
|
6
|
+
class Session < APIResource
|
7
|
+
extend Stripe::APIOperations::Create
|
8
|
+
|
9
|
+
OBJECT_NAME = "financial_connections.session"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class FundingInstructions < APIResource
|
6
|
+
OBJECT_NAME = "funding_instructions"
|
7
|
+
|
8
|
+
def resource_url
|
9
|
+
if !respond_to?(:customer) || customer.nil?
|
10
|
+
raise NotImplementedError,
|
11
|
+
"FundingInstructions cannot be accessed without a customer ID."
|
12
|
+
end
|
13
|
+
"#{Customer.resource_url}/#{CGI.escape(customer)}/funding_instructions" "/#{CGI.escape(id)}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -6,6 +6,7 @@ module Stripe
|
|
6
6
|
extend Stripe::APIOperations::Create
|
7
7
|
include Stripe::APIOperations::Delete
|
8
8
|
extend Stripe::APIOperations::List
|
9
|
+
extend Stripe::APIOperations::Search
|
9
10
|
include Stripe::APIOperations::Save
|
10
11
|
|
11
12
|
OBJECT_NAME = "invoice"
|
@@ -70,5 +71,13 @@ module Stripe
|
|
70
71
|
resp, opts = execute_resource_request(:get, resource_url + "/upcoming/lines", params, opts)
|
71
72
|
Util.convert_to_stripe_object(resp.data, opts)
|
72
73
|
end
|
74
|
+
|
75
|
+
def self.search(params = {}, opts = {})
|
76
|
+
_search("/v1/invoices/search", params, opts)
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
80
|
+
search(params, opts).auto_paging_each(&blk)
|
81
|
+
end
|
73
82
|
end
|
74
83
|
end
|
@@ -9,22 +9,42 @@ module Stripe
|
|
9
9
|
|
10
10
|
OBJECT_NAME = "order"
|
11
11
|
|
12
|
-
custom_method :
|
13
|
-
custom_method :
|
12
|
+
custom_method :cancel, http_verb: :post
|
13
|
+
custom_method :list_line_items, http_verb: :get, http_path: "line_items"
|
14
|
+
custom_method :reopen, http_verb: :post
|
15
|
+
custom_method :submit, http_verb: :post
|
14
16
|
|
15
|
-
def
|
17
|
+
def cancel(params = {}, opts = {})
|
16
18
|
request_stripe_object(
|
17
19
|
method: :post,
|
18
|
-
path: resource_url + "/
|
20
|
+
path: resource_url + "/cancel",
|
19
21
|
params: params,
|
20
22
|
opts: opts
|
21
23
|
)
|
22
24
|
end
|
23
25
|
|
24
|
-
def
|
26
|
+
def list_line_items(params = {}, opts = {})
|
27
|
+
request_stripe_object(
|
28
|
+
method: :get,
|
29
|
+
path: resource_url + "/line_items",
|
30
|
+
params: params,
|
31
|
+
opts: opts
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def reopen(params = {}, opts = {})
|
36
|
+
request_stripe_object(
|
37
|
+
method: :post,
|
38
|
+
path: resource_url + "/reopen",
|
39
|
+
params: params,
|
40
|
+
opts: opts
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def submit(params = {}, opts = {})
|
25
45
|
request_stripe_object(
|
26
46
|
method: :post,
|
27
|
-
path: resource_url + "/
|
47
|
+
path: resource_url + "/submit",
|
28
48
|
params: params,
|
29
49
|
opts: opts
|
30
50
|
)
|