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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21ea86e95a6baf65805f5245e7122a19bee233b1
4
- data.tar.gz: b28efa9f653d940025fd2c3634d28194db9d491e
3
+ metadata.gz: ce66e1f4e1cc24f2a8b0cef1b32a25aab9ff1d9a
4
+ data.tar.gz: f47f52988544b9077a593b28608e64cc8c541c1c
5
5
  SHA512:
6
- metadata.gz: fc6dd487a46aac96d5f79defb481e67e724ea4cc1888509b3838582bb06118a7bd03be5067951daf5aa6384fadea529a5c2edf94ed9fc91bcb0e095cd49a4de5
7
- data.tar.gz: 290ef32d85ef0fe7b62d7bda949012e2dd2f4e59f83f46907c5363b5efd78375a71cf66b5b5335752ea76501c44dba4712d35ffa944adfbafca20403af6cef18
6
+ metadata.gz: 25f4e1764280d93fef798b6d0e911f0f848d14858c2d3cedbf790671719b62a068ce5451fa2e67f7d934bd09d042f95ceb4de50b0fb8ec43bdc95056088bb8ae
7
+ data.tar.gz: 459ee676056b24da21febbf25203c3b7537f0fdaa90721a7be4e979662d41ff4112b20ba0cfcb27cb66976242cc10da4c751e606722be6179866546312b7416a
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.1.5
6
+
7
+ - `Bookings#cancel_booking` supports passing attributes in body.
8
+
5
9
  ## 0.1.4
6
10
 
7
11
  - Drop support for `preferences_payments`.
@@ -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
- def cancel_booking(booking, options = {})
75
- delete "bookings/#{booking}"
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
@@ -1,5 +1,5 @@
1
1
  module BookingSync
2
2
  module API
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  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(:created_booking_id) {
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(created_booking_id)
118
- assert_requested :delete, bs_url("bookings/#{created_booking_id}")
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/840043
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.3
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
- - 2016-12-12 12:13:16 UTC
36
+ - 2017-06-21 17:31:45 UTC
45
37
  X-Ratelimit-Limit:
46
38
  - '1000'
47
39
  X-Ratelimit-Reset:
48
- - '1481547600'
40
+ - '1498068000'
49
41
  X-Ratelimit-Remaining:
50
- - '974'
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=/; secure
58
- - ahoy_visit=787c8bd2-11eb-42f0-bd08-d353187a4782; path=/; expires=Mon, 19 Dec
59
- 2016 12:13:16 -0000; secure
60
- - ahoy_visitor=113ed9a0-fc74-4c3c-be2c-5e177a24d93a; path=/; expires=Wed, 12
61
- Dec 2018 12:13:16 -0000; secure
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
- - 8269520e-314d-42b8-9132-8eed54676b1f
55
+ - b0d60bfe-47b5-42a7-9561-1c1cae003ce1
64
56
  X-Runtime:
65
- - '0.167782'
66
- Strict-Transport-Security:
67
- - max-age=31536000
57
+ - '6.442512'
58
+ Connection:
59
+ - close
68
60
  body:
69
61
  encoding: UTF-8
70
62
  string: ''
71
- http_version:
72
- recorded_at: Mon, 12 Dec 2016 12:13:17 GMT
73
- recorded_with: VCR 3.0.3
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
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-02-22 00:00:00.000000000 Z
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/cancels_given_booking.yml
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.6.10
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/cancels_given_booking.yml
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: