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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05ee373ec4248f18c0dd7d5ce91f9c94bd612e78
4
- data.tar.gz: f803eefec6e1aaf711cc3c2be1cad9328ae42138
3
+ metadata.gz: 12cc0dcb6e0ea4953fd848675240243327d0e196
4
+ data.tar.gz: 9ef6567003bc4c4dbe47478288f89116a4d328d3
5
5
  SHA512:
6
- metadata.gz: bba178953ad4c70f8f60190f483809f303581942f3a5e4b050c5c4b60907bf74f887d7689e45a551628c41f60f7c65524eb6fdee26aaebf35fc769d8a327e15b
7
- data.tar.gz: fc0fb6ae892ad98a0c7d5397835cce0b03c8e7acf89968e6525dcb420b83294c8330ef8e8d036c11aa6cadcf9ecd2f05d8b67bdc186ad76f51527c8500b948e8
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
 
@@ -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
 
@@ -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
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Mobilepay
2
- VERSION = '1.1.3'
2
+ VERSION = '1.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobilepay
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Bogdanov