class Vantiv::Api::LiveTransactionResponse
Constants
- LIVE_TRANSACTION_RESPONSE_NAMES
- RESPONSE_CODES
Public Class Methods
new(transaction_name)
click to toggle source
# File lib/vantiv/api/live_transaction_response.rb, line 19 def initialize(transaction_name) unless @transaction_response_name = LIVE_TRANSACTION_RESPONSE_NAMES[transaction_name] raise "Implementation Error: Live transactions do not include #{transaction_name}" end end
Public Instance Methods
account_updater()
click to toggle source
# File lib/vantiv/api/live_transaction_response.rb, line 45 def account_updater @account_updater ||= litle_transaction_response.account_updater || AccountUpdaterResponse.new end
expired_card?()
click to toggle source
# File lib/vantiv/api/live_transaction_response.rb, line 41 def expired_card? response_code == RESPONSE_CODES[:expired_card] end
failure?()
click to toggle source
# File lib/vantiv/api/live_transaction_response.rb, line 29 def failure? !success? end
insufficient_funds?()
click to toggle source
# File lib/vantiv/api/live_transaction_response.rb, line 33 def insufficient_funds? response_code == RESPONSE_CODES[:insufficient_funds] end
invalid_account_number?()
click to toggle source
# File lib/vantiv/api/live_transaction_response.rb, line 37 def invalid_account_number? response_code == RESPONSE_CODES[:invalid_account_number] end
network_transaction_id()
click to toggle source
# File lib/vantiv/api/live_transaction_response.rb, line 50 def network_transaction_id litle_transaction_response.network_transaction_id end
success?()
click to toggle source
# File lib/vantiv/api/live_transaction_response.rb, line 25 def success? !api_level_failure? && transaction_approved? end
Private Instance Methods
transaction_approved?()
click to toggle source
# File lib/vantiv/api/live_transaction_response.rb, line 55 def transaction_approved? response_code == RESPONSE_CODES[:approved] end