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.



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

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

Instance Method Details

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



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

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



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

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



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

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



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

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



60
61
62
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 60

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

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



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

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

#unstore(card_id) ⇒ Object



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

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

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



70
71
72
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 70

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