Skip to content

Commit

Permalink
chore: Stop special implementation of Account.persons method. (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcr-stripe authored Jun 8, 2022
1 parent d5ec3ea commit ad84b25
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/stripe/resources/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Account < APIResource

OBJECT_NAME = "account"

custom_method :persons, http_verb: :get
custom_method :reject, http_verb: :post

nested_resource_class_methods :capability,
Expand All @@ -20,6 +21,15 @@ class Account < APIResource
nested_resource_class_methods :person,
operations: %i[create retrieve update delete list]

def persons(params = {}, opts = {})
request_stripe_object(
method: :get,
path: resource_url + "/persons",
params: params,
opts: opts
)
end

def reject(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down Expand Up @@ -60,11 +70,6 @@ def self.retrieve(id = nil, opts = {})
super(id, opts)
end

def persons(params = {}, opts = {})
resp, opts = execute_resource_request(:get, resource_url + "/persons", params, opts)
Util.convert_to_stripe_object(resp.data, opts)
end

# We are not adding a helper for capabilities here as the Account object
# already has a capabilities property which is a hash and not the sub-list
# of capabilities.
Expand Down

0 comments on commit ad84b25

Please sign in to comment.