payanyway 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22312df92c434d0cc5fbb014278ea412e847ef2f
4
- data.tar.gz: 56360ecc662d971c93fb290b11b4e6d75a69a134
3
+ metadata.gz: 3a0a0e0745722668f5893b61306d535affb3a9e5
4
+ data.tar.gz: 88d266eefee02daf3a17c69878e83009d9056b49
5
5
  SHA512:
6
- metadata.gz: 68e88399e7e7b18faf28d8a343e72845786be52c5b465b70adde9201a7d545cc910cd0ad62bf2a3cac070b4845f9c496ba87db3009c7c18264ad586fd768d9ab
7
- data.tar.gz: 5e6066b8f26391772aed9a00a2c09a244198e3dd60f8bc5cf04c2e5d03df7aba454f58649ff5b9eb27b56edce1dc6f1cd09e3480e37df2d88812c0b854e2b771
6
+ metadata.gz: f98d5adf7ea7d1a7fe9adc5b02a9c127413759bb99e30d8565cb73659a1582964e9382cbc99155497cce8e1112ed034f0531386c66cffe62541bed8d60e500af
7
+ data.tar.gz: 963062a553120424ad51cc7bca9cd7690032d960a889930304146089d80d912ef8e9af2b66e8ddc6023430ad32f6b32cad3fba3710224e0f8b16925a93fe091f
data/README.md CHANGED
@@ -83,6 +83,11 @@ production: <<: *config
83
83
  payment_url: https://moneta.ru/assistant.htm
84
84
  test_mode: 0
85
85
  ```
86
+
87
+ В настройках счета **moneta.ru** выберите `HTTP метод: GET`
88
+
89
+ ![Settings](https://raw.github.com/ssnikolay/payanyway/master/settings.png)
90
+
86
91
  ##<a name="usage"></a> Использование
87
92
 
88
93
  ###<a name="payment_url"></a> Запрос на оплату
@@ -4,6 +4,7 @@ module Payanyway
4
4
  module Helpers
5
5
  class SignatureGenerate
6
6
  BASE_KEYS = %w(
7
+ moneta_id
7
8
  MNT_TRANSACTION_ID
8
9
  MNT_OPERATION_ID
9
10
  MNT_AMOUNT
@@ -31,11 +32,17 @@ module Payanyway
31
32
  def generate_by(params, keys)
32
33
  values = keys.map { |key| get_value(params, key) }.join
33
34
 
34
- md5(Payanyway::Gateway.config['moneta_id'].to_s + values + Payanyway::Gateway.config['token'])
35
+ md5(values + Payanyway::Gateway.config['token'])
35
36
  end
36
37
 
37
38
  def get_value(params, key)
38
- (key == 'MNT_AMOUNT' && params[key].present?) ? '%.2f' % params[key] : params[key]
39
+ if key == 'MNT_AMOUNT' && params[key].present?
40
+ '%.2f' % params[key]
41
+ elsif key == 'moneta_id'
42
+ Payanyway::Gateway.config['moneta_id'].to_s
43
+ else
44
+ params[key]
45
+ end
39
46
  end
40
47
 
41
48
  def md5(str)
@@ -1,3 +1,3 @@
1
1
  module Payanyway
2
- VERSION = '1.2.2'
2
+ VERSION = '1.2.3'
3
3
  end
data/settings.png ADDED
Binary file
@@ -38,7 +38,7 @@ describe Payanyway::Request::Check do
38
38
  <MNT_RESULT_CODE>402</MNT_RESULT_CODE>
39
39
  <MNT_DESCRIPTION>Заказ создан, но не оплачен</MNT_DESCRIPTION>
40
40
  <MNT_AMOUNT>10.2</MNT_AMOUNT>
41
- <MNT_SIGNATURE>061c2b859c27c75db9e5bbef3aef90a0</MNT_SIGNATURE>
41
+ <MNT_SIGNATURE>11cf20faee5e4b2b89808a09e4f6bfeb</MNT_SIGNATURE>
42
42
  </MNT_RESPONSE>
43
43
  EOXML
44
44
  expected_xml = Nokogiri::XML(expected, nil, 'UTF-8')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payanyway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ssnikolay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-24 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -178,6 +178,7 @@ files:
178
178
  - lib/payanyway/request/pay.rb
179
179
  - lib/payanyway/version.rb
180
180
  - payanyway.gemspec
181
+ - settings.png
181
182
  - spec/config/payanyway_spec.rb
182
183
  - spec/config/routes_spec.rb
183
184
  - spec/controllers/payanyway_controller_spec.rb