Class: ActiveMerchant::Billing::FirstdataE4Gateway

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

Constant Summary collapse

TRANSACTIONS =
{
  :sale          => "00",
  :authorization => "01",
  :capture       => "32",
  :void          => "33",
  :credit        => "34"
}
POST_HEADERS =
{
  "Accepts" => "application/xml",
  "Content-Type" => "application/xml"
}
SUCCESS =
"true"
SENSITIVE_FIELDS =
[:verification_str2, :expiry_date, :card_number]

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 = {}) ⇒ FirstdataE4Gateway

Create a new FirstdataE4Gateway

The gateway requires that a valid login and password be passed in the options hash.

Options

  • :login – The EXACT ID. Also known as the Gateway ID.

    (Found in your administration terminal settings)
    
  • :password – The terminal password (not your account password)



40
41
42
43
44
45
# File 'lib/active_merchant/billing/gateways/firstdata_e4.rb', line 40

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

  super
end

Instance Method Details

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



47
48
49
# File 'lib/active_merchant/billing/gateways/firstdata_e4.rb', line 47

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

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



55
56
57
# File 'lib/active_merchant/billing/gateways/firstdata_e4.rb', line 55

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

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



51
52
53
# File 'lib/active_merchant/billing/gateways/firstdata_e4.rb', line 51

def purchase(money, credit_card, options = {})
  commit(:sale, build_sale_or_authorization_request(money, credit_card, options))
end

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



63
64
65
# File 'lib/active_merchant/billing/gateways/firstdata_e4.rb', line 63

def refund(money, authorization, options = {})
  commit(:credit, build_capture_or_credit_request(money, authorization, options))
end

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



59
60
61
# File 'lib/active_merchant/billing/gateways/firstdata_e4.rb', line 59

def void(authorization, options = {})
  commit(:void, build_capture_or_credit_request(money_from_authorization(authorization), authorization, options))
end