Class: ActiveMerchant::Billing::WebTehXmlGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/web_teh_xml.rb

Constant Summary collapse

REQUEST_APPROVED =

Constants

"approved"
RESPONSE_TYPE =
{
  :secure_3d => "secure-message",
  :error => "errors"
}

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ WebTehXmlGateway

TODO: process response code in response message from authentification/purchase



41
42
43
44
45
46
47
# File 'lib/web_teh_xml.rb', line 41

def initialize(options = {})
  requires!(options, :login, :password, :key, :auth_token)
  @key = options[ :key ]
  @auth_token = options[ :auth_token ]
  
  super
end

Instance Method Details

#authorize(money, creditcard, options = {}) ⇒ Object



49
50
51
# File 'lib/web_teh_xml.rb', line 49

def authorize(money, creditcard, options = {})
  return transfer_funds( money, creditcard, options, "authorize" )
end

#capture(money, authorization, options = {}) ⇒ Object



57
58
59
# File 'lib/web_teh_xml.rb', line 57

def capture(money, authorization, options = {})
  return settle_transfer( money, authorization, options, "capture" )
end

#complete_3ds(md, pares) ⇒ Object



69
70
71
72
73
# File 'lib/web_teh_xml.rb', line 69

def complete_3ds( md, pares )
  xml = generate_3ds_complete_request( md, pares )
  
  return commit( "pares", xml )
end

#purchase(money, creditcard, options = {}) ⇒ Object



53
54
55
# File 'lib/web_teh_xml.rb', line 53

def purchase(money, creditcard, options = {})
  return transfer_funds( money, creditcard, options, "purchase" )
end

#refund(money, authorization, options = {}) ⇒ Object



61
62
63
# File 'lib/web_teh_xml.rb', line 61

def refund(money, authorization, options = {})
  return settle_transfer( money, authorization, options, "refund" )
end

#void(money, authorization, options = {}) ⇒ Object



65
66
67
# File 'lib/web_teh_xml.rb', line 65

def void(money, authorization, options = {})
  return settle_transfer( money, authorization, options, "void" )
end