Class: ActiveMerchant::Billing::MerchantESolutionsGateway

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

Constant Summary

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

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

Returns a new instance of MerchantESolutionsGateway


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

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

Instance Method Details

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


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

def authorize(money, creditcard_or_card_id, options = {})
  post = {}
  post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
  post[:moto_ecommerce_ind] = options[:moto_ecommerce_ind] if options.has_key?(:moto_ecommerce_ind)
  add_invoice(post, options)
  add_payment_source(post, creditcard_or_card_id, options)
  add_address(post, options)
  add_3dsecure_params(post, options)
  commit('P', money, post)
end

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


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

def capture(money, transaction_id, options = {})
  post ={}
  post[:transaction_id] = transaction_id
  post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
  add_invoice(post, options)
  add_3dsecure_params(post, options)
  commit('S', money, post)
end

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


80
81
82
83
84
85
86
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 80

def credit(money, creditcard_or_card_id, options = {})
  post = {}
  post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
  add_invoice(post, options)
  add_payment_source(post, creditcard_or_card_id, options)
  commit('C', money, post)
end

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


37
38
39
40
41
42
43
44
45
46
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 37

def purchase(money, creditcard_or_card_id, options = {})
  post = {}
  post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
  post[:moto_ecommerce_ind] = options[:moto_ecommerce_ind] if options.has_key?(:moto_ecommerce_ind)
  add_invoice(post, options)
  add_payment_source(post, creditcard_or_card_id, options)
  add_address(post, options)
  add_3dsecure_params(post, options)
  commit('D', money, post)
end

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


71
72
73
74
75
76
77
78
# File 'lib/active_merchant/billing/gateways/merchant_e_solutions.rb', line 71

def refund(money, identification, options = {})
  post = {}
  post[:transaction_id] = identification
  post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
  options.delete(:customer)
  options.delete(:billing_address)
  commit('U', money, options.merge(post))
end

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


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

def store(creditcard, options = {})
  post = {}
  post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
  add_creditcard(post, creditcard, options)
  commit('T', nil, post)
end

#unstore(card_id, options = {}) ⇒ Object


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

def unstore(card_id, options = {})
  post = {}
  post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
  post[:card_id] = card_id
  commit('X', nil, post)
end

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


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

def void(transaction_id, options = {})
  post = {}
  post[:transaction_id] = transaction_id
  post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
  options.delete(:customer)
  options.delete(:billing_address)
  commit('V', nil, options.merge(post))
end