Module: Vindi::Rest::MerchantUser

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

Overview

Methods for the merchant_users API

Instance Method Summary collapse

Instance Method Details

#create_merchant_user(options = {}) ⇒ Hash

Create a merchant_user for a merchant vindi

Examples:

Create a merchant_user for a merchant vindi

client.create_merchant_user(name: 'John Doe', email: '[email protected]', role_id: 10)

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :options (Hash)

    merchant_user attributes

Returns:

  • (Hash)

    The merchant_user created

See Also:



33
34
35
# File 'lib/vindi/rest/merchant_user.rb', line 33

def create_merchant_user(options = {})
  post('merchant_users', options)[:merchant_user]
end

#delete_merchant_user(merchant_user_id, options = {}) ⇒ Object

Delete a merchant_user from merchant vindi

Examples:

Delete merchant_user #36

client.delete_merchant_user(36)

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :options (Hash)

    merchant_user attributes

See Also:



56
57
58
# File 'lib/vindi/rest/merchant_user.rb', line 56

def delete_merchant_user(merchant_user_id, options = {})
  delete("merchant_users/#{merchant_user_id}", options)[:merchant_user]
end

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

List merchant_user for the authenticate user

Examples:

Get all merchant_users from merchant vindi

Returns:

  • (Array<Hash>)

    A list of merchant_users for a merchant.



11
12
13
# File 'lib/vindi/rest/merchant_user.rb', line 11

def list_merchant_users(options = {})
  get('merchant_users', options)[:merchant_users]
end

#merchant_user(merchant_user_id, options = {}) ⇒ Hash

Get a single merchant_user from a merchant

Examples:

Get merchant_user #7 from vindi

client.merchant_user(7)

Parameters:

  • merchant_user_id (Integer)

    ID of the merchant_user

Returns:

  • (Hash)

    The merchant_user you requested, if it exists

See Also:



22
23
24
# File 'lib/vindi/rest/merchant_user.rb', line 22

def merchant_user(merchant_user_id, options = {})
  get("merchant_users/#{merchant_user_id}", options)[:merchant_user]
end

#reactivate_merchant_user(merchant_user_id, options = {}) ⇒ Hash

Reactivate a merchant_user for a merchant vindi

Examples:

Reactivate a merchant_user for a merchant vindi

client.reactivate_merchant_user(37)

Returns:

  • (Hash)

    The merchant_user reactivated

See Also:



66
67
68
# File 'lib/vindi/rest/merchant_user.rb', line 66

def reactivate_merchant_user(merchant_user_id, options = {})
  post("merchant_users/#{merchant_user_id}/reactivate", options)[:merchant_user]
end

#update_merchant_user(merchant_user_id, options = {}) ⇒ Object

Edit a merchant_user

Examples:

update merchant_user #7

client.update_merchant_user(7, name: 'Joana Doe', email: '[email protected]')

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :options (Hash)

    merchant_user attributes

See Also:



44
45
46
# File 'lib/vindi/rest/merchant_user.rb', line 44

def update_merchant_user(merchant_user_id, options = {})
  put("merchant_users/#{merchant_user_id}", options)[:merchant_user]
end