Class: ActiveMerchant::Billing::GarantiGateway

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

Constant Summary collapse

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

Constants inherited from Gateway

ActiveMerchant::Billing::Gateway::CREDIT_DEPRECATION_MESSAGE, ActiveMerchant::Billing::Gateway::RECURRING_DEPRECATION_MESSAGE, ActiveMerchant::Billing::Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #scrub, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format, #strftime_yyyymm

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.



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

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

Instance Method Details

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



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

def authorize(money, credit_card, options = {})
  options = options.merge(gvp_order_type: 'preauth')
  commit(money, build_authorize_request(money, credit_card, options))
end

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



48
49
50
51
# File 'lib/active_merchant/billing/gateways/garanti.rb', line 48

def capture(money, ref_id, options = {})
  options = options.merge(gvp_order_type: 'postauth')
  commit(money, build_capture_request(money, ref_id, options))
end

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



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

def purchase(money, credit_card, options = {})
  options = options.merge(gvp_order_type: 'sales')
  commit(money, build_sale_request(money, credit_card, options))
end