stripe 5.38.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +85 -0
  3. data/Makefile +7 -0
  4. data/README.md +3 -3
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_operations/search.rb +19 -0
  7. data/lib/stripe/api_resource.rb +2 -17
  8. data/lib/stripe/api_resource_test_helpers.rb +47 -0
  9. data/lib/stripe/connection_manager.rb +22 -1
  10. data/lib/stripe/object_types.rb +12 -1
  11. data/lib/stripe/resources/cash_balance.rb +22 -0
  12. data/lib/stripe/resources/charge.rb +9 -0
  13. data/lib/stripe/resources/checkout/session.rb +11 -0
  14. data/lib/stripe/resources/customer.rb +33 -0
  15. data/lib/stripe/resources/discount.rb +1 -0
  16. data/lib/stripe/resources/financial_connections/account.rb +31 -0
  17. data/lib/stripe/resources/financial_connections/account_owner.rb +10 -0
  18. data/lib/stripe/resources/financial_connections/account_ownership.rb +10 -0
  19. data/lib/stripe/resources/financial_connections/session.rb +12 -0
  20. data/lib/stripe/resources/funding_instructions.rb +16 -0
  21. data/lib/stripe/resources/invoice.rb +9 -0
  22. data/lib/stripe/resources/issuing/card_details.rb +2 -1
  23. data/lib/stripe/resources/order.rb +26 -6
  24. data/lib/stripe/resources/payment_intent.rb +39 -0
  25. data/lib/stripe/resources/payment_link.rb +23 -0
  26. data/lib/stripe/resources/price.rb +9 -0
  27. data/lib/stripe/resources/product.rb +9 -0
  28. data/lib/stripe/resources/refund.rb +30 -0
  29. data/lib/stripe/resources/setup_intent.rb +10 -0
  30. data/lib/stripe/resources/shipping_rate.rb +12 -0
  31. data/lib/stripe/resources/source_transaction.rb +1 -0
  32. data/lib/stripe/resources/subscription.rb +9 -0
  33. data/lib/stripe/resources/terminal/configuration.rb +15 -0
  34. data/lib/stripe/resources/terminal/reader.rb +60 -0
  35. data/lib/stripe/resources/test_helpers/test_clock.rb +25 -0
  36. data/lib/stripe/resources.rb +10 -1
  37. data/lib/stripe/search_result_object.rb +86 -0
  38. data/lib/stripe/stripe_client.rb +12 -5
  39. data/lib/stripe/util.rb +47 -0
  40. data/lib/stripe/version.rb +1 -1
  41. data/lib/stripe.rb +4 -1
  42. data/stripe.gemspec +3 -3
  43. metadata +19 -6
  44. data/lib/stripe/resources/order_return.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c7a2e67a4d91e1a22dff9303644b5f2efb74675bce05e364fff8d287f3fa8bd
4
- data.tar.gz: a560d866c948d0bbc8f3389571c313da67a26650a771159fa785d7a1e3beccc9
3
+ metadata.gz: 56384c5d588a2d922c4cd813adfd6015bce5169cd334ae8dd6f45c16fcb07392
4
+ data.tar.gz: 5f9460024d8c4d1b7cd0ac44883d4aa9a3ed52e0104b129bdf0eacfff62e1698
5
5
  SHA512:
6
- metadata.gz: a257d84bec5ef9fe3005b362da5c5194a71e257e77baa71c5872b990fefc3e3ee7cc26201d773cf4f5ca29af0fd8b2d3f3b047e11a833c51aba7bca2f6b3947a
7
- data.tar.gz: eae3ef2579f9ce37a5e447cd46ca67bdfebc2324e5767cc0925d7f2bee5d8f289a69512ff9221cb28bdd9c4ec39a8cea1f7b5af14b67d18b2fa8a3c9ce7dbb47
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
@@ -0,0 +1,7 @@
1
+ .PHONY: update-version codegen-format
2
+ update-version:
3
+ @echo "$(VERSION)" > VERSION
4
+ @perl -pi -e 's|VERSION = "[.\d]+"|VERSION = "$(VERSION)"|' lib/stripe/version.rb
5
+
6
+ codegen-format:
7
+ bundle exec rubocop -o /dev/null --auto-correct
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/ruby#intro).
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#idempotent_requests
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#versioning
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
- 5.38.0
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
@@ -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
- unless %i[get post delete].include?(http_verb)
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
- protected def request_stripe_object(method:, path:, params:, opts: {})
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
- @mutex.synchronize do
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
  #
@@ -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
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -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,10 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module FinancialConnections
6
+ class AccountOwner < StripeObject
7
+ OBJECT_NAME = "financial_connections.account_owner"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module FinancialConnections
6
+ class AccountOwnership < StripeObject
7
+ OBJECT_NAME = "financial_connections.account_ownership"
8
+ end
9
+ end
10
+ 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
@@ -1,8 +1,9 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
4
5
  module Issuing
5
- class CardDetails < Stripe::StripeObject
6
+ class CardDetails < StripeObject
6
7
  OBJECT_NAME = "issuing.card_details"
7
8
  end
8
9
  end
@@ -9,22 +9,42 @@ module Stripe
9
9
 
10
10
  OBJECT_NAME = "order"
11
11
 
12
- custom_method :pay, http_verb: :post
13
- custom_method :return_order, http_verb: :post, http_path: "returns"
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 pay(params = {}, opts = {})
17
+ def cancel(params = {}, opts = {})
16
18
  request_stripe_object(
17
19
  method: :post,
18
- path: resource_url + "/pay",
20
+ path: resource_url + "/cancel",
19
21
  params: params,
20
22
  opts: opts
21
23
  )
22
24
  end
23
25
 
24
- def return_order(params = {}, opts = {})
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 + "/returns",
47
+ path: resource_url + "/submit",
28
48
  params: params,
29
49
  opts: opts
30
50
  )