Class: MPIClient::AccountManagement::Response
- Inherits:
-
Object
- Object
- MPIClient::AccountManagement::Response
- Defined in:
- lib/mpi_client/account_management/response.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#acquirer_bin ⇒ Object
readonly
Returns the value of attribute acquirer_bin.
-
#brand ⇒ Object
readonly
Returns the value of attribute brand.
-
#certificate ⇒ Object
readonly
Returns the value of attribute certificate.
-
#certificate_subject ⇒ Object
readonly
Returns the value of attribute certificate_subject.
-
#client_url ⇒ Object
readonly
Returns the value of attribute client_url.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#directory_server_url ⇒ Object
readonly
Returns the value of attribute directory_server_url.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#merchant_id ⇒ Object
readonly
Returns the value of attribute merchant_id.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
-
#response_source ⇒ Object
readonly
Returns the value of attribute response_source.
-
#response_url ⇒ Object
readonly
Returns the value of attribute response_url.
-
#site_name ⇒ Object
readonly
Returns the value of attribute site_name.
-
#site_url ⇒ Object
readonly
Returns the value of attribute site_url.
-
#term_url ⇒ Object
readonly
Returns the value of attribute term_url.
Instance Method Summary collapse
-
#initialize(response_source) ⇒ Response
constructor
A new instance of Response.
- #parse ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response_source) ⇒ Response
Returns a new instance of Response.
10 11 12 |
# File 'lib/mpi_client/account_management/response.rb', line 10 def initialize(response_source) @response_source = response_source end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def account_id @account_id end |
#acquirer_bin ⇒ Object (readonly)
Returns the value of attribute acquirer_bin.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def acquirer_bin @acquirer_bin end |
#brand ⇒ Object (readonly)
Returns the value of attribute brand.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def brand @brand end |
#certificate ⇒ Object (readonly)
Returns the value of attribute certificate.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def certificate @certificate end |
#certificate_subject ⇒ Object (readonly)
Returns the value of attribute certificate_subject.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def certificate_subject @certificate_subject end |
#client_url ⇒ Object (readonly)
Returns the value of attribute client_url.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def client_url @client_url end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def country_code @country_code end |
#directory_server_url ⇒ Object (readonly)
Returns the value of attribute directory_server_url.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def directory_server_url @directory_server_url end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def error_code @error_code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def @error_message end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def errors @errors end |
#merchant_id ⇒ Object (readonly)
Returns the value of attribute merchant_id.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def merchant_id @merchant_id end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def password @password end |
#private_key ⇒ Object (readonly)
Returns the value of attribute private_key.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def private_key @private_key end |
#response_source ⇒ Object (readonly)
Returns the value of attribute response_source.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def response_source @response_source end |
#response_url ⇒ Object (readonly)
Returns the value of attribute response_url.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def response_url @response_url end |
#site_name ⇒ Object (readonly)
Returns the value of attribute site_name.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def site_name @site_name end |
#site_url ⇒ Object (readonly)
Returns the value of attribute site_url.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def site_url @site_url end |
#term_url ⇒ Object (readonly)
Returns the value of attribute term_url.
4 5 6 |
# File 'lib/mpi_client/account_management/response.rb', line 4 def term_url @term_url end |
Instance Method Details
#parse ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mpi_client/account_management/response.rb', line 18 def parse doc = Nokogiri::XML.parse(response_source) if error = doc.xpath("//Error").first @error_code = error[:code] @error_message = error.text @errors = errors_to_hash else set_account_attributes doc.xpath("//Transaction/*") end end |
#success? ⇒ Boolean
14 15 16 |
# File 'lib/mpi_client/account_management/response.rb', line 14 def success? error_code.nil? && .nil? end |