Module: BookingSync::API::Client::BookingsPayments

Included in:
BookingSync::API::Client
Defined in:
lib/bookingsync/api/client/bookings_payments.rb

Instance Method Summary collapse

Instance Method Details

#bookings_payment(bookings_payment, options = {}) ⇒ BookingSync::API::Resource

Get a single bookings payment

Parameters:

  • bookings_payment (BookingSync::API::Resource|Integer)

    BookingsPayment or ID of the bookings payment.

  • options (Hash) (defaults to: {})

    A customizable set of query options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:



28
29
30
# File 'lib/bookingsync/api/client/bookings_payments.rb', line 28

def bookings_payment(bookings_payment, options = {})
  get("bookings_payments/#{bookings_payment}", options).pop
end

#bookings_payments(options = {}, &block) ⇒ Array<BookingSync::API::Resource>

List bookings payments

Returns bookings payments for the account user is authenticated with.

Examples:

Get the list of bookings payments for the current account

bookings_payments = @api.bookings_payments
bookings_payments.first.amount # => 200

Get the list of bookings payments only with amount and currency for smaller response

@api.bookings_payments(fields: [:amount, :currency])

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:

See Also:



17
18
19
# File 'lib/bookingsync/api/client/bookings_payments.rb', line 17

def bookings_payments(options = {}, &block)
  paginate :bookings_payments, options, &block
end