Class: AuthorizeNet::ARB::Response

Inherits:
XmlResponse show all
Defined in:
lib/authorize_net/arb/response.rb

Overview

The ARB response class.

Constant Summary

Constants included from TypeConversions

TypeConversions::API_FIELD_PREFIX

Instance Attribute Summary collapse

Attributes inherited from XmlResponse

#message_code, #message_text, #reference_id, #result_code

Instance Method Summary collapse

Methods inherited from XmlResponse

#connection_failure?, #raw, #response_code, #response_reason_code, #response_reason_text, #success?, #xml

Methods inherited from Response

#success?

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.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/authorize_net/arb/response.rb', line 7

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 StandardError
      @raw_response = $ERROR_INFO
    end
  end
end

Instance Attribute Details

#subscription_idObject (readonly)

Returns the subscriptionId from the response if there is one. Otherwise returns nil.



20
21
22
# File 'lib/authorize_net/arb/response.rb', line 20

def subscription_id
  @subscription_id
end

#subscription_statusObject (readonly)

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.



24
25
26
# File 'lib/authorize_net/arb/response.rb', line 24

def subscription_status
  @subscription_status
end