From ad84b25e8e20469d7432347a6d308373616531ec Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com> Date: Wed, 8 Jun 2022 12:27:51 -0400 Subject: [PATCH] chore: Stop special implementation of Account.persons method. (#1069) --- lib/stripe/resources/account.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index 53e96d0df..f94af1545 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -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, @@ -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, @@ -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.