payanyway 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/payanyway/helpers/signature_generator.rb +1 -3
- data/lib/payanyway/version.rb +1 -1
- data/spec/config/routes_spec.rb +6 -6
- data/spec/controllers/payanyway_controller_spec.rb +2 -2
- data/spec/lib/payanyway/request/pay_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05673b4e12bd38b85b361e9181396ac890c9f735
|
4
|
+
data.tar.gz: 0ddf0a1ee9a5725e94f6559c3f03cf93b4340bd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5dd2cc9f7616f943f2305cc5489038eb8376a14a015d55a028d9a1e26587afbb92159c68246e0e946c1762462e49d3e25adf8061437802a2b276ecf3da542ee
|
7
|
+
data.tar.gz: 692be96d4980db8a9e213e4f4127d68680570733665ce42655e1a88e9a51b90b0ca17d0057012660ed5a3dd4d1623fee23ed87194fccccaf35c4bfabf3bb26f8
|
@@ -4,7 +4,7 @@ module Payanyway
|
|
4
4
|
module Helpers
|
5
5
|
class SignatureGenerate
|
6
6
|
BASE_KEYS = %w(
|
7
|
-
|
7
|
+
MNT_ID
|
8
8
|
MNT_TRANSACTION_ID
|
9
9
|
MNT_OPERATION_ID
|
10
10
|
MNT_AMOUNT
|
@@ -38,8 +38,6 @@ module Payanyway
|
|
38
38
|
def get_value(params, key)
|
39
39
|
if key == 'MNT_AMOUNT' && params[key].present?
|
40
40
|
'%.2f' % params[key]
|
41
|
-
elsif key == 'moneta_id'
|
42
|
-
Payanyway::Gateway.config['moneta_id'].to_s
|
43
41
|
else
|
44
42
|
params[key]
|
45
43
|
end
|
data/lib/payanyway/version.rb
CHANGED
data/spec/config/routes_spec.rb
CHANGED
@@ -2,32 +2,32 @@ describe Payanyway::Engine, type: :routing do
|
|
2
2
|
routes { Payanyway::Engine.routes }
|
3
3
|
|
4
4
|
context 'payanyway' do
|
5
|
-
specify { get('/success').
|
5
|
+
specify { expect(get('/success')).to route_to(
|
6
6
|
controller: 'payanyway',
|
7
7
|
action: 'success'
|
8
8
|
)}
|
9
9
|
|
10
|
-
specify { get('/pay').
|
10
|
+
specify { expect(get('/pay')).to route_to(
|
11
11
|
controller: 'payanyway',
|
12
12
|
action: 'pay'
|
13
13
|
)}
|
14
14
|
|
15
|
-
specify { get('/fail').
|
15
|
+
specify { expect(get('/fail')).to route_to(
|
16
16
|
controller: 'payanyway',
|
17
17
|
action: 'fail'
|
18
18
|
)}
|
19
19
|
|
20
|
-
specify { get('/return').
|
20
|
+
specify { expect(get('/return')).to route_to(
|
21
21
|
controller: 'payanyway',
|
22
22
|
action: 'return'
|
23
23
|
)}
|
24
24
|
|
25
|
-
specify { get('/in_progress').
|
25
|
+
specify { expect(get('/in_progress')).to route_to(
|
26
26
|
controller: 'payanyway',
|
27
27
|
action: 'in_progress'
|
28
28
|
)}
|
29
29
|
|
30
|
-
specify { get('/check').
|
30
|
+
specify { expect(get('/check')).to route_to(
|
31
31
|
controller: 'payanyway',
|
32
32
|
action: 'check'
|
33
33
|
)}
|
@@ -51,7 +51,7 @@ describe PayanywayController do
|
|
51
51
|
expect(Rails.logger).not_to receive(:info).with(/PAYANYWAY: XML response for check/)
|
52
52
|
expect_any_instance_of(Payanyway::Controller).to receive(:check_implementation).and_return(amount: 12, state: :paid)
|
53
53
|
|
54
|
-
get :check, { 'MNT_TRANSACTION_ID' => 676, 'MNT_SIGNATURE' => '79c1c4f41a0a70bb107c976ebba25811' }
|
54
|
+
get :check, { 'MNT_ID' => Payanyway::Gateway.config['moneta_id'].to_s, 'MNT_TRANSACTION_ID' => 676, 'MNT_SIGNATURE' => '79c1c4f41a0a70bb107c976ebba25811' }
|
55
55
|
|
56
56
|
expect(Nokogiri::XML(response.body).at_css('MNT_RESPONSE')).to be_present
|
57
57
|
end
|
@@ -62,7 +62,7 @@ describe PayanywayController do
|
|
62
62
|
expect(Rails.logger).to receive(:info).with(/PAYANYWAY: XML response for check/)
|
63
63
|
|
64
64
|
expect_any_instance_of(Payanyway::Controller).to receive(:check_implementation).and_return(amount: 12, state: :paid, logger: true)
|
65
|
-
get :check, { 'MNT_TRANSACTION_ID' => 676, 'MNT_SIGNATURE' => '79c1c4f41a0a70bb107c976ebba25811' }
|
65
|
+
get :check, { 'MNT_ID' => Payanyway::Gateway.config['moneta_id'].to_s, 'MNT_TRANSACTION_ID' => 676, 'MNT_SIGNATURE' => '79c1c4f41a0a70bb107c976ebba25811' }
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
data/spec/spec_helper.rb
CHANGED
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: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ssnikolay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|