Class: Payzilla::Gateways::Yamoney

Inherits:
Gateway
  • Object
show all
Defined in:
lib/payzilla/gateways/yamoney.rb

Instance Attribute Summary

Attributes inherited from Gateway

#config, #logger, #revision_page_size

Instance Method Summary collapse

Methods inherited from Gateway

available_attachments, available_settings, available_switches, can_list_providers, #can_list_providers?, can_list_providers?, #initialize, register_attachments, register_settings, register_switches, require_payment_fields, required_payment_fields, requires_revision, requires_revision?, #requires_revision?, #revise

Constructor Details

This class inherits a constructor from Payzilla::Gateways::Gateway

Instance Method Details

#check(payment) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/payzilla/gateways/yamoney.rb', line 11

def check(payment)
  begin
    result = send :VERSION    => '2.02',
                  :TR_NR      => payment.id,
                  :DSTACNT_NR => payment.,
                  :TR_AMT     => payment.enrolled_amount,
                  :CUR_CD     => @config.setting_currency,
                  :ACT_CD     => 1002,
                  :SIGN       => sign([payment.id, 1002, payment., payment.enrolled_amount, @config.setting_currency])

    return retval(result)
  rescue Errno::ECONNRESET
    return {:success => false, :error => -1000}
  end
end

#pay(payment) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/payzilla/gateways/yamoney.rb', line 27

def pay(payment)
  begin
    result = send :VERSION    => '2.02',
                  :TR_NR      => payment.id,
                  :DSTACNT_NR => payment.,
                  :TR_AMT     => payment.enrolled_amount,
                  :CUR_CD     => @config.setting_currency,
                  :ACT_CD     => 1,
                  :CONT       => "Пополнение кошелька".force_encoding("Windows-1251"),
                  :SIGN       => sign([payment.id, 1002, payment., payment.enrolled_amount, @config.setting_currency])

    return retval(result)
  rescue Errno::ECONNRESET
    return {:success => false, :error => -1000}
  end
end