Class: ActiveMerchant::Billing::MerchantESolutionsGateway

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

Constant Summary collapse

TEST_URL =
'https://cert.merchante-solutions.com/mes-api/tridentApi'
LIVE_URL =
'https://api.merchante-solutions.com/mes-api/tridentApi'

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, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

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



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

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

#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) ⇒ Object



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

def void(transaction_id)
	post = {}
	post[:transaction_id] = transaction_id
	commit('V', nil, post)
end