Class: Ideal::DirectoryResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/ideal/response.rb

Overview

An instance of DirectoryResponse is returned from Gateway#issuers which returns the list of issuers available at the acquirer.

Instance Attribute Summary

Attributes inherited from Response

#response

Instance Method Summary collapse

Methods inherited from Response

#consumer_error_message, #error_code, #error_details, #error_message, #error_type, #initialize, #success?, #test?

Constructor Details

This class inherits a constructor from Ideal::Response

Instance Method Details

#listObject

Returns a list of issuers available at the acquirer.

gateway.issuers.list # => [{ :id => '1006', :name => 'ABN AMRO Bank' }]

263
264
265
266
267
268
269
270
271
272
# File 'lib/ideal/response.rb', line 263

def list
  list = Array.new
  @response.xpath(".//Country").each { |country|
    country_name = country.xpath(".//countryNames").first.text()
    country.xpath(".//Issuer").each { |issuer|
      list << {:id => issuer.xpath(".//issuerID").first.text(), :country => country_name, :name => issuer.xpath(".//issuerName").first.text()}
    }
  }
  list
end