diff --git a/lib/stripe/resources/bank_account.rb b/lib/stripe/resources/bank_account.rb index 3b578f13b..180b1d218 100644 --- a/lib/stripe/resources/bank_account.rb +++ b/lib/stripe/resources/bank_account.rb @@ -94,10 +94,12 @@ def self.verify(customer, id, params = {}, opts = {}) end def resource_url - if respond_to?(:customer) + if !customer.nil? "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}" - elsif respond_to?(:account) + elsif !account.nil? "#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}" + else + raise InvalidRequestError, "Could not determine which URL to request: [account, customer] fields are all null" end end