Class: Tray::Checkout::ResponseParser
- Inherits:
-
Object
- Object
- Tray::Checkout::ResponseParser
show all
- Defined in:
- lib/tray/checkout/response_parser.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ResponseParser.
16
17
18
|
# File 'lib/tray/checkout/response_parser.rb', line 16
def initialize(xml)
@xml = xml
end
|
Class Method Details
.get_parser(xml) ⇒ Object
.transaction?(xml) ⇒ Boolean
5
6
7
|
# File 'lib/tray/checkout/response_parser.rb', line 5
def self.transaction?(xml)
xml.include?('<transaction>') || xml.include?('<tmp_transaction>')
end
|
Instance Method Details
#parse ⇒ Object
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/tray/checkout/response_parser.rb', line 20
def parse
response = Tray::Checkout::Response.new
response.success = success?
unless response.success?
response.errors = errors
end
response
end
|