Class: BreadMachine::SecureTrading::XpayResponse
- Inherits:
-
Object
- Object
- BreadMachine::SecureTrading::XpayResponse
- Defined in:
- lib/breadmachine/secure_trading/xpay_response.rb
Direct Known Subclasses
AuthReversalResponse, St3dAuthResponse, St3dCardQueryResponse
Instance Method Summary collapse
-
#error? ⇒ Boolean
Checks whether there has been an error somewhere in the chain of servers which are processing your request (for example, if Visa’s server cacked, or XPay had an internal error, this would come back as true).
-
#initialize(xml) ⇒ XpayResponse
constructor
A new instance of XpayResponse.
- #message ⇒ Object
- #result ⇒ Object
Constructor Details
#initialize(xml) ⇒ XpayResponse
Returns a new instance of XpayResponse.
6 7 8 |
# File 'lib/breadmachine/secure_trading/xpay_response.rb', line 6 def initialize(xml) @xml = Nokogiri::XML.parse(xml) end |
Instance Method Details
#error? ⇒ Boolean
Checks whether there has been an error somewhere in the chain of servers which are processing your request (for example, if Visa’s server cacked, or XPay had an internal error, this would come back as true).
14 15 16 |
# File 'lib/breadmachine/secure_trading/xpay_response.rb', line 14 def error? result == '0' end |
#message ⇒ Object
22 23 24 |
# File 'lib/breadmachine/secure_trading/xpay_response.rb', line 22 def @xml.xpath('//OperationResponse/Message').text end |
#result ⇒ Object
18 19 20 |
# File 'lib/breadmachine/secure_trading/xpay_response.rb', line 18 def result @xml.xpath('//OperationResponse/Result').text end |