mobilepay 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/mobilepay/client.rb +2 -1
- data/lib/mobilepay/requests.rb +1 -0
- data/lib/mobilepay/security.rb +2 -1
- data/lib/mobilepay/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12cc0dcb6e0ea4953fd848675240243327d0e196
|
4
|
+
data.tar.gz: 9ef6567003bc4c4dbe47478288f89116a4d328d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7166ef5969414f7ba82928c2640cd7f51b6fb2d8e6b92f87c30ebd016d801ee7bb810dc6f29e29e4a36167eb0798c4958cf9d8d5d7cade05dc4c2ea7263c24a4
|
7
|
+
data.tar.gz: 8a506ba4c932ae18e5637aa68a13ffd3603caccb6670e1bab81b4e10ddfb504f3457f863cc85c73598898ae1e4dafdc9ac005834f10fa5e8d8ed8b71fe48093f
|
data/README.md
CHANGED
@@ -34,11 +34,12 @@ Or install it yourself as:
|
|
34
34
|
```ruby
|
35
35
|
require 'mobilepay'
|
36
36
|
require 'jose'
|
37
|
-
client = Mobilepay::Client.new merchant_id: 'merchant_id', subscription_key: 'subscription_key', privatekey: 'key.pvk'
|
37
|
+
client = Mobilepay::Client.new merchant_id: 'merchant_id', subscription_key: 'subscription_key', privatekey: 'key.pvk', test_mode: true
|
38
38
|
```
|
39
39
|
subscription_key - Subscription Key for MobilePay, required
|
40
40
|
merchant_id - Merchant ID, required
|
41
41
|
privatekey - File with secret key for creating signature for requests, required
|
42
|
+
test_mode - turn on test mode, optional
|
42
43
|
|
43
44
|
### Public Key
|
44
45
|
|
data/lib/mobilepay/client.rb
CHANGED
@@ -19,12 +19,13 @@ module Mobilepay
|
|
19
19
|
include Mobilepay::Requests
|
20
20
|
include Mobilepay::Requests::GenerateSignature
|
21
21
|
|
22
|
-
attr_reader :merchant_id, :subscription_key, :privatekey, :base_uri
|
22
|
+
attr_reader :merchant_id, :subscription_key, :privatekey, :test_mode, :base_uri
|
23
23
|
|
24
24
|
def initialize(args = {})
|
25
25
|
@merchant_id = args[:merchant_id] || ''
|
26
26
|
@subscription_key = args[:subscription_key] || ''
|
27
27
|
@privatekey = args[:privatekey]
|
28
|
+
@test_mode = args[:test_mode] || false
|
28
29
|
@base_uri = 'https://api.mobeco.dk/appswitch/api/v1'
|
29
30
|
end
|
30
31
|
|
data/lib/mobilepay/requests.rb
CHANGED
@@ -28,6 +28,7 @@ module Mobilepay
|
|
28
28
|
req['Content-Type'] = 'application/json'
|
29
29
|
req['Ocp-Apim-Subscription-Key'] = subscription_key
|
30
30
|
req['AuthenticationSignature'] = generate_signature(req) unless privatekey.nil?
|
31
|
+
req['Test-mode'] = test_mode if test_mode == true
|
31
32
|
req.body = body
|
32
33
|
req
|
33
34
|
end
|
data/lib/mobilepay/security.rb
CHANGED
@@ -9,11 +9,12 @@ module Mobilepay
|
|
9
9
|
include Mobilepay::Requests
|
10
10
|
include Mobilepay::Requests::GenerateSignature
|
11
11
|
|
12
|
-
attr_reader :subscription_key, :privatekey, :base_uri
|
12
|
+
attr_reader :subscription_key, :privatekey, :test_mode, :base_uri
|
13
13
|
|
14
14
|
def initialize(args = {})
|
15
15
|
@subscription_key = args[:subscription_key] || ''
|
16
16
|
@privatekey = nil
|
17
|
+
@test_mode = false
|
17
18
|
@base_uri = 'https://api.mobeco.dk/merchantsecurity/api'
|
18
19
|
end
|
19
20
|
|
data/lib/mobilepay/version.rb
CHANGED