public VPOSClient(Config config) { ValidateConfig(config); _urlAPI = config.ApiUrl; _apiResultKey = config.ApiKey; _startKey = config.RedirectKey; _shopId = config.ShopID; _urlRedirect = config.RedirectUrl; _encoder = new MacEncoder(); _htmlTool = new HtmlTool(); if (config.Certificate != null) { _restClient = new RestClient(config.Timeout, config.Certificate); } else { _restClient = new RestClient(config.Timeout); } if (config.ProxyHost != null && !string.IsNullOrEmpty(config.ProxyPort.ToString())) { if (config.ProxyUsername != null && config.ProxyPassword != null) { SetProxy(config.ProxyHost, config.ProxyPort, config.ProxyUsername, config.ProxyPassword); } else { SetProxy(config.ProxyHost, config.ProxyPort); } } }
public VPOSClient(string apiUrl, string apiResultKey, string startKey, string shopId, string redirectUrl) { _encoder = new MacEncoder(); _restClient = new RestClient(15); _htmlTool = new HtmlTool(); _urlAPI = apiUrl; _apiResultKey = apiResultKey; _startKey = startKey; _shopId = shopId; _urlRedirect = redirectUrl; }