Class: MasspayRubySdk::CatalogService

Inherits:
Object
  • Object
show all
Defined in:
lib/masspay_ruby_sdk/api/catalog_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CatalogService

Returns a new instance of CatalogService.



15
16
17
# File 'lib/masspay_ruby_sdk/api/catalog_service.rb', line 15

def initialize(client)
  @client = client ||= Client.new
end

Instance Method Details

#get_cheapest_country_services(country_code, query_params = {}) ⇒ Object

Gets a list of Companies and their cheapest service offerings for the given country code. GET /payout/country/country_code/cheapest

Parameters:

  • query_params (defaults to: {})

    The query parameters



37
38
39
40
41
# File 'lib/masspay_ruby_sdk/api/catalog_service.rb', line 37

def get_cheapest_country_services country_code, query_params={}
  @client.get("payout/country/#{country_code}/cheapest") do |req|
    req.params = query_params
  end
end

#get_country_listObject

Gets a list of countries where services offered. GET /payout/country/list



21
22
23
# File 'lib/masspay_ruby_sdk/api/catalog_service.rb', line 21

def get_country_list 
  @client.get("payout/country/list") 
end

#get_country_services(country_code, query_params = {}) ⇒ Object

Gets a list of Companies and their service offerings for the given country code. GET /payout/country/country_code

Parameters:

  • query_params (defaults to: {})

    The query parameters



28
29
30
31
32
# File 'lib/masspay_ruby_sdk/api/catalog_service.rb', line 28

def get_country_services country_code, query_params={}
  @client.get("payout/country/#{country_code}") do |req|
    req.params = query_params
  end
end

#get_destination_token(destination_token, query_params = {}) ⇒ Object

Returns provided service GET /payout/service/destination_token

Parameters:

  • query_params (defaults to: {})

    The query parameters



52
53
54
55
56
# File 'lib/masspay_ruby_sdk/api/catalog_service.rb', line 52

def get_destination_token destination_token, query_params={}
  @client.get("payout/service/#{destination_token}") do |req|
    req.params = query_params
  end
end

#get_destination_token_alternatives(destination_token) ⇒ Object

Returns list of alternative service to a provided service GET /payout/service/destination_token/alternatives



45
46
47
# File 'lib/masspay_ruby_sdk/api/catalog_service.rb', line 45

def get_destination_token_alternatives destination_token
  @client.get("payout/service/#{destination_token}/alternatives") 
end

#get_user_agreement(query_params = {}) ⇒ Object

Get user agreement GET /payout/user-agreements

Parameters:

  • query_params (defaults to: {})

    The query parameters



61
62
63
64
65
# File 'lib/masspay_ruby_sdk/api/catalog_service.rb', line 61

def get_user_agreement query_params={}
  @client.get("payout/user-agreements") do |req|
    req.params = query_params
  end
end

#get_user_agreements_namesObject

Get available user agreements OPTIONS /payout/user-agreements



69
70
71
# File 'lib/masspay_ruby_sdk/api/catalog_service.rb', line 69

def get_user_agreements_names 
  @client.options("payout/user-agreements") 
end