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

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



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

def credit(money, creditcard, options = {})
  commit(build_creditcard_credit_request(money, creditcard, 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

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



40
41
42
# File 'lib/active_merchant/billing/gateways/cc5.rb', line 40

def refund(money, authorization, options = {})
  commit(build_authorization_credit_request(money, authorization, options))
end

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



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

def void(authorization, options = {})
  commit(build_void_request(authorization, options))
end