eps-rapid 1.0.0 → 1.0.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 +3 -0
- data/README.md +1 -1
- data/lib/eps-rapid/client.rb +8 -7
- data/lib/eps-rapid/content.rb +4 -4
- data/lib/eps-rapid/manage_booking.rb +5 -5
- data/lib/eps-rapid/notifications.rb +2 -2
- data/lib/eps-rapid/version.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: fd6b9fdb7c19bea18884ea30df65b97ed84880d783424dd10bf6c6cf60480a93
|
4
|
+
data.tar.gz: daf9a328813667def4c5d0cac9ab990bf03e7aa65256334e4c7c93c675b44868
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7700ad552e2d7e7c78ead9eac6899c4f933992338c9ea9e6bfda538b493dfc1bfd6fd0e9b09e33493612fd9e45d5eeb921b6c68d2cba11141b322ad74b260305
|
7
|
+
data.tar.gz: f253d0b98ab386f050fe2f6ee99db82c06b567020584745d6146d71d3541a10e28bf7a02cba0c796938a4011ac3587cfac28e625a37d6afe39318071d8a350fb
|
data/CHANGELOG.MD
CHANGED
@@ -18,3 +18,6 @@
|
|
18
18
|
- Move recommendation rate from Shopping to Recommendations class(#recommendation-resource)
|
19
19
|
# Removed
|
20
20
|
- Remove redundant methods get_by_link & post_by_link form client(#booking-resource)
|
21
|
+
### Version 1.0.1
|
22
|
+
# Changed
|
23
|
+
- add compatibility with ruby 3.0.0
|
data/README.md
CHANGED
@@ -128,7 +128,7 @@ The EPS Rapid Shopping API provides you with access to live rates and availabili
|
|
128
128
|
https://developer.expediapartnersolutions.com/documentation/rapid-shopping-docs-2-4/
|
129
129
|
#### Methods
|
130
130
|
```ruby
|
131
|
-
EpsRapid::
|
131
|
+
EpsRapid::Shopping.availability(occupancy: '2-9,4;2-8,6', property_id: '12345,567899', country_code: 'US', sales_environment: 'hotel_package', sales_channel: 'website', checkin: '2021-05-01', checkout: '2021-05-03', currency: 'USD', rate_plan_count: '1')
|
132
132
|
```
|
133
133
|
Returns rates on available room types for specified properties (maximum of 250 properties per request). The response includes rate details such as promos, whether the rate is refundable, cancellation penalties and a full price breakdown to meet the price display requirements for your market.
|
134
134
|
Note: If there are no available rooms, the response will be an empty array.
|
data/lib/eps-rapid/client.rb
CHANGED
@@ -7,7 +7,7 @@ require 'json'
|
|
7
7
|
module EpsRapid
|
8
8
|
class Client
|
9
9
|
class << self
|
10
|
-
def get(path,
|
10
|
+
def get(path, params)
|
11
11
|
uri = generate_uri(path, params)
|
12
12
|
req = Net::HTTP::Get.new(uri)
|
13
13
|
test_header, customer_ip_header = additional_headers(params)
|
@@ -15,7 +15,7 @@ module EpsRapid
|
|
15
15
|
fetch_data(uri, req, test_header, customer_ip_header)
|
16
16
|
end
|
17
17
|
|
18
|
-
def post(path, body,
|
18
|
+
def post(path, body, params)
|
19
19
|
uri = generate_uri(path, params)
|
20
20
|
req = Net::HTTP::Post.new(uri)
|
21
21
|
req.body = body.to_json
|
@@ -24,16 +24,17 @@ module EpsRapid
|
|
24
24
|
fetch_data(uri, req, test_header, customer_ip_header)
|
25
25
|
end
|
26
26
|
|
27
|
-
def put(path, body = {},
|
27
|
+
def put(path, body = {}, params)
|
28
28
|
uri = generate_uri(path, params)
|
29
29
|
req = Net::HTTP::Put.new(uri)
|
30
30
|
req.body = body.to_json
|
31
|
+
|
31
32
|
test_header, customer_ip_header = additional_headers(params)
|
32
33
|
|
33
34
|
fetch_data(uri, req, test_header, customer_ip_header)
|
34
35
|
end
|
35
36
|
|
36
|
-
def delete(path,
|
37
|
+
def delete(path, params)
|
37
38
|
uri = generate_uri(path, params)
|
38
39
|
req = Net::HTTP::Delete.new(uri)
|
39
40
|
test_header, customer_ip_header = additional_headers(params)
|
@@ -43,17 +44,17 @@ module EpsRapid
|
|
43
44
|
|
44
45
|
private
|
45
46
|
|
46
|
-
def generate_uri(path,
|
47
|
+
def generate_uri(path, params)
|
47
48
|
uri = URI("#{EpsRapid.base_path}/#{path}")
|
48
49
|
params.merge!({ language: EpsRapid.language })
|
49
50
|
transformed_params = transform_params(params)
|
50
|
-
transformed_params.
|
51
|
+
transformed_params.reject { |k,_| k == :customer_ip }
|
51
52
|
uri.query = URI.encode_www_form(transformed_params) unless path.include?('token')
|
52
53
|
|
53
54
|
uri
|
54
55
|
end
|
55
56
|
|
56
|
-
def transform_params(
|
57
|
+
def transform_params(params)
|
57
58
|
params.each do |k, v|
|
58
59
|
params[k] =
|
59
60
|
if k == :occupancy
|
data/lib/eps-rapid/content.rb
CHANGED
@@ -7,19 +7,19 @@ module EpsRapid
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.guest_review(property_id)
|
10
|
-
EpsRapid::Client.get("properties/#{property_id}/guest-reviews")
|
10
|
+
EpsRapid::Client.get("properties/#{property_id}/guest-reviews", {})
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.catalog_file
|
14
|
-
EpsRapid::Client.get('files/properties/catalog')
|
14
|
+
EpsRapid::Client.get('files/properties/catalog', {})
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.content_file
|
18
|
-
EpsRapid::Client.get('files/properties/content')
|
18
|
+
EpsRapid::Client.get('files/properties/content', {})
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.chains
|
22
|
-
EpsRapid::Client.get('chains')
|
22
|
+
EpsRapid::Client.get('chains', {})
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -2,23 +2,23 @@
|
|
2
2
|
|
3
3
|
module EpsRapid
|
4
4
|
class ManageBooking
|
5
|
-
def self.retrieve_bookings(
|
5
|
+
def self.retrieve_bookings(params)
|
6
6
|
EpsRapid::Client.get('itineraries', params)
|
7
7
|
end
|
8
8
|
|
9
|
-
def self.retrieve_booking(itinerary_id,
|
9
|
+
def self.retrieve_booking(itinerary_id, params)
|
10
10
|
EpsRapid::Client.get("itineraries/#{itinerary_id}", params)
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.cancel_held_booking(path,
|
13
|
+
def self.cancel_held_booking(path, params)
|
14
14
|
EpsRapid::Client.delete(path, params)
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.cancel_room(path,
|
17
|
+
def self.cancel_room(path, params)
|
18
18
|
EpsRapid::Client.delete(path, params)
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.change_room(path, body,
|
21
|
+
def self.change_room(path, body, params)
|
22
22
|
EpsRapid::Client.put(path, body, params)
|
23
23
|
end
|
24
24
|
end
|
@@ -3,11 +3,11 @@
|
|
3
3
|
module EpsRapid
|
4
4
|
class Notifications
|
5
5
|
def self.test_notification_event(event)
|
6
|
-
EpsRapid::Client.get("notifications/#{event}")
|
6
|
+
EpsRapid::Client.get("notifications/#{event}", {})
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.undeliverable_notifications
|
10
|
-
EpsRapid::Client.get('notifications/undeliverable')
|
10
|
+
EpsRapid::Client.get('notifications/undeliverable', {})
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/lib/eps-rapid/version.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.0.
|
4
|
+
version: 1.0.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: 2021-
|
11
|
+
date: 2021-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|