Method: EasyPost::Services::Billing#retrieve_payment_methods

Defined in:
lib/easypost/services/billing.rb

#retrieve_payment_methodsObject

Retrieve all payment methods.



32
33
34
35
36
37
38
39
40
41
# File 'lib/easypost/services/billing.rb', line 32

def retrieve_payment_methods
  response = @client.make_request(:get, '/payment_methods')
  payment_methods = EasyPost::InternalUtilities::Json.convert_json_to_object(response)

  if payment_methods['id'].nil?
    raise EasyPost::Errors::InvalidObjectError.new(EasyPost::Constants::NO_PAYMENT_METHODS)
  end

  payment_methods
end