Module: ViglinkApi::Merchant

Included in:
Client
Defined in:
lib/viglink_api/merchant.rb

Instance Method Summary collapse

Instance Method Details

#find_merchant_types(options = {}) ⇒ Hashie::Mash

Retrieve the list of MerchantTypes

the complete response

Parameters:

  • :full (Boolean)

    If set to true|y|yes then this will return

Returns:

  • (Hashie::Mash)

    MerchantType



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/viglink_api/merchant.rb', line 32

def find_merchant_types(options={})
  full_response = options.delete(:full) if options[:full]
  options[:key] = @api_key
  merchant_types_response = get('/vigcatalog/merchant_types.xml', options)

  if full_response.to_s.to_bool or @api_full_response
    merchant_types_response.response if merchant_types_response.response
  else
    merchant_types_response.response.results.merchant_types if merchant_types_response.response.results
  end
end

#find_merchants(options = {}) ⇒ Hashie::Mash

Retrieve the list of Merchants

the complete response

Parameters:

  • :full (Boolean)

    If set to true|y|yes then this will return

Returns:

  • (Hashie::Mash)

    Merchant



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/viglink_api/merchant.rb', line 13

def find_merchants(options={})
  full_response = options.delete(:full) if options[:full]
  options[:key] = @api_key
  merchants_response = get('/vigcatalog/merchants.xml', options)

  if full_response.to_s.to_bool or @api_full_response
    merchants_response.response if merchants_response.response
  else
    merchants_response.response.results.merchants if merchants_response.response.results
  end
end