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 +4 -4
- data/README.md +5 -0
- data/lib/payanyway/helpers/signature_generator.rb +9 -2
- data/lib/payanyway/version.rb +1 -1
- data/settings.png +0 -0
- data/spec/lib/payanyway/request/check_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a0a0e0745722668f5893b61306d535affb3a9e5
|
4
|
+
data.tar.gz: 88d266eefee02daf3a17c69878e83009d9056b49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
35
|
+
md5(values + Payanyway::Gateway.config['token'])
|
35
36
|
end
|
36
37
|
|
37
38
|
def get_value(params, key)
|
38
|
-
|
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)
|
data/lib/payanyway/version.rb
CHANGED
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>
|
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.
|
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-
|
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
|