Class: ActiveMerchant::Billing::CC5Gateway
- 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
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
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?
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 = {}) ⇒ CC5Gateway
Returns a new instance of CC5Gateway.
19 20 21 22 |
# File 'lib/active_merchant/billing/gateways/cc5.rb', line 19 def initialize( = {}) requires!(, :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 (money, creditcard, = {}) commit(build_sale_request('PreAuth', money, creditcard, )) end |
#capture(money, authorization, options = {}) ⇒ Object
32 33 34 |
# File 'lib/active_merchant/billing/gateways/cc5.rb', line 32 def capture(money, , = {}) commit(build_capture_request(money, , )) end |
#credit(money, creditcard, options = {}) ⇒ Object
44 45 46 |
# File 'lib/active_merchant/billing/gateways/cc5.rb', line 44 def credit(money, creditcard, = {}) commit(build_creditcard_credit_request(money, creditcard, )) end |
#purchase(money, creditcard, options = {}) ⇒ Object
24 25 26 |
# File 'lib/active_merchant/billing/gateways/cc5.rb', line 24 def purchase(money, creditcard, = {}) commit(build_sale_request('Auth', money, creditcard, )) end |
#refund(money, authorization, options = {}) ⇒ Object
40 41 42 |
# File 'lib/active_merchant/billing/gateways/cc5.rb', line 40 def refund(money, , = {}) commit((money, , )) end |
#void(authorization, options = {}) ⇒ Object
36 37 38 |
# File 'lib/active_merchant/billing/gateways/cc5.rb', line 36 def void(, = {}) commit(build_void_request(, )) end |