quickpay-ruby-client 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +9 -5
- data/lib/quickpay/api/client.rb +7 -2
- data/lib/quickpay/api/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 041757ab3e9e7688c4c0e0b4bb523c1b16baf875746c2fa8801d9c004f1a174e
|
4
|
+
data.tar.gz: d2baacb035ee593e3c3245a011ddf163835b3c219b0b9126c513b82a4809439b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63a8c25391f66f1be08c39af42fb0542692f9c29725f4d93318f7929aec4cd199e12868236e065c6425d262242838a20c82286d3635c4092333c2941eea3e260
|
7
|
+
data.tar.gz: b3d8ac7466ea38f24bdc7a52f50538beced740eba4a5cc447486d1694a5b073c7d1d8834586ecf76e1c8720718427f95650d9e77669a5b69197db61cb9f89414
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -58,13 +58,15 @@ You can also set some connection specific options (default values shown):
|
|
58
58
|
|
59
59
|
```ruby
|
60
60
|
client = Quickpay::API::Client.new(
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
options: {
|
62
|
+
read_timeout: 60,
|
63
|
+
write_timeout: 60,
|
64
|
+
connect_timeout: 60,
|
65
|
+
json_opts: { symbolize_names: true }
|
66
|
+
}
|
64
67
|
)
|
65
68
|
```
|
66
69
|
|
67
|
-
|
68
70
|
### Sending request
|
69
71
|
|
70
72
|
You can afterwards call any method described in QuickPay API with corresponding http method and endpoint. These methods are supported currently: `get`, `post`, `put`, `patch`, `delete` and `head`.
|
@@ -81,6 +83,7 @@ Beyond the endpoint, the client accepts the following options (default values sh
|
|
81
83
|
* `headers: {}`
|
82
84
|
* `query: {}`
|
83
85
|
* `raw: false`
|
86
|
+
* `json_opts: nil`
|
84
87
|
|
85
88
|
```ruby
|
86
89
|
response = client.post(
|
@@ -88,7 +91,8 @@ response = client.post(
|
|
88
91
|
body: { amount: 100 }.to_json,
|
89
92
|
headers: { "Content-Type" => "application/json" },
|
90
93
|
query: { "synchronized" => "" },
|
91
|
-
raw: false
|
94
|
+
raw: false,
|
95
|
+
json_opts: { symbolize_names: true }
|
92
96
|
)
|
93
97
|
|
94
98
|
```
|
data/lib/quickpay/api/client.rb
CHANGED
@@ -15,7 +15,8 @@ module QuickPay
|
|
15
15
|
opts = {
|
16
16
|
read_timeout: options.fetch(:read_timeout, 60),
|
17
17
|
write_timeout: options.fetch(:write_timeout, 60),
|
18
|
-
connect_timeout: options.fetch(:connect_timeout, 60)
|
18
|
+
connect_timeout: options.fetch(:connect_timeout, 60),
|
19
|
+
json_opts: options.fetch(:json_opts, nil)
|
19
20
|
}
|
20
21
|
|
21
22
|
opts[:username] = Excon::Utils.escape_uri(username) if username
|
@@ -49,7 +50,11 @@ module QuickPay
|
|
49
50
|
else
|
50
51
|
raise QuickPay::API::Error.by_status_code(res.status, res.body, res.headers) if res.status >= 400
|
51
52
|
|
52
|
-
res.headers["Content-Type"] == "application/json"
|
53
|
+
if res.headers["Content-Type"] == "application/json"
|
54
|
+
JSON.parse(res.body, options.dig(:json_opts) || @connection.data.dig(:json_opts))
|
55
|
+
else
|
56
|
+
res.body
|
57
|
+
end
|
53
58
|
end
|
54
59
|
end
|
55
60
|
end
|
data/lib/quickpay/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quickpay-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- QuickPay Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -147,7 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
|
150
|
+
rubyforge_project:
|
151
|
+
rubygems_version: 2.7.6
|
151
152
|
signing_key:
|
152
153
|
specification_version: 4
|
153
154
|
summary: Ruby client for QuickPay API
|