payanyway 1.2.0 → 1.2.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/controller.rb +9 -3
- data/lib/payanyway/version.rb +1 -1
- data/spec/controllers/payanyway_controller_spec.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10bf68a07ba7b3563b65cd8502d9a63d2be9f072
|
4
|
+
data.tar.gz: c5bcbcbb42073f55b15b168fe93a760cde2edeab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a61ae15d407e121038088a4b342fa65f18c146250fa86cab3a10c61b23fe71e9ee4886a905d050b59753e7e45ba3667c4615bf41bd7c007666ba1ca7a4e112fa
|
7
|
+
data.tar.gz: 8f4b768defa188b4c7eb18e11b2d4c751f4af601d6198ef7abce7eb9fb9d4649adac4ebea2279ee61e4cee12d1280b4030058a03cd1c351ffbf2c19fe56c68f5
|
data/lib/payanyway/controller.rb
CHANGED
@@ -41,9 +41,15 @@ module Payanyway
|
|
41
41
|
|
42
42
|
def check
|
43
43
|
service = Payanyway::Response::Check.new(params)
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
if service.pretty_params.present?
|
45
|
+
raise service.error_message unless service.success?
|
46
|
+
|
47
|
+
render xml: service.result(check_implementation(service.pretty_params)).to_xml
|
48
|
+
else
|
49
|
+
# Не выдавать ошибку, если параметры пустые
|
50
|
+
# Необходимо для проверки со стороны moneta.ru
|
51
|
+
render nothing: true
|
52
|
+
end
|
47
53
|
end
|
48
54
|
|
49
55
|
private
|
data/lib/payanyway/version.rb
CHANGED
@@ -34,9 +34,15 @@ describe PayanywayController do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
describe 'GET #check' do
|
37
|
+
context 'when empty params' do
|
38
|
+
it 'should raise error' do
|
39
|
+
expect{ get :check }.not_to raise_error
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
37
43
|
context 'when invalid signature' do
|
38
44
|
it 'should raise error' do
|
39
|
-
expect{ get
|
45
|
+
expect{ get(:check, { 'MNT_TRANSACTION_ID' => 676 }) }.to raise_error
|
40
46
|
end
|
41
47
|
end
|
42
48
|
|