eps-rapid 1.1.2 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.MD +6 -0
- data/README.md +1 -1
- data/lib/eps-rapid/client.rb +9 -1
- data/lib/eps-rapid/errors/http_status_codes.rb +1 -0
- data/lib/eps-rapid/version.rb +1 -1
- data/lib/eps-rapid.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b7954810099c42c3f5afa0cbf1149e03cffa77fa461663ad1cc31e1a9c23fee
|
4
|
+
data.tar.gz: 226f6e7d9cd8f080da039b04b13e56fe7ee5cb952aef350514c4c60a25597406
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca1ea0705b9dd8f8ff46135096102035940ce75c8df5fc42a6f3c99481276042117909667a0b36b52b957190713997b950e8da83aeb9558e9f1343a9ab71916e
|
7
|
+
data.tar.gz: a75e69ad91e8d1fc1a4c0a0d714ef200f482ffe66b80af000b20e1430ac8d0feed0ae114a9a958964567487582be6464f37d23302a4ecf599c150af85d53437a
|
data/CHANGELOG.MD
CHANGED
@@ -28,3 +28,9 @@
|
|
28
28
|
### Version 1.1.1
|
29
29
|
# Patched
|
30
30
|
- support for multi-value params, i.e. `property_id: [1234, 2345]` is translated to `property_id=1234&property_id=2345`
|
31
|
+
### Version 1.1.3
|
32
|
+
# Patched
|
33
|
+
- support 202 response
|
34
|
+
### Version 1.2.0
|
35
|
+
# Changed
|
36
|
+
- configuration: language -> language_resolver
|
data/README.md
CHANGED
data/lib/eps-rapid/client.rb
CHANGED
@@ -46,7 +46,7 @@ module EpsRapid
|
|
46
46
|
|
47
47
|
def generate_uri(path, params)
|
48
48
|
uri = URI("#{EpsRapid.base_path}/#{path}")
|
49
|
-
params.merge!({ language:
|
49
|
+
params.merge!({ language: language })
|
50
50
|
transformed_params = transform_params(params)
|
51
51
|
transformed_params.reject { |k,_| k == :customer_ip }
|
52
52
|
uri.query = URI.encode_www_form(transformed_params) unless path.include?('token')
|
@@ -54,6 +54,10 @@ module EpsRapid
|
|
54
54
|
uri
|
55
55
|
end
|
56
56
|
|
57
|
+
def language
|
58
|
+
EpsRapid.language_resolver.call
|
59
|
+
end
|
60
|
+
|
57
61
|
def transform_params(params)
|
58
62
|
params.each do |k, v|
|
59
63
|
params[k] =
|
@@ -88,9 +92,13 @@ module EpsRapid
|
|
88
92
|
case response.code.to_i
|
89
93
|
when HttpStatusCodes::HTTP_OK_CODE, HttpStatusCodes::HTTP_CREATED_CODE
|
90
94
|
JSON.parse(response.body)
|
95
|
+
when HttpStatusCodes::HTTP_ACCEPTED_CODE
|
96
|
+
{ 'status' => 202 }
|
91
97
|
when HttpStatusCodes::HTTP_NO_CONTENT_CODE
|
92
98
|
{ 'status' => 204 }
|
93
99
|
else
|
100
|
+
logger.warn("Request with error: #{uri} headers=(#{req.to_hash}): body=(#{req.body})")
|
101
|
+
logger.warn("Response with error: #{response.code} headers=(#{response.to_hash}): body=(#{response.body})")
|
94
102
|
raise error_class(response.code), "Code: #{response.code}, Error: #{map_error_messages(response.body)}"
|
95
103
|
end
|
96
104
|
end
|
data/lib/eps-rapid/version.rb
CHANGED
data/lib/eps-rapid.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eps-rapid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Leonenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|