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

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::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#add_field_to_post_if_present, #add_fields_to_post_if_present, card_brand, #card_brand, #generate_unique_id, inherited, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

Constructor Details

#initialize(options = {}) ⇒ VerifiGateway

Returns a new instance of VerifiGateway.



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

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

Instance Method Details

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



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

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

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



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

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

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



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

def credit(money, credit_card_or_authorization, options = {})
  if credit_card_or_authorization.is_a?(String)
    ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
    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



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

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

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



96
97
98
# File 'lib/active_merchant/billing/gateways/verifi.rb', line 96

def refund(money, reference, options = {})
  capture_void_or_refund_template(:refund, money, reference, options)
end

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



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

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