# frozen_string_literal: true module Payment module Manager module Request def self.get_from_api(path, params) api_url = Payment::Manager::Config.api_url final_url = api_url + path get(final_url, params) end def self.get(url, params) uri = URI(url) uri.query = URI.encode_www_form(params) conn(uri).get(uri) end def self.conn(uri) http = Net::HTTP.new(uri.hostname, uri.port) http.use_ssl = uri.scheme == 'https' http end end end end