public BigCommerceProductsService(BigCommerceConfig config)
        {
            Condition.Requires(config, "config").IsNotNull();

            this._webRequestServices = new WebRequestServices(config, this.GetMarker());
            this._apiVersion         = config.GetAPIVersion();
        }
        public IBigCommerceCategoriesService CreateCategoriesService(BigCommerceConfig config)
        {
            var apiVersion = config.GetAPIVersion();
            var marker     = Guid.NewGuid().ToString();
            var services   = new WebRequestServices(config, marker);

            return(new BigCommerceCategoriesServiceV3(services));
        }
        public IBigCommerceProductsService CreateProductsService(BigCommerceConfig config)
        {
            var apiVersion = config.GetAPIVersion();
            var marker     = Guid.NewGuid().ToString();
            var services   = new WebRequestServices(config, marker);

            if (apiVersion == APIVersion.V2)
            {
                return(new BigCommerceProductsServiceV2(services));
            }

            return(new BigCommerceProductsServiceV3(services));
        }
Пример #4
0
        public async Task <Stream> RunAsync(Mark mark = null)
        {
            var webRequestServices = new WebRequestServices();
            var serviceUrl         = this.Url.ToString().TrimEnd('/') + MagentoRestPath + this.MagentoServicePath.ToString();
            var body       = this.Body.ToString();
            var method     = this.MagentoWebRequestMethod.ToString();
            var parameters = this.Parameters?.ToString();
            var rawHeaders = new Dictionary <string, string> {
                { "Authorization", $"Bearer {this.AuthorizationToken}" }
            };
            var requestAsync = await webRequestServices.CreateCustomRequestAsync(
                serviceUrl,
                body,
                rawHeaders,                 //TODO:create VO with builder!!!
                method,
                parameters).ConfigureAwait(false);

            MagentoLogger.LogTraceRequestMessage($"method:'{method}',url:'{serviceUrl}',parameters:'{parameters}',headers:{rawHeaders.ToJson()},body:'{body}'", mark);
            return(await webRequestServices.GetResponseStreamAsync(requestAsync, mark).ConfigureAwait(false));
        }
 public BigCommerceProductsServiceV3(WebRequestServices services) : base(services)
 {
 }
Пример #6
0
        public BigCommerceOrdersService(BigCommerceConfig config)
        {
            Condition.Requires(config, "config").IsNotNull();

            this._webRequestServices = new WebRequestServices(config);
        }
		public ShipStationService( ShipStationCredentials credentials )
		{
			this._webRequestServices = new WebRequestServices( credentials );
		}
Пример #8
0
        public ReverbOrdersService(ReverbConfig config)
        {
            Condition.Requires(config, "config").IsNotNull();

            this._webRequestServices = new WebRequestServices(config);
        }
Пример #9
0
        public BigCommerceBaseProductsService(WebRequestServices services)
        {
            Condition.Requires(services, "services").IsNotNull();

            this._webRequestServices = services;
        }
 public BigCommerceCategoriesServiceV3(WebRequestServices services) : base(services)
 {
 }
		public BigCommerceOrdersService( BigCommerceConfig config )
		{
			Condition.Requires( config, "config" ).IsNotNull();

			this._webRequestServices = new WebRequestServices( config );
		}
Пример #12
0
 public ShipStationService(ShipStationCredentials credentials)
 {
     this._webRequestServices = new WebRequestServices(credentials);
 }