Class: ActiveMerchant::Billing::MerchantESolutionsGateway

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

Constant Summary

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

Returns a new instance of MerchantESolutionsGateway.



19
20
21
22
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 19

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

Instance Method Details

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



24
25
26
27
28
29
30
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 24

def authorize(money, creditcard_or_card_id, options = {})
  post = {}
  add_invoice(post, options)
  add_payment_source(post, creditcard_or_card_id, options)
  add_address(post, options)
  commit('P', money, post)
end

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



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

def capture(money, transaction_id, options = {})
  post ={}
  post[:transaction_id] = transaction_id
  commit('S', money, post)
end

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



62
63
64
65
66
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 62

def credit(money, creditcard_or_card_id, options = {})
  post = {}
  add_payment_source(post, creditcard_or_card_id, options)
  commit('C', money, post)
end

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



32
33
34
35
36
37
38
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 32

def purchase(money, creditcard_or_card_id, options = {})
  post = {}
  add_invoice(post, options)
  add_payment_source(post, creditcard_or_card_id, options)
  add_address(post, options)
  commit('D', money, post)
end

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



58
59
60
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 58

def refund(money, identification, options = {})
  commit('U', money, options.merge(:transaction_id => identification))
end

#store(creditcard, options = {}) ⇒ Object



46
47
48
49
50
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 46

def store(creditcard, options = {})
  post = {}
  add_creditcard(post, creditcard, options)
  commit('T', nil, post)
end

#unstore(card_id) ⇒ Object



52
53
54
55
56
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 52

def unstore(card_id)
  post = {}
  post[:card_id] = card_id
  commit('X', nil, post)
end

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



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

def void(transaction_id, options = {})
  commit('V', nil, options.merge(:transaction_id => transaction_id))
end