paypoint-blue 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/paypoint/blue/base.rb +13 -1
- data/lib/paypoint/blue/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d06c0daa9d1781a4cc739c7ab452b03ab3cfef4d
|
|
4
|
+
data.tar.gz: 85da4986ad62293a6d9086492c240cf5da35980a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce83528921c44c16dfe8919b2de5387bed04e4a73c5e3131365e10f6c9ce78ba391a21b603c18d69eca67e2c36d2bf09607bbe7c91f2266bb8f0260084b246e5
|
|
7
|
+
data.tar.gz: a74c42f433e60f04138bc74404bac810b8e62c29a8447c89a6ad8233d77f4bc143ef9be237c0e8dd8c67e9ce6cffcbf5ed83f174cb89739b21cfc4fbd762dc9d
|
data/lib/paypoint/blue/base.rb
CHANGED
|
@@ -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
|
|
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
|
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.
|
|
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:
|
|
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.
|
|
206
|
+
rubygems_version: 2.5.2.3
|
|
207
207
|
signing_key:
|
|
208
208
|
specification_version: 4
|
|
209
209
|
summary: API client for PayPoint Blue
|