Class: Io::Flow::V0::Clients::PaymentMethods
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::PaymentMethods
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
-
#get(incoming = {}) ⇒ Object
Returns a list of payment methods supported by Flow.
-
#initialize(client) ⇒ PaymentMethods
constructor
A new instance of PaymentMethods.
Constructor Details
#initialize(client) ⇒ PaymentMethods
Returns a new instance of PaymentMethods.
5130 5131 5132 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5130 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get(incoming = {}) ⇒ Object
Returns a list of payment methods supported by Flow.
5135 5136 5137 5138 5139 5140 5141 5142 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5135 def get(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String)) }.delete_if { |k, v| v.nil? } r = @client.request("/reference/payment/methods").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::PaymentMethod.new(x) } end |