コード例 #1
0
        public ShipMethodDisplay PutShipMethod(ShipMethodDisplay method)
        {
            var provider = _shippingContext.GetProviderByKey(method.ProviderKey);

            var shippingMethod = provider.ShipMethods.FirstOrDefault(x => x.Key == method.Key);

            shippingMethod = method.ToShipMethod(shippingMethod);

            provider.GatewayProviderService.Save(shippingMethod);

            return(shippingMethod.ToShipMethodDisplay());
        }
コード例 #2
0
        public HttpResponseMessage PutShipMethod(ShipMethodDisplay method)
        {
            var response = Request.CreateResponse(HttpStatusCode.OK);

            try
            {
                var provider = _shippingContext.CreateInstance(method.ProviderKey);

                var shippingMethod = provider.ShipMethods.FirstOrDefault(x => x.Key == method.Key);

                shippingMethod = method.ToShipMethod(shippingMethod);

                provider.GatewayProviderService.Save(shippingMethod);
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, String.Format("{0}", ex.Message));
            }

            return(response);
        }
コード例 #3
0
        public ShipMethodDisplay PutShipMethod(ShipMethodDisplay method)
        {
            var provider = _shippingContext.GetProviderByKey(method.ProviderKey);

            var shippingMethod = provider.ShipMethods.FirstOrDefault(x => x.Key == method.Key);

            shippingMethod = method.ToShipMethod(shippingMethod);

            provider.GatewayProviderService.Save(shippingMethod);

            return shippingMethod.ToShipMethodDisplay();
        }