Class: Vantiv::Api::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/vantiv/api/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/vantiv/api/response.rb', line 4

def body
  @body
end

#http_response_codeObject (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

#httpokObject (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

Returns:

  • (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

#messageObject



25
26
27
# File 'lib/vantiv/api/response.rb', line 25

def message
  litle_transaction_response["message"]
end

#request_idObject

Only returned by cert API?



13
14
15
# File 'lib/vantiv/api/response.rb', line 13

def request_id
  body["RequestID"]
end

#response_codeObject



29
30
31
# File 'lib/vantiv/api/response.rb', line 29

def response_code
  litle_transaction_response["response"]
end

#transaction_idObject



33
34
35
# File 'lib/vantiv/api/response.rb', line 33

def transaction_id
  litle_transaction_response["TransactionID"]
end