| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | module AuthorizeNet::ARB |
||
| 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 |