Class: ActiveMerchant::Billing::SecureNetGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/secure_net.rb

Constant Summary collapse

API_VERSION =
"4.0"
TRANSACTIONS =
{
  :auth_only                      => "0000",  #
  :partial_auth_only              => "0001",
  :auth_capture                   => "0100",  #
  :partial_auth_capture           => "0101",
  :prior_auth_capture             => "0200",
  :capture_only                   => "0300",  #
  :void                           => "0400",  #
  :partial_void                   => "0401",
  :credit                         => "0500",  #
  :credit_authonly                => "0501",
  :credit_priorauthcapture        => "0502",
  :force_credit                   => "0600",
  :force_credit_authonly          => "0601",
  :force_credit_priorauthcapture  => "0602",
  :verification                   => "0700",
  :auth_increment                 => "0800",
  :issue                          => "0900",
  :activate                       => "0901",
  :redeem                         => "0902",
  :redeem_partial                 => "0903",
  :deactivate                     => "0904",
  :reactivate                     => "0905",
  :inquiry_balance                => "0906"
}
XML_ATTRIBUTES =
{ 'xmlns' => "http://gateway.securenet.com/API/Contracts",
  'xmlns:i' => "http://www.w3.org/2001/XMLSchema-instance"
}
NIL_ATTRIBUTE =
{ 'i:nil' => "true" }
TEST_URL =
'https://certify.securenet.com/API/gateway.svc/webHttp/ProcessTransaction'
LIVE_URL =
'https://gateway.securenet.com/api/Gateway.svc'
CARD_CODE_ERRORS =
%w( N S )
AVS_ERRORS =
%w( A E N R W Z )

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, inherited, supports?, #test?

Methods included from CreditCardFormatting

#format

Constructor Details

#initialize(options = {}) ⇒ SecureNetGateway

Returns a new instance of SecureNetGateway.



59
60
61
62
63
# File 'lib/active_merchant/billing/gateways/secure_net.rb', line 59

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

Instance Method Details

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



65
66
67
# File 'lib/active_merchant/billing/gateways/secure_net.rb', line 65

def authorize(money, creditcard, options = {})
  commit(build_sale_or_authorization_request(creditcard, options, :auth_only), money)
end

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



73
74
75
# File 'lib/active_merchant/billing/gateways/secure_net.rb', line 73

def capture(money, creditcard, authorization, options = {})
  commit(build_capture_request(authorization, creditcard, options, :prior_auth_capture), money)
end

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



81
82
83
# File 'lib/active_merchant/billing/gateways/secure_net.rb', line 81

def credit(money, creditcard, authorization, options = {})
  commit(build_credit_request(authorization, creditcard, options, :credit), money)
end

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



69
70
71
# File 'lib/active_merchant/billing/gateways/secure_net.rb', line 69

def purchase(money, creditcard, options = {})
  commit(build_sale_or_authorization_request(creditcard, options, :auth_capture), money)
end

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



77
78
79
# File 'lib/active_merchant/billing/gateways/secure_net.rb', line 77

def void(money, creditcard, authorization, options = {})
  commit(build_void_request(authorization, creditcard, options, :void), money)
end