Class: Adyen::API::Response
- Inherits:
-
Object
- Object
- Adyen::API::Response
- Defined in:
- lib/adyen/api.rb
Direct Known Subclasses
PaymentService::AuthorizationResponse, Adyen::API::RecurringService::DisableResponse, Adyen::API::RecurringService::ListResponse
Instance Attribute Summary collapse
-
#http_response ⇒ Object
readonly
Returns the value of attribute http_response.
Class Method Summary collapse
Instance Method Summary collapse
-
#http_failure? ⇒ Boolean
Whether or not the HTTP request was a success.
-
#initialize(http_response) ⇒ Response
constructor
A new instance of Response.
- #params ⇒ Object
-
#success? ⇒ Boolean
Whether or not the request was successful.
- #xml_querier ⇒ Object
Constructor Details
#initialize(http_response) ⇒ Response
Returns a new instance of Response.
108 109 110 |
# File 'lib/adyen/api.rb', line 108 def initialize(http_response) @http_response = http_response end |
Instance Attribute Details
#http_response ⇒ Object (readonly)
Returns the value of attribute http_response.
106 107 108 |
# File 'lib/adyen/api.rb', line 106 def http_response @http_response end |
Class Method Details
.response_attrs(*attrs) ⇒ Object
100 101 102 103 104 |
# File 'lib/adyen/api.rb', line 100 def self.response_attrs(*attrs) attrs.each do |attr| define_method(attr) { params[attr] } end end |
Instance Method Details
#http_failure? ⇒ Boolean
Returns Whether or not the HTTP request was a success.
118 119 120 |
# File 'lib/adyen/api.rb', line 118 def http_failure? !@http_response.is_a?(Net::HTTPSuccess) end |
#params ⇒ Object
126 127 128 |
# File 'lib/adyen/api.rb', line 126 def params raise "The Adyen::API::Response#params method should be overriden in a subclass." end |
#success? ⇒ Boolean
Returns Whether or not the request was successful.
113 114 115 |
# File 'lib/adyen/api.rb', line 113 def success? !http_failure? end |
#xml_querier ⇒ Object
122 123 124 |
# File 'lib/adyen/api.rb', line 122 def xml_querier @xml_querier ||= XMLQuerier.new(@http_response.body) end |