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 +4 -4
- data/.rspec +1 -0
- data/README.md +1 -1
- data/lib/mobilepay/requests/generate_signature.rb +3 -4
- data/lib/mobilepay/version.rb +1 -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: 5f5fac960f2e73226c07e5686d5d58322424070e
|
4
|
+
data.tar.gz: fb432f96a5f1828d5cedd596800a78dbe15b3135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61dcbee66eae30fd03b9f220d88ab8733321953816a4ed3f214e9ebf7ce15ec54ed13a120267c8bcc058882b4e0b5a6e989b0cf84c759d095babf2d7bdf06ddb
|
7
|
+
data.tar.gz: d16fc7e6cbe1615896703a892ca04784f40390e55c567d22097bdff43ccef4b4df38fd76313626ccd06943dbffd73e0410b4329ae69885ffc001b0a95b72ec13
|
data/.rspec
CHANGED
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:
|
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.
|
13
|
+
payload_base64 = Base64.strict_encode64(payload_sha1)
|
14
14
|
|
15
|
-
|
16
|
-
|
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
|
data/lib/mobilepay/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|