Module: Vindi::Rest::Merchant

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

Overview

Methods for the merchants API

Instance Method Summary collapse

Instance Method Details

#current_merchantHash

Get a current merchant for the authenticate user

Examples:

Get a current merchant from vindi

client.current_merchant

Parameters:

  • merchant_id (Integer)

    ID of the merchant

Returns:

  • (Hash)

    The merchant you requested, if it exists

See Also:



25
26
27
# File 'lib/vindi/rest/merchant.rb', line 25

def current_merchant
  get("merchants/current")[:merchant]
end

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

List merchants for the authenticate user

Examples:

Get all merchants from merchant vindi

client.list_merchants

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 merchants for a merchant.



14
15
16
# File 'lib/vindi/rest/merchant.rb', line 14

def list_merchants(options = {})
  get('merchants', options)[:merchants]
end

#merchant(merchant_id, options = {}) ⇒ Object

Edit a merchant

Examples:

Get merchant #7 from vindi

client.merchant(7)

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :options (Hash)

    merchant attributes

See Also:



36
37
38
# File 'lib/vindi/rest/merchant.rb', line 36

def merchant(merchant_id, options = {})
  get("merchants/#{merchant_id}", options)[:merchant]
end