class Solo::License

Constants

SERVICEURI

Public Class Methods

add(arguments) click to toggle source
# File lib/solo/license.rb, line 23
def add(arguments)
  raise "Configuration Not Set" if Solo.configuration.nil?
  endpoint = URI(SERVICEURI + '/AddS')
  xml = String.new
  xml += '<AddS>'
  xml += Solo.configuration.to_xml
  arguments.each { |key, value| xml += "<#{key}>#{value}</#{key}>" }
  xml += '</AddS>'
  result = Net::HTTP.post_form(endpoint, 'xml' => xml)
  if result.code.to_i == 200
    parser = Nori.new
    parsed = parser.parse(result.body)
    result =  parsed["AddPrepaidLicense"]
  end
  return result
end
infocheck(license_id) click to toggle source
# File lib/solo/license.rb, line 6
def infocheck(license_id)
  raise "Configuration Not Set" if Solo.configuration.nil?
  endpoint = URI(SERVICEURI + '/InfoCheckS')
  xml = String.new
  xml += '<InfoCheckS>'
  xml += Solo.configuration.to_xml
  xml += "<LicenseID>#{license_id}</LicenseID>"
  xml += '</InfoCheckS>'
  result = Net::HTTP.post_form(endpoint, 'xml' => xml)
  if result.code.to_i == 200
    parser = Nori.new 
    parsed = parser.parse(result.body)
    result =  parsed["LicenseInfoCheck"]
  end
  return result
end