Class: Vantiv::Api::CaptureResponse

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

Constant Summary collapse

ResponseCodes =
{
  transaction_received: '001',
  # TODO: check this and other possible response codes for this txn,
  #       because currently the API _ONLY_ returns 001... :'(
  invalid_amount: '209'
}

Instance Attribute Summary

Attributes inherited from Response

#body, #http_response_code, #httpok

Instance Method Summary collapse

Methods inherited from Response

#api_level_failure?, #load, #message, #request_id, #response_code, #transaction_id

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/vantiv/api/capture_response.rb', line 15

def failure?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/vantiv/api/capture_response.rb', line 11

def success?
  !api_level_failure? && response_code == ResponseCodes[:transaction_received]
end