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, 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, non_fractional_currency?, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Constructor Details

#initialize(options = {}) ⇒ OptimalPaymentGateway


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/active_merchant/billing/gateways/optimal_payment.rb', line 19

def initialize(options = {})

  if(options[:login])
    ActiveMerchant.deprecated("The 'login' option is deprecated in favor of 'store_id' and will be removed in a future version.")
    options[:store_id] = options[:login]
  end

  if(options[:account])
    ActiveMerchant.deprecated("The 'account' option is deprecated in favor of 'account_number' and will be removed in a future version.")
    options[:account_number] = options[:account]
  end

  requires!(options, :account_number, :store_id, :password)
  super
end

Instance Method Details

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


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

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


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

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


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

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


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

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

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


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

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