Module: Vindi::Rest::PaymentMethod

Included in:
Vindi::Rest
Defined in:
lib/vindi/rest/payment_method.rb

Overview

Methods for the Payment Methods API

Instance Method Summary collapse

Instance Method Details

#list_payment_methods(options = {}) ⇒ Array<Hash>

List payment methods for the authenticate user

Examples:

Get all payment_methods from merchant vindi

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :page (Integer) — default: 1

    Page number.

  • :merchant (Integer)

    Merchant account

Returns:

  • (Array<Hash>)

    A list of payment_methods for a merchant.



13
14
15
# File 'lib/vindi/rest/payment_method.rb', line 13

def list_payment_methods(options = {})
  get('payment_methods', options)[:payment_methods]
end

#payment_method(payment_method_id, options = {}) ⇒ Hash

Get a single payment_method from a merchant

Examples:

Get payment_method #2 from vindi

client.payment_method(2)

Parameters:

  • payment_method_id (Integer)

    ID of the payment_method

Returns:

  • (Hash)

    The payment_method you requested, if it exists

See Also:



24
25
26
# File 'lib/vindi/rest/payment_method.rb', line 24

def payment_method(payment_method_id, options = {})
  get("payment_methods/#{payment_method_id}", options)[:payment_method]
end