mobilepay 1.1.1 → 1.1.2

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
  SHA1:
3
- metadata.gz: 07a7ad65ec8e517ac2db8bf0bf161ea5cc49e4ed
4
- data.tar.gz: 3312e4b3e590373f4ae92bced432505140a3de2b
3
+ metadata.gz: 5f5fac960f2e73226c07e5686d5d58322424070e
4
+ data.tar.gz: fb432f96a5f1828d5cedd596800a78dbe15b3135
5
5
  SHA512:
6
- metadata.gz: 14fba443fa646c6549ab2c0be328a6e39804cc13e2ef984fe8cf9f5defd15491cc1b040dfca6e9d7cca14d1290c505690aad31c47051c66691ed2394ffc1ba2a
7
- data.tar.gz: eb62bc833f1108df0aec6e59e9aa3fd0ca41129703d96570efb57e36a74727b4c0f7e16bed81e949f5beadd6e6c1b55eee2d7bae28991cca98cb6d5f57d11371
6
+ metadata.gz: 61dcbee66eae30fd03b9f220d88ab8733321953816a4ed3f214e9ebf7ce15ec54ed13a120267c8bcc058882b4e0b5a6e989b0cf84c759d095babf2d7bdf06ddb
7
+ data.tar.gz: d16fc7e6cbe1615896703a892ca04784f40390e55c567d22097bdff43ccef4b4df38fd76313626ccd06943dbffd73e0410b4329ae69885ffc001b0a95b72ec13
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
+ --require spec_helper
1
2
  --format documentation
2
3
  --color
data/README.md CHANGED
@@ -33,7 +33,7 @@ Or install it yourself as:
33
33
  ```ruby
34
34
  require 'mobilepay'
35
35
  require 'jose'
36
- client = Mobilepay::Client.new merchant_id: 'merchant_id', subscription_key: 'subscription_key', privatekey: OpenSSL::PKey::RSA.new(File.read('key.pvk'))
36
+ client = Mobilepay::Client.new merchant_id: 'merchant_id', subscription_key: 'subscription_key', privatekey: 'key.pvk'
37
37
  ```
38
38
  subscription_key - Subscription Key for MobilePay, required
39
39
  merchant_id - Merchant ID, required
@@ -10,11 +10,10 @@ module Mobilepay
10
10
  def generate_signature(request)
11
11
  payload = (request.uri.to_s + request.body.to_s).encode('UTF-8')
12
12
  payload_sha1 = Digest::SHA1.digest(payload)
13
- payload_base64 = Base64.encode64(payload_sha1)
13
+ payload_base64 = Base64.strict_encode64(payload_sha1)
14
14
 
15
- jwk_rs256 = JOSE::JWK.generate_key([:rsa, 1024])
16
- jwk_rs256.kty.key = privatekey
17
- JOSE::JWS.sign(jwk_rs256, payload_base64, { "alg" => "RS256" }).compact
15
+ jwk = JOSE::JWK.from_pem_file(privatekey)
16
+ JOSE::JWS.sign(jwk, payload_base64, { 'alg' => 'RS256', 'typ' => 'JWT' }).compact
18
17
  end
19
18
 
20
19
  end
@@ -1,3 +1,3 @@
1
1
  module Mobilepay
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobilepay
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Bogdanov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-21 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler