lib/clearsale/connector.rb in clearsale-0.1.3 vs lib/clearsale/connector.rb in clearsale-0.1.4

- old
+ new

@@ -12,17 +12,19 @@ "production" => 'https://www.clearsale.com.br/integracaov2/service.asmx' } def self.build(env = ENV['CLEARSALE_ENV']) url = ENV["CLEARSALE_URL"] || URLs[env] || URLs["homolog"] - new url + proxy = ENV['CLEARSALE_PROXY'] + new url, proxy end - def initialize(endpoint_url) + def initialize(endpoint_url, proxy=nil) @token = ENV['CLEARSALE_ENTITYCODE'] - @client = Savon::Client.new do |wsdl| + @client = Savon::Client.new do |wsdl, http| wsdl.endpoint = endpoint_url wsdl.namespace = NAMESPACE + http.proxy = proxy if proxy end end def do_request(method, request) namespaced_request = append_namespace('int', request)