debitech 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/debitech/version.rb +1 -1
- data/lib/debitech/web_api.rb +7 -1
- data/spec/debitech/web_api_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c4566df864e8628485a9335a32de6ba28d76b97eb77a4e12a3125016fd81ed9
|
4
|
+
data.tar.gz: 94297477205b0f19dfa5430e25ed1ed3a463eee527d5d7319ee318cf8e1a5ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bb2c1e0b0f95e4c80c69869c127dc4d935059defc73e637483e34688e8fef2375a93d3b80632eb7e27512e7f8efa192f726b2eca784bd6118112c3fb917f051
|
7
|
+
data.tar.gz: db9d717371293497e6b47499097a6d21bae6699af8a2d11c58dada6fdf2f0fcc946952ff4482f73b6082065ad978cb3b9a577c9c630f937f8b0a575b54e47d22
|
data/lib/debitech/version.rb
CHANGED
data/lib/debitech/web_api.rb
CHANGED
@@ -60,7 +60,13 @@ module Debitech
|
|
60
60
|
private
|
61
61
|
|
62
62
|
def request_mac(fields)
|
63
|
-
|
63
|
+
verify_id = fields[:verifyID]
|
64
|
+
|
65
|
+
if verify_id
|
66
|
+
Mac.build [ fields[:data], fields[:currency], fields[:method], @secret_key, verify_id ]
|
67
|
+
else
|
68
|
+
Mac.build [ fields[:data], fields[:currency], fields[:method], @secret_key ]
|
69
|
+
end
|
64
70
|
end
|
65
71
|
|
66
72
|
def response_mac(sum, reply, verify_id, currency, reference_number)
|
@@ -35,6 +35,12 @@ describe Debitech::WebApi do
|
|
35
35
|
mac_with_override = Debitech::WebApi.new({ :secret_key => "secretkey1" }).form_fields(method: "other-method").fetch(:MAC)
|
36
36
|
expect(mac_without_override).not_to eq(mac_with_override)
|
37
37
|
end
|
38
|
+
|
39
|
+
it "includes verify_id in the MAC if provided" do
|
40
|
+
mac_without_verify_id = Debitech::WebApi.new({ :secret_key => "secretkey1" }).form_fields.fetch(:MAC)
|
41
|
+
mac_with_verify_id = Debitech::WebApi.new({ :secret_key => "secretkey1" }).form_fields(verifyID: "123456").fetch(:MAC)
|
42
|
+
expect(mac_without_verify_id).not_to eq(mac_with_verify_id)
|
43
|
+
end
|
38
44
|
end
|
39
45
|
|
40
46
|
describe "form_action" do
|