eps-rapid 1.0.1 → 1.1.0
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 +2 -1
- data/lib/eps-rapid/client.rb +7 -1
- data/lib/eps-rapid/version.rb +1 -1
- data/lib/eps-rapid.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcd0be2a6d1af3b238c2ec17798b45c5ad65d8ef70bdb191fcad9d18981646ae
|
4
|
+
data.tar.gz: 509b3b7ddda1704f4ef624319caa554cf5cfc764d2863502447d62515509a216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b687c4e03a0e12afd35605d2ab68c106acd5ffa5271a3f20c0ddf05bd7e9a1b4c1f1d9a06e1fe8c8751f87dd076a254715b12af3274940b5f43926c645e661e
|
7
|
+
data.tar.gz: 48c5da42c39b792eaba211f574bac1d73a8ed1c318885fe37ba56ab1559897ddf6d5b85b1f3ed967dc0dd55bfbd5b2d3e10ea5e959aeb8791b7dd954fa849b51
|
data/CHANGELOG.MD
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# eps-rapid
|
2
|
-
Ruby gem for the eps-rapid 2.4 API
|
2
|
+
Ruby gem for the eps-rapid 2.4 and 3 API
|
3
3
|
|
4
4
|
## Installation
|
5
5
|
|
@@ -20,6 +20,7 @@ EpsRapid.configure do |c|
|
|
20
20
|
c.secret_key = 'YOUR_SECRET_KEY'
|
21
21
|
c.base_path = 'BASE_PATH'
|
22
22
|
c.language = 'en-US'
|
23
|
+
c.logger = Logger.new(nil)
|
23
24
|
end
|
24
25
|
```
|
25
26
|
Base path depends of environment and can be `https://test.ean.com/2.4` or `https://api.ean.com/2.4`
|
data/lib/eps-rapid/client.rb
CHANGED
@@ -79,13 +79,15 @@ module EpsRapid
|
|
79
79
|
req['Customer-Ip'] = customer_ip if customer_ip != ''
|
80
80
|
req['Test'] = test_header if test_header != ''
|
81
81
|
|
82
|
+
logger.debug("Request: #{uri.to_s}: #{req.body}")
|
82
83
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
|
84
|
+
logger.debug("Response: #{response.code.to_i}: #{response.body}")
|
83
85
|
|
84
86
|
case response.code.to_i
|
85
87
|
when HttpStatusCodes::HTTP_OK_CODE, HttpStatusCodes::HTTP_CREATED_CODE
|
86
88
|
JSON.parse(response.body)
|
87
89
|
when HttpStatusCodes::HTTP_NO_CONTENT_CODE
|
88
|
-
'
|
90
|
+
{ 'status' => 204 }
|
89
91
|
else
|
90
92
|
raise error_class(response.code), "Code: #{response.code}, Error: #{map_error_messages(response.body)}"
|
91
93
|
end
|
@@ -125,6 +127,10 @@ module EpsRapid
|
|
125
127
|
parsed_errors['message']
|
126
128
|
end
|
127
129
|
end
|
130
|
+
|
131
|
+
def logger
|
132
|
+
EpsRapid.logger || Logger.new(nil)
|
133
|
+
end
|
128
134
|
end
|
129
135
|
end
|
130
136
|
end
|
data/lib/eps-rapid/version.rb
CHANGED
data/lib/eps-rapid.rb
CHANGED
@@ -12,10 +12,11 @@ require 'eps-rapid/manage_booking'
|
|
12
12
|
require 'eps-rapid/recommendations'
|
13
13
|
require 'eps-rapid/notifications'
|
14
14
|
require 'digest'
|
15
|
+
require 'logger'
|
15
16
|
|
16
17
|
module EpsRapid
|
17
18
|
class << self
|
18
|
-
attr_accessor :api_key, :secret_key, :base_path, :language
|
19
|
+
attr_accessor :api_key, :secret_key, :base_path, :language, :logger
|
19
20
|
|
20
21
|
def configure
|
21
22
|
yield(self)
|
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.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Leonenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
|
-
rubygems_version: 3.
|
94
|
+
rubygems_version: 3.2.3
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Ruby wrapper for the expediapartnersolutions.com api
|