Class: ActiveMerchant::Billing::VerifiGateway

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

Defined Under Namespace

Classes: VerifiPostData

Constant Summary collapse

URL =
'https://secure.verifi.com/gw/api/transact.php'
RESPONSE_CODE_MESSAGES =
{
  "100" => "Transaction was Approved", 
  "200" => "Transaction was Declined by Processor", 
  "201" => "Do Not Honor", 
  "202" => "Insufficient Funds", 
  "203" => "Over Limit", 
  "204" => "Transaction not allowed", 
  "220" => "Incorrect payment Data", 
  "221" => "No Such Card Issuer", 
  "222" => "No Card Number on file with Issuer", 
  "223" => "Expired Card", 
  "224" => "Invalid Expiration Date", 
  "225" => "Invalid Card Security Code", 
  "240" => "Call Issuer for Further Information", 
  "250" => "Pick Up Card", 
  "251" => "Lost Card", 
  "252" => "Stolen Card", 
  "253" => "Fraudulent Card", 
  "260" => "Declined With further Instructions Available (see response text)", 
  "261" => "Declined - Stop All Recurring Payments", 
  "262" => "Declined - Stop this Recurring Program", 
  "263" => "Declined - Update Cardholder Data Available", 
  "264" => "Declined - Retry in a few days", 
  "300" => "Transaction was Rejected by Gateway", 
  "400" => "Transaction Error Returned by Processor", 
  "410" => "Invalid Merchant Configuration", 
  "411" => "Merchant Account is Inactive", 
  "420" => "Communication Error", 
  "421" => "Communication Error with Issuer", 
  "430" => "Duplicate Transaction at Processor", 
  "440" => "Processor Format Error", 
  "441" => "Invalid Transaction Information", 
  "460" => "Processor Feature Not Available", 
  "461" => "Unsupported Card Type"
}
SUCCESS =
1
TRANSACTIONS =
{
  :authorization => 'auth',
  :purchase => 'sale',
  :capture => 'capture',
  :void => 'void',
  :credit => 'credit',
  :refund => 'refund'
}

Constants inherited from Gateway

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 Utils

generate_unique_id

Methods included from CreditCardFormatting

#format

Methods included from RequiresParameters

#requires!

Methods included from PostsData

included, #ssl_get, #ssl_post

Constructor Details

#initialize(options = {}) ⇒ VerifiGateway

Returns a new instance of VerifiGateway.



66
67
68
69
70
# File 'lib/active_merchant/billing/gateways/verifi.rb', line 66

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

Instance Method Details

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



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

def authorize(money, credit_card, options = {})
  sale_authorization_or_credit_template(:authorization, money, credit_card, options)
end

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



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

def capture(money, authorization, options = {})
  capture_void_or_refund_template(:capture, money, authorization, options)
end

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



88
89
90
91
92
93
94
# File 'lib/active_merchant/billing/gateways/verifi.rb', line 88

def credit(money, credit_card_or_authorization, options = {})
  if credit_card_or_authorization.is_a?(String)
    capture_void_or_refund_template(:refund, money, credit_card_or_authorization, options)
  else
    sale_authorization_or_credit_template(:credit, money, credit_card_or_authorization, options)
  end
end

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



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

def purchase(money, credit_card, options = {})
  sale_authorization_or_credit_template(:purchase, money, credit_card, options)
end

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



84
85
86
# File 'lib/active_merchant/billing/gateways/verifi.rb', line 84

def void(authorization, options = {})
  capture_void_or_refund_template(:void, 0, authorization, options)
end