Class: ActiveMerchant::Billing::AlfabankGateway

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

Constant Summary collapse

STATUSES_HASH =
{
    '0' => 'Order registered but not paid',
    '1' => 'Waits when order will be completed',
    '2' => 'Run the full authorization amount of the order',
    '3' => 'Authorization revoked',
    '4' => 'The transaction had an operation return',
    '5' => 'Initiated ACS authorization through the issuing bank',
    '6' => 'Authorization rejected'
}

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?, #supported_countries, supported_countries, supported_countries=, supports?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Constructor Details

#initialize(options = {}) ⇒ AlfabankGateway

Creates a new AlfabankGateway

The gateway requires that valid credentials be passed in the options hash.

Options

  • :account – The Alfabank API account (REQUIRED)

  • :secret – The Alfabank API secret (REQUIRED)



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

def initialize(options = {})
  requires!(options, :account, :secret)
  super
end

Instance Method Details

#get_order_status(options = {}) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/active_merchant/billing/gateways/alfabank.rb', line 48

def get_order_status(options = {})
  post = {}
  add_order_number(post, options)
  add_order_id(post, options)

  commit('getOrderStatusExtended', nil, post)
end

#make_order(options = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/active_merchant/billing/gateways/alfabank.rb', line 38

def make_order(options = {})
  post = {}
  add_order_number(post, options)
  add_return_url(post, options)
  add_amount(post, options)
  add_description(post, options)

  commit('register', options[:amount], post)
end