Class: Vantiv::Api::TokenizationResponse

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

Constant Summary collapse

RESPONSE_CODES =
{
  account_successfully_registered: "801",
  account_already_registered: "802",
  credit_card_number_invalid: "820",
  merchant_not_authorized_for_tokens: "821",
  token_not_found: "822",
  token_invalid: "823",
  invalid_paypage_registration_id: "877",
  expired_paypage_registration_id: "878",
  generic_token_registration_error: "898",
  generic_token_use_error: "899"
}

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)


21
22
23
# File 'lib/vantiv/api/tokenization_response.rb', line 21

def failure?
  !success?
end

#invalid_card_number?Boolean

Returns:

  • (Boolean)


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

def invalid_card_number?
  response_code == RESPONSE_CODES[:credit_card_number_invalid]
end

#payment_account_idObject



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

def 
  success? ? litle_transaction_response["PaymentAccountID"] : nil
end

#success?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/vantiv/api/tokenization_response.rb', line 17

def success?
  !api_level_failure? && tokenization_successful?
end