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" }
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
# File 'lib/active_merchant/billing/gateways/secure_net.rb', line 59

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

Instance Method Details

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



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

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

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



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

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

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



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

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

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



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

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

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



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

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