Class: ActiveMerchant::Billing::CC5Gateway

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

Overview

CC5 API is used by many banks in Turkey. Extend this base class to provide concrete implementations.

Direct Known Subclasses

FinansbankGateway

Constant Summary collapse

CURRENCY_CODES =
{
  'TRY' => 949,
  'YTL' => 949,
  'TRL' => 949,
  'TL'  => 949,
  'USD' => 840,
  'EUR' => 978,
  'GBP' => 826,
  'JPY' => 392
}

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

Returns a new instance of CC5Gateway.



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

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

Instance Method Details

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



28
29
30
# File 'lib/active_merchant/billing/gateways/cc5.rb', line 28

def authorize(money, creditcard, options = {})
  commit(build_sale_request('PreAuth', money, creditcard, options))
end

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



32
33
34
# File 'lib/active_merchant/billing/gateways/cc5.rb', line 32

def capture(money, authorization, options = {})
  commit(build_capture_request(money, authorization, options))
end

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



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

def purchase(money, creditcard, options = {})
  commit(build_sale_request('Auth', money, creditcard, options))
end