Class: AuthorizeNet::ARB::Response
- Inherits:
-
XmlResponse
- Object
- Response
- XmlResponse
- AuthorizeNet::ARB::Response
- Defined in:
- lib/authorize_net/arb/response.rb
Overview
The ARB response class.
Constant Summary
Constants included from TypeConversions
TypeConversions::API_FIELD_PREFIX
Instance Method Summary collapse
-
#initialize(raw_response, transaction) ⇒ Response
constructor
Constructs a new response object from a +raw_response.
-
#subscription_id ⇒ Object
Returns the subscriptionId from the response if there is one.
-
#subscription_status ⇒ Object
Returns the status of the Subscription from the response if there is one.
Methods inherited from XmlResponse
#connection_failure?, #message_code, #message_text, #raw, #reference_id, #response_code, #response_reason_code, #response_reason_text, #result_code, #success?, #xml
Methods inherited from Response
Methods included from TypeConversions
#boolean_to_value, #date_to_value, #datetime_to_value, #decimal_to_value, #integer_to_value, #to_external_field, #to_internal_field, #to_param, #value_to_boolean, #value_to_date, #value_to_datetime, #value_to_decimal, #value_to_integer
Constructor Details
#initialize(raw_response, transaction) ⇒ Response
Constructs a new response object from a +raw_response. You don’t typically construct this object yourself, as AuthorizeNet::ARB::Transaction will build one for you when it makes the request to the gateway.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/authorize_net/arb/response.rb', line 9 def initialize(raw_response, transaction) super unless connection_failure? begin @subscription_id = node_content_unless_nil(@root.at_css('subscriptionId')) @subscription_status = node_content_unless_nil(@root.at_css('Status')) rescue @raw_response = $! end end end |
Instance Method Details
#subscription_id ⇒ Object
Returns the subscriptionId from the response if there is one. Otherwise returns nil.
22 23 24 |
# File 'lib/authorize_net/arb/response.rb', line 22 def subscription_id @subscription_id end |
#subscription_status ⇒ Object
Returns the status of the Subscription from the response if there is one. Otherwise returns nil. This value is only returned in response to a get_status transaction.
28 29 30 |
# File 'lib/authorize_net/arb/response.rb', line 28 def subscription_status @subscription_status end |