Module: BookingSync::API::Client::Payments
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/payments.rb
Instance Method Summary collapse
-
#cancel_payment(payment, options = {}) ⇒ Array
Cancel a payment.
-
#create_payment(booking_id, options = {}) ⇒ BookingSync::API::Resource
Create a new payment.
-
#edit_payment(payment, options = {}) ⇒ BookingSync::API::Resource
Edit a payment.
-
#payments(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List payments.
Instance Method Details
#cancel_payment(payment, options = {}) ⇒ Array
Cancel a payment
to be canceled
48 49 50 |
# File 'lib/bookingsync/api/client/payments.rb', line 48 def cancel_payment(payment, = {}) delete "payments/#{payment}" end |
#create_payment(booking_id, options = {}) ⇒ BookingSync::API::Resource
Create a new payment
26 27 28 |
# File 'lib/bookingsync/api/client/payments.rb', line 26 def create_payment(booking_id, = {}) post(:payments, booking_id: booking_id, payments: []).pop end |
#edit_payment(payment, options = {}) ⇒ BookingSync::API::Resource
Edit a payment
to be updated
39 40 41 |
# File 'lib/bookingsync/api/client/payments.rb', line 39 def edit_payment(payment, = {}) put("payments/#{payment}", payments: []).pop end |
#payments(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List payments
Returns payments for the account user is authenticated with.
17 18 19 |
# File 'lib/bookingsync/api/client/payments.rb', line 17 def payments( = {}, &block) paginate :payments, , &block end |