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()); }
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); }
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(); }