Class: Vantiv::Api::Response
- Inherits:
-
Object
- Object
- Vantiv::Api::Response
- Defined in:
- lib/vantiv/api/response.rb
Direct Known Subclasses
CaptureResponse, LiveTransactionResponse, TiedTransactionResponse, TokenizationResponse
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#http_response_code ⇒ Object
readonly
Returns the value of attribute http_response_code.
-
#httpok ⇒ Object
readonly
Returns the value of attribute httpok.
Instance Method Summary collapse
- #api_level_failure? ⇒ Boolean
- #load(httpok:, http_response_code:, body:) ⇒ Object
- #message ⇒ Object
-
#request_id ⇒ Object
Only returned by cert API?.
- #response_code ⇒ Object
- #transaction_id ⇒ Object
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/vantiv/api/response.rb', line 4 def body @body end |
#http_response_code ⇒ Object (readonly)
Returns the value of attribute http_response_code.
4 5 6 |
# File 'lib/vantiv/api/response.rb', line 4 def http_response_code @http_response_code end |
#httpok ⇒ Object (readonly)
Returns the value of attribute httpok.
4 5 6 |
# File 'lib/vantiv/api/response.rb', line 4 def httpok @httpok end |
Instance Method Details
#api_level_failure? ⇒ Boolean
17 18 19 20 21 22 23 |
# File 'lib/vantiv/api/response.rb', line 17 def api_level_failure? !httpok || # NOTE: this kind of sucks, but at the commit point, the DevHub # Api sometimes gives 200OK when litle had a parse issue and returns # 'Error validating xml data...' instead of an actual error @body["litleOnlineResponse"]["@message"].match(/error/i) end |
#load(httpok:, http_response_code:, body:) ⇒ Object
6 7 8 9 10 |
# File 'lib/vantiv/api/response.rb', line 6 def load(httpok:, http_response_code:, body:) @httpok = httpok @http_response_code = http_response_code @body = body end |
#message ⇒ Object
25 26 27 |
# File 'lib/vantiv/api/response.rb', line 25 def litle_transaction_response["message"] end |
#request_id ⇒ Object
Only returned by cert API?
13 14 15 |
# File 'lib/vantiv/api/response.rb', line 13 def request_id body["RequestID"] end |
#response_code ⇒ Object
29 30 31 |
# File 'lib/vantiv/api/response.rb', line 29 def response_code litle_transaction_response["response"] end |
#transaction_id ⇒ Object
33 34 35 |
# File 'lib/vantiv/api/response.rb', line 33 def transaction_id litle_transaction_response["TransactionID"] end |