Module: BookingSync::API::Client::PaymentGateways

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

Instance Method Summary collapse

Instance Method Details

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

Get a single payment gateway

Parameters:

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

    PaymentGateway or ID of the payment gateway.

  • 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/payment_gateways.rb', line 28

def payment_gateway(payment_gateway, options = {})
  get("payment_gateways/#{payment_gateway}", options).pop
end

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

List payment gateways

Returns payment gateways for the account user is authenticated with.

Examples:

Get the list of payment gateways for the current account

payment_gateways = @api.payment_gateways
payment_gateways.first.gateway_name # => "blue_pay"

Get the list of payment gateways only with gateway_name for smaller response

@api.payment_gateways(fields: [:gateway_name])

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/payment_gateways.rb', line 17

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