nps_sdk 1.1.26 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/nps/soap_client.rb +6 -8
- data/lib/nps/version.rb +1 -1
- 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: 1f52f959344e61f3c2229da2ad383f76992f4404e801a0b6d2af437af91b3bad
|
4
|
+
data.tar.gz: 20dcafc06db6c03aa8d3b61f2e35fb89dddbd0740923eec590fb4b735c8e515d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 351ab4c51b195f2927f5d0e6eddc57ee6ff927cef3df0ada65d3847417677620b8f358917bc16ef96e1dc0b02724b44d000c541e72ef520be9947606b4385dbb
|
7
|
+
data.tar.gz: 11b49693d978ef533d26696422ed646e4400a2dfaa829b31f9b99ca718745210f1a176f4d1ce96da2b1ab3862aaa1815ace8dbb7cc2148824bc243d00d2456fb
|
data/lib/nps/soap_client.rb
CHANGED
@@ -3,8 +3,6 @@ require_relative 'services'
|
|
3
3
|
module Nps
|
4
4
|
class SoapClient
|
5
5
|
|
6
|
-
|
7
|
-
|
8
6
|
def initialize(conf)
|
9
7
|
if conf.logger.nil?
|
10
8
|
conf.logger = Logger.new(STDOUT)
|
@@ -86,12 +84,8 @@ module Nps
|
|
86
84
|
concatenated_data = concatenated_data+value.to_s
|
87
85
|
end
|
88
86
|
}
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
concatenated_data = concatenated_data+@key
|
93
|
-
hashed_string = create_md5_hash(concatenated_data)
|
94
|
-
params["psp_SecureHash"] = hashed_string
|
87
|
+
secure_hash = create_hmac_sha256(concatenated_data)
|
88
|
+
params["psp_SecureHash"] = secure_hash
|
95
89
|
return params
|
96
90
|
end
|
97
91
|
|
@@ -103,6 +97,10 @@ module Nps
|
|
103
97
|
return OpenSSL::HMAC.hexdigest('sha256', @key, data)
|
104
98
|
end
|
105
99
|
|
100
|
+
def create_hmac_sha512(data)
|
101
|
+
return OpenSSL::HMAC.hexdigest('sha512', @key, data)
|
102
|
+
end
|
103
|
+
|
106
104
|
def add_extra_data(params, service)
|
107
105
|
services = Services.new()
|
108
106
|
if services.is_service_in_services_with_additional_details(service)
|
data/lib/nps/version.rb
CHANGED