paypoint-blue 1.0.1 → 1.0.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: 989c17bf88c7d68e02134ca98e6a057b75ac95a5
4
- data.tar.gz: 5e83d698ea9387d47c2dd1bcc9c59cd9eae2a518
3
+ metadata.gz: d06c0daa9d1781a4cc739c7ab452b03ab3cfef4d
4
+ data.tar.gz: 85da4986ad62293a6d9086492c240cf5da35980a
5
5
  SHA512:
6
- metadata.gz: 1689cf98da0380b665e412da02d0811d939591938994bd703e73b4206a51f2a5c9ae95201b42fdc37d56e425c2b1674448639a67f93eecfe104c2f04346bd379
7
- data.tar.gz: bcb9fc93840ccdaed4d4f0a35ef12d3f6a38e586f1a03a7bdc1e2af44036594be28352f276ab025f35c6ef40e2138790c97cd82b9f945792eb171973556ddaa4
6
+ metadata.gz: ce83528921c44c16dfe8919b2de5387bed04e4a73c5e3131365e10f6c9ce78ba391a21b603c18d69eca67e2c36d2bf09607bbe7c91f2266bb8f0260084b246e5
7
+ data.tar.gz: a74c42f433e60f04138bc74404bac810b8e62c29a8447c89a6ad8233d77f4bc143ef9be237c0e8dd8c67e9ce6cffcbf5ed83f174cb89739b21cfc4fbd762dc9d
@@ -52,6 +52,9 @@ module PayPoint
52
52
  # @option options [String] :runscope when used, all traffic will
53
53
  # pass through the provided {https://www.runscope.com/ Runscope}
54
54
  # bucket, including notification callbacks
55
+ # @option options [Integer] :timeout waiting for response in seconds
56
+ # @option options [Integer] :open_timeout waiting for opening a connection
57
+ # in seconds
55
58
  def initialize(endpoint:, inst_id: ENV["BLUE_API_INSTALLATION"],
56
59
  api_id: ENV["BLUE_API_ID"], api_password: ENV["BLUE_API_PASSWORD"],
57
60
  **options)
@@ -63,7 +66,7 @@ module PayPoint
63
66
  api_password or fail ArgumentError, "missing api_password"
64
67
 
65
68
  self.defaults = options.delete(:defaults)
66
- @options = options.merge url: @endpoint
69
+ @options = options.merge(url: @endpoint, **request_timeouts(options))
67
70
  @client = build_client
68
71
  end
69
72
 
@@ -75,6 +78,15 @@ module PayPoint
75
78
  self.class.const_get("ENDPOINTS").fetch(endpoint, endpoint.to_s)
76
79
  end
77
80
 
81
+ def request_timeouts(timeout_options)
82
+ {
83
+ request: {
84
+ open_timeout: timeout_options[:open_timeout] || 2,
85
+ timeout: timeout_options[:timeout] || 5,
86
+ }
87
+ }
88
+ end
89
+
78
90
  def client_options
79
91
  options.select { |k, _| Faraday::ConnectionOptions.members.include?(k) }
80
92
  end
@@ -1,5 +1,5 @@
1
1
  module PayPoint
2
2
  module Blue
3
- VERSION = "1.0.1".freeze
3
+ VERSION = "1.0.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypoint-blue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laszlo Bacsi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-18 00:00:00.000000000 Z
11
+ date: 2019-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  version: '0'
204
204
  requirements: []
205
205
  rubyforge_project:
206
- rubygems_version: 2.4.5
206
+ rubygems_version: 2.5.2.3
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: API client for PayPoint Blue