bookingsync-api 0.1.4 → 0.1.5
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/lib/bookingsync/api/client/bookings.rb +10 -2
- data/lib/bookingsync/api/version.rb +1 -1
- data/spec/bookingsync/api/client/bookings_spec.rb +5 -6
- data/spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_cancel_booking/{cancels_given_booking.yml → cancels_given_booking_and_passes_options_along_as_bookings_payload.yml} +18 -26
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce66e1f4e1cc24f2a8b0cef1b32a25aab9ff1d9a
|
4
|
+
data.tar.gz: f47f52988544b9077a593b28608e64cc8c541c1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25f4e1764280d93fef798b6d0e911f0f848d14858c2d3cedbf790671719b62a068ce5451fa2e67f7d934bd09d042f95ceb4de50b0fb8ec43bdc95056088bb8ae
|
7
|
+
data.tar.gz: 459ee676056b24da21febbf25203c3b7537f0fdaa90721a7be4e979662d41ff4112b20ba0cfcb27cb66976242cc10da4c751e606722be6179866546312b7416a
|
data/CHANGELOG.md
CHANGED
@@ -70,9 +70,17 @@ module BookingSync::API
|
|
70
70
|
#
|
71
71
|
# @param booking [BookingSync::API::Resource|Integer] Booking or ID of
|
72
72
|
# the booking to be canceled.
|
73
|
+
# @param options [Hash] Booking attributes to be updated.
|
74
|
+
# (For now, only `cancelation_reason` is allowed)
|
73
75
|
# @return [NilClass] Returns nil on success.
|
74
|
-
|
75
|
-
|
76
|
+
# @example
|
77
|
+
# @api.cancel_booking(booking_id)
|
78
|
+
#
|
79
|
+
# @example Providing cancelation_reason
|
80
|
+
# @api.cancel_booking(booking_id, { cancelation_reason: "payment_failed" })
|
81
|
+
def cancel_booking(booking, options = nil)
|
82
|
+
options = { bookings: [options] } if options
|
83
|
+
delete "bookings/#{booking}", options
|
76
84
|
end
|
77
85
|
end
|
78
86
|
end
|
@@ -109,13 +109,12 @@ describe BookingSync::API::Client::Bookings do
|
|
109
109
|
end
|
110
110
|
|
111
111
|
describe ".cancel_booking", :vcr do
|
112
|
-
let(:
|
113
|
-
find_resource("#{@casette_base_path}_create_booking/creates_a_booking.yml", "bookings")[:id]
|
114
|
-
}
|
112
|
+
let(:booking_id_to_be_canceled) { 796 }
|
115
113
|
|
116
|
-
it "cancels given booking" do
|
117
|
-
client.cancel_booking(
|
118
|
-
assert_requested :delete, bs_url("bookings/#{
|
114
|
+
it "cancels given booking and passes options along as bookings payload" do
|
115
|
+
client.cancel_booking(booking_id_to_be_canceled, cancelation_reason: "payment_failed")
|
116
|
+
assert_requested :delete, bs_url("bookings/#{booking_id_to_be_canceled}"),
|
117
|
+
body: { bookings: [{ cancelation_reason: "payment_failed" }] }.to_json
|
119
118
|
end
|
120
119
|
end
|
121
120
|
end
|
@@ -2,13 +2,13 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: delete
|
5
|
-
uri: https://www.bookingsync.com/api/v3/bookings/
|
5
|
+
uri: https://www.bookingsync.com/api/v3/bookings/796
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: "{}
|
8
|
+
string: '{"bookings":[{"cancelation_reason":"payment_failed"}]}'
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- BookingSync API gem v0.1.
|
11
|
+
- BookingSync API gem v0.1.4
|
12
12
|
Accept:
|
13
13
|
- application/vnd.api+json
|
14
14
|
Content-Type:
|
@@ -26,14 +26,6 @@ http_interactions:
|
|
26
26
|
code: 204
|
27
27
|
message: No Content
|
28
28
|
headers:
|
29
|
-
Server:
|
30
|
-
- nginx
|
31
|
-
Date:
|
32
|
-
- Mon, 12 Dec 2016 12:13:17 GMT
|
33
|
-
Connection:
|
34
|
-
- keep-alive
|
35
|
-
Status:
|
36
|
-
- 204 No Content
|
37
29
|
X-Frame-Options:
|
38
30
|
- SAMEORIGIN
|
39
31
|
X-Xss-Protection:
|
@@ -41,33 +33,33 @@ http_interactions:
|
|
41
33
|
X-Content-Type-Options:
|
42
34
|
- nosniff
|
43
35
|
X-Updated-Since-Request-Synced-At:
|
44
|
-
-
|
36
|
+
- 2017-06-21 17:31:45 UTC
|
45
37
|
X-Ratelimit-Limit:
|
46
38
|
- '1000'
|
47
39
|
X-Ratelimit-Reset:
|
48
|
-
- '
|
40
|
+
- '1498068000'
|
49
41
|
X-Ratelimit-Remaining:
|
50
|
-
- '
|
42
|
+
- '999'
|
51
43
|
Cache-Control:
|
52
44
|
- no-cache
|
53
45
|
P3p:
|
54
46
|
- CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
|
55
47
|
OUR SAMi OTRo UNRo PUBi IND UNI STA"
|
56
48
|
Set-Cookie:
|
57
|
-
- ahoy_track=true; path
|
58
|
-
- ahoy_visit=
|
59
|
-
|
60
|
-
- ahoy_visitor=
|
61
|
-
|
49
|
+
- ahoy_track=true; path=/
|
50
|
+
- ahoy_visit=3fbaacc4-8804-4d56-b04b-a5c73776f30f; path=/; expires=Wed, 28 Jun
|
51
|
+
2017 17:31:45 -0000
|
52
|
+
- ahoy_visitor=fdfdf051-d834-454d-b972-b7185b40cc22; path=/; expires=Fri, 21
|
53
|
+
Jun 2019 17:31:45 -0000
|
62
54
|
X-Request-Id:
|
63
|
-
-
|
55
|
+
- b0d60bfe-47b5-42a7-9561-1c1cae003ce1
|
64
56
|
X-Runtime:
|
65
|
-
- '
|
66
|
-
|
67
|
-
-
|
57
|
+
- '6.442512'
|
58
|
+
Connection:
|
59
|
+
- close
|
68
60
|
body:
|
69
61
|
encoding: UTF-8
|
70
62
|
string: ''
|
71
|
-
http_version:
|
72
|
-
recorded_at:
|
73
|
-
recorded_with: VCR
|
63
|
+
http_version:
|
64
|
+
recorded_at: Wed, 21 Jun 2017 17:31:50 GMT
|
65
|
+
recorded_with: VCR 2.9.3
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookingsync-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sébastien Grosjean
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -244,7 +244,7 @@ files:
|
|
244
244
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_auto_paginate_true/returns_all_bookings_joined_from_many_requests.yml
|
245
245
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_per_page_setting/returns_limited_number_of_bookings.yml
|
246
246
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/returns_bookings.yml
|
247
|
-
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_cancel_booking/
|
247
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_cancel_booking/cancels_given_booking_and_passes_options_along_as_bookings_payload.yml
|
248
248
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_create_booking/creates_a_booking.yml
|
249
249
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_edit_booking/updates_given_booking_by_ID.yml
|
250
250
|
- spec/fixtures/cassettes/BookingSync_API_Client_BookingsFees/_bookings_fee/returns_a_single_bookings_fee.yml
|
@@ -386,7 +386,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
386
386
|
version: '0'
|
387
387
|
requirements: []
|
388
388
|
rubyforge_project:
|
389
|
-
rubygems_version: 2.
|
389
|
+
rubygems_version: 2.5.1
|
390
390
|
signing_key:
|
391
391
|
specification_version: 4
|
392
392
|
summary: Ruby interface for accessing https://www.bookingsync.com
|
@@ -463,7 +463,7 @@ test_files:
|
|
463
463
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_auto_paginate_true/returns_all_bookings_joined_from_many_requests.yml
|
464
464
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_per_page_setting/returns_limited_number_of_bookings.yml
|
465
465
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_bookings/returns_bookings.yml
|
466
|
-
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_cancel_booking/
|
466
|
+
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_cancel_booking/cancels_given_booking_and_passes_options_along_as_bookings_payload.yml
|
467
467
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_create_booking/creates_a_booking.yml
|
468
468
|
- spec/fixtures/cassettes/BookingSync_API_Client_Bookings/_edit_booking/updates_given_booking_by_ID.yml
|
469
469
|
- spec/fixtures/cassettes/BookingSync_API_Client_BookingsFees/_bookings_fee/returns_a_single_bookings_fee.yml
|
@@ -585,3 +585,4 @@ test_files:
|
|
585
585
|
- spec/fixtures/files/test.jpg
|
586
586
|
- spec/spec_helper.rb
|
587
587
|
- spec/support/vcr_helper.rb
|
588
|
+
has_rdoc:
|