Class: ActiveMerchant::Billing::GarantiGateway

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

Constant Summary collapse

URL =
'https://ccpos.garanti.com.tr/servlet/cc5ApiServer'
CURRENCY_CODES =
{
  'YTL' => 949,
  'TRL' => 949,
  'USD' => 840,
  'EUR' => 978
}

Constants inherited from Gateway

ActiveMerchant::Billing::Gateway::CURRENCIES_WITHOUT_FRACTIONS, ActiveMerchant::Billing::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 Utils

generate_unique_id

Methods included from CreditCardFormatting

#format

Methods included from RequiresParameters

#requires!

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

Constructor Details

#initialize(options = {}) ⇒ GarantiGateway

Returns a new instance of GarantiGateway.



28
29
30
31
32
# File 'lib/active_merchant/billing/gateways/garanti.rb', line 28

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

Instance Method Details

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



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

def authorize(money, credit_card, options = {})
  commit(money, build_authorize_request(money, credit_card, options))
end

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



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

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

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



34
35
36
# File 'lib/active_merchant/billing/gateways/garanti.rb', line 34

def purchase(money, credit_card, options = {})
  commit(money, build_sale_request(money, credit_card, options))
end