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) ⇒ NilClass
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.
-
#payment(payment, options = {}) ⇒ BookingSync::API::Resource
Get a single payment.
-
#payments(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List payments.
Instance Method Details
#cancel_payment(payment) ⇒ NilClass
Cancel a payment
59 60 61 |
# File 'lib/bookingsync/api/client/payments.rb', line 59 def cancel_payment(payment) delete "payments/#{payment}" end |
#create_payment(booking_id, options = {}) ⇒ BookingSync::API::Resource
Create a new payment
37 38 39 |
# File 'lib/bookingsync/api/client/payments.rb', line 37 def create_payment(booking_id, = {}) post("bookings/#{booking_id}/payments", payments: []).pop end |
#edit_payment(payment, options = {}) ⇒ BookingSync::API::Resource
Edit a payment
to be updated
50 51 52 |
# File 'lib/bookingsync/api/client/payments.rb', line 50 def edit_payment(payment, = {}) put("payments/#{payment}", payments: []).pop end |
#payment(payment, options = {}) ⇒ BookingSync::API::Resource
Get a single payment
28 29 30 |
# File 'lib/bookingsync/api/client/payments.rb', line 28 def payment(payment, = {}) get("payments/#{payment}", ).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 |