Class: Io::Flow::V0::Clients::VirtualCardRefunds
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::VirtualCardRefunds
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
-
#get(organization, incoming = {}) ⇒ Object
Retrieve all the virtual credit card refunds that have been received for all issued cards matching selected criteria.
-
#get_by_virtual_card_id(organization, virtual_card_id) ⇒ Object
Retrieve payment refunds for a specific virtual credit card that has been previously issued.
-
#initialize(client) ⇒ VirtualCardRefunds
constructor
A new instance of VirtualCardRefunds.
Constructor Details
#initialize(client) ⇒ VirtualCardRefunds
Returns a new instance of VirtualCardRefunds.
3583 3584 3585 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3583 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get(organization, incoming = {}) ⇒ Object
Retrieve all the virtual credit card refunds that have been received for all issued cards matching selected criteria.
3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3589 def get(organization, incoming={}) HttpClient::Preconditions.assert_class('organization', organization, String) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }), :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer), :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer), :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String) }.delete_if { |k, v| v.nil? } r = @client.request("/#{CGI.escape(organization)}/virtual/card/refunds").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::VirtualCardRefund.new(x) } end |
#get_by_virtual_card_id(organization, virtual_card_id) ⇒ Object
Retrieve payment refunds for a specific virtual credit card that has been previously issued.
3604 3605 3606 3607 3608 3609 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3604 def get_by_virtual_card_id(organization, virtual_card_id) HttpClient::Preconditions.assert_class('organization', organization, String) HttpClient::Preconditions.assert_class('virtual_card_id', virtual_card_id, String) r = @client.request("/#{CGI.escape(organization)}/virtual/card/refunds/#{CGI.escape(virtual_card_id)}").get r.map { |x| ::Io::Flow::V0::Models::VirtualCardRefund.new(x) } end |