Class: ActiveMerchant::Billing::CC5Gateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::CC5Gateway
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.
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::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
#options
Instance Method Summary
collapse
-
#authorize(money, creditcard, options = {}) ⇒ Object
-
#capture(money, authorization, options = {}) ⇒ Object
-
#credit(money, creditcard, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ CC5Gateway
constructor
A new instance of CC5Gateway.
-
#purchase(money, creditcard, options = {}) ⇒ Object
-
#refund(money, authorization, options = {}) ⇒ Object
-
#void(authorization, options = {}) ⇒ Object
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?
#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
|