paysera 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paysera/response.rb +1 -1
- data/lib/paysera/version.rb +1 -1
- data/spec/response_spec.rb +22 -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: aafc0b2ae68bb329fa1abd7ff272220e6b0a139b
|
4
|
+
data.tar.gz: dc13c329a3493ef9aa615ef5317ceb1c3fdd2096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bfe56148c5357dea5f0a1558afc03c7354e154643910d098f55b60aa43ba2fde3233bcd63364ce9de98f11ac8fa8875da15b15f074d735d4993fd704a988502
|
7
|
+
data.tar.gz: 983b7ddacc905d81f4e09124af37846f9cc362b3acf081b3868fcbd0dd1da1c468949cfee658242a632717bc7f153605f00c1fece1aa551edc459c7bbc1e3b77
|
data/lib/paysera/response.rb
CHANGED
@@ -56,7 +56,7 @@ module Paysera
|
|
56
56
|
|
57
57
|
def valid_ss2?(data, ss2)
|
58
58
|
public_key = get_public_key
|
59
|
-
ss2 =
|
59
|
+
ss2 = safely_decode_string(unescape_string(ss2))
|
60
60
|
data = unescape_string data
|
61
61
|
|
62
62
|
public_key.verify(OpenSSL::Digest::SHA1.new, ss2, data)
|
data/lib/paysera/version.rb
CHANGED
data/spec/response_spec.rb
CHANGED
@@ -10,6 +10,13 @@ describe Paysera::Response do
|
|
10
10
|
:ss2 => '02pTV2VtdxJlMIdrKakCHpIxgiG--1iUwZkxikwAvqPEiiEj_ekmMYsnYDu3B8RlrmDBWrsSIRLIaPwOGLbInQc9vduK3lsjm9PQ9RImNXEHcc5Pyk-6cQ93U833bQ73r5NxvwfxE8s3KhBUxwHDLTSPCMnF7yEhskLx63I0SW8%3D'
|
11
11
|
}
|
12
12
|
end
|
13
|
+
let(:another_response_data) do
|
14
|
+
{
|
15
|
+
:data => 'YW1vdW50PTIwMCZjb3VudHJ5PUxUJmN1cnJlbmN5PUVVUiZsYW5nPWxpdCZvcmRlcmlkPTMwMTAyMDAwMTQyNzc1Mjk0NCZwX2NvdW50cnljb2RlPUxUJnBheXRleHQ9QXBtb2slQzQlOTdqaW1hcyt1JUM1JUJFKzEra3JlZC4rJTI4aHR0cCUzQSUyRiUyRmxvY2FsaG9zdCt1JUM1JUJFc2FreW1hcyszMDEwMjAwMDE0Mjc3NTI5NDQlMjkmcHJvamVjdGlkPTU2NTcxJnRlc3Q9MSZ2ZXJzaW9uPTEuNiZwYXltZW50PWhhbnphJnBfZW1haWw9c29ycnklMkJqdXN0JTJCdGVzdGluZyUyQnBheXNlcmElMkJnZW0lNDBnbWFpbC5jb20mc3RhdHVzPTEmcmVxdWVzdGlkPTc1MzcxMDU0JnBheWFtb3VudD0yMDAmcGF5Y3VycmVuY3k9RVVS',
|
16
|
+
:ss1 => '3a3ce55cfdf7e950a766cd6df6693f95',
|
17
|
+
:ss2 => '3TKdk3iLGkMEvBW-NNl5i5y0wHEaXMZt2cLwBnxsPO8Jsf_PVfHsoN-eWYMFQFrpHXgZTqGwhCEhw3goAXIyFH8EW-jzNmMOoBVPjpMif7ZYRgerd1nI_pVz9_RAEXDd7WSvuhJz5se2F0UMgUikfVALdBEQ3UcrfYqKecUsmbU='
|
18
|
+
}
|
19
|
+
end
|
13
20
|
let(:projectid) { 56571 }
|
14
21
|
let(:sign_password) { '36947d6dcbccc03ad591deab138dbb0c' }
|
15
22
|
|
@@ -57,6 +64,20 @@ describe Paysera::Response do
|
|
57
64
|
sign: sign_password) }.to raise_exception /verify.+ss2/i }
|
58
65
|
end
|
59
66
|
|
67
|
+
context 'when valid ss2' do
|
68
|
+
it { expect { new_response(data: another_response_data[:data],
|
69
|
+
ss1: another_response_data[:ss1],
|
70
|
+
ss2: another_response_data[:ss2],
|
71
|
+
p_id: projectid,
|
72
|
+
sign: sign_password) }.not_to raise_error }
|
73
|
+
|
74
|
+
it { expect { new_response(data: response_data[:data],
|
75
|
+
ss1: response_data[:ss1],
|
76
|
+
ss2: response_data[:ss2],
|
77
|
+
p_id: projectid,
|
78
|
+
sign: sign_password) }.not_to raise_error }
|
79
|
+
end
|
80
|
+
|
60
81
|
context 'when projectid mismatch' do
|
61
82
|
it { expect { new_response(data: response_data[:data],
|
62
83
|
ss1: response_data[:ss1],
|
@@ -99,4 +120,4 @@ describe Paysera::Response do
|
|
99
120
|
describe '#get_data' do
|
100
121
|
it { expect(bank_response.get_data).to be_kind_of(Hash) }
|
101
122
|
end
|
102
|
-
end
|
123
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paysera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Achmedovas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|