Class: TransactionGateway::Result

Inherits:
Object
  • Object
show all
Includes:
GatewayErrors
Defined in:
lib/transaction_gateway/result.rb

Constant Summary collapse

BRAINTREE =
'BT'
AUTHORIZEDOTNET =
'ADN'
FORTIS =
'FORTIS'

Instance Method Summary collapse

Instance Method Details

#handle_result(result, gateway) ⇒ Object

HANDLE GETWAY RESPONSE #############

Raises:



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/transaction_gateway/result.rb', line 12

def handle_result(result, gateway)
  case gateway

  when BRAINTREE
    return handle_braintree_result(result)

  when AUTHORIZEDOTNET
    return handle_authorize_net_result(result)

  when FORTIS
    return handle_fortis_result(result)
    
  else
    raise TransactionGatewayNotSupported
  end
  
  raise ConnectionNotMade
end