Completed
Push — master ( 330dad...b4ceb2 )
by
unknown
12s queued 10s
created

Response.subscription_status()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
module AuthorizeNet::ARB
2
  # The ARB response class.
3
  class Response < AuthorizeNet::XmlResponse
4
    # Constructs a new response object from a +raw_response. You don't typically
5
    # construct this object yourself, as AuthorizeNet::ARB::Transaction will
6
    # build one for you when it makes the request to the gateway.
7
    def initialize(raw_response, transaction)
8
      super
9
      unless connection_failure?
10
        begin
11
          @subscription_id = node_content_unless_nil(@root.at_css('subscriptionId'))
12
          @subscription_status = node_content_unless_nil(@root.at_css('Status'))
13
        rescue StandardError
14
          @raw_response = $ERROR_INFO
15
        end
16
      end
17
    end
18
19
    # Returns the subscriptionId from the response if there is one. Otherwise returns nil.
20
    attr_reader :subscription_id
21
22
    # Returns the status of the Subscription from the response if there is one. Otherwise returns nil. This value
23
    # is only returned in response to a get_status transaction.
24
    attr_reader :subscription_status
25
  end
26
end
27