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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf2ee7e277b68f894054f0d1b0ff48cc99b2b2d9ab6e5c47d0764733aa8039bf
4
- data.tar.gz: df9ac3760f8e1777b773449e9a22da5dae13c25cbebebf4106d68fe4c9830405
3
+ metadata.gz: 9c4566df864e8628485a9335a32de6ba28d76b97eb77a4e12a3125016fd81ed9
4
+ data.tar.gz: 94297477205b0f19dfa5430e25ed1ed3a463eee527d5d7319ee318cf8e1a5ca9
5
5
  SHA512:
6
- metadata.gz: 3e3f8b2a0c5c81e4a2c5c13d0d47d9b7e73e8fddd0e328bc53d0b3f7d4c7e05598fa1c105b7d8750bd91ce410b65cd30faa589b73457a40823bea6c4e3369166
7
- data.tar.gz: b4ad7a53050766a0ff790900982c0356330340a258f40cd45616be4a9e6cee811623c13af8b32f8129cb0be874e38383706fa9cad70bca071634214c3ef6cdc5
6
+ metadata.gz: 0bb2c1e0b0f95e4c80c69869c127dc4d935059defc73e637483e34688e8fef2375a93d3b80632eb7e27512e7f8efa192f726b2eca784bd6118112c3fb917f051
7
+ data.tar.gz: db9d717371293497e6b47499097a6d21bae6699af8a2d11c58dada6fdf2f0fcc946952ff4482f73b6082065ad978cb3b9a577c9c630f937f8b0a575b54e47d22
@@ -1,4 +1,4 @@
1
1
  module Debitech
2
2
  # try to follow http://semver.org/
3
- VERSION = "1.5.0"
3
+ VERSION = "1.6.0"
4
4
  end
@@ -60,7 +60,13 @@ module Debitech
60
60
  private
61
61
 
62
62
  def request_mac(fields)
63
- Mac.build [ fields[:data], fields[:currency], fields[:method], @secret_key ]
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debitech
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joakim Kolsjö