Class: ActiveMerchant::Billing::MoneyMoversGateway

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

Constant Summary

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, #generate_unique_id, inherited, supported_countries, #supported_countries, supported_countries=, supports?

Methods included from CreditCardFormatting

#expdate, #format

Constructor Details

#initialize(options = {}) ⇒ MoneyMoversGateway

Returns a new instance of MoneyMoversGateway.



14
15
16
17
18
# File 'lib/active_merchant/billing/gateways/money_movers.rb', line 14

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

Instance Method Details

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



29
30
31
32
33
34
35
36
# File 'lib/active_merchant/billing/gateways/money_movers.rb', line 29

def authorize(money, creditcard, options = {})
  post = {}
  add_invoice(post, options)
  add_creditcard(post, creditcard)
  add_address(post, options)
  add_customer_data(post, options)
  commit('auth', money, post)
end

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



38
39
40
41
# File 'lib/active_merchant/billing/gateways/money_movers.rb', line 38

def capture(money, authorization, options = {})
  options[:transactionid] = authorization
  commit('capture', money, options)
end

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



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

def credit(money, authorization, options = {})
  ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
  refund(money, authorization, options)
end

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



20
21
22
23
24
25
26
27
# File 'lib/active_merchant/billing/gateways/money_movers.rb', line 20

def purchase(money, creditcard, options = {})
  post = {}
  add_invoice(post, options)
  add_creditcard(post, creditcard)
  add_address(post, options)
  add_customer_data(post, options)
  commit('sale', money, post)
end

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



48
49
50
# File 'lib/active_merchant/billing/gateways/money_movers.rb', line 48

def refund(money, authorization, options = {})
  commit('refund', money, options.merge(:transactionid => authorization))
end

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



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

def void(authorization, options = {})
  options[:transactionid] = authorization
  commit('void', nil, options)
end