Class: ActiveMerchant::Billing::OptimalPaymentGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/optimal_payment.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 = {}) ⇒ OptimalPaymentGateway

Returns a new instance of OptimalPaymentGateway.



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

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

Instance Method Details

#authorize(money, card_or_auth, options = {}) ⇒ Object Also known as: stored_authorize



24
25
26
27
# File 'lib/active_merchant/billing/gateways/optimal_payment.rb', line 24

def authorize(money, card_or_auth, options = {})
  parse_card_or_auth(card_or_auth, options)
  commit("cc#{@stored_data}Authorize", money, options)
end

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



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

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

#purchase(money, card_or_auth, options = {}) ⇒ Object Also known as: stored_purchase



30
31
32
33
# File 'lib/active_merchant/billing/gateways/optimal_payment.rb', line 30

def purchase(money, card_or_auth, options = {})
  parse_card_or_auth(card_or_auth, options)
  commit("cc#{@stored_data}Purchase", money, options)
end

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



36
37
38
39
# File 'lib/active_merchant/billing/gateways/optimal_payment.rb', line 36

def refund(money, authorization, options = {})
  options[:confirmationNumber] = authorization
  commit('ccCredit', money, options)
end

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



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

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