public IActionResult Pay(string orderId) { var order = _orderService.Get(orderId); var items = _orderItemService.Get(m => m.OrderId == orderId); if (!items.Any()) { return(Redirect("~/")); } AlipayTradePagePayModel model = new AlipayTradePagePayModel { Body = string.Join(",", items.Select(m => m.Title)), Subject = items.First().Title, TotalAmount = order.Total.ToString("F2"), OutTradeNo = orderId, ProductCode = "FAST_INSTANT_TRADE_PAY" }; AlipayTradePagePayRequest request = new AlipayTradePagePayRequest(); // 设置同步回调地址 request.SetReturnUrl($"{_hostOptionProvider.GetOrigin()}/AliPay/Callback"); // 设置异步通知接收地址 request.SetNotifyUrl($"{_hostOptionProvider.GetOrigin()}/AliPay/Notify"); request.SetBizModel(model); var response = _alipayService.SdkExecute(request); _orderService.BeginPay(order); return(Redirect(_alipayService.Options.Gatewayurl + "?" + response.Body)); }
public override Order Get(params object[] primaryKey) { Order order = base.Get(primaryKey); order.OrderItems = _orderItemService.Get(m => m.OrderId == order.ID); return(order); }
public void OnInserted(ShipmentItem entity) { //update shipment status entity.Shipment.ShipmentStatus = ShipmentStatus.Packaged; _shipmentService.Update(entity.Shipment); //update order status var orderItem = _orderItemService.Get(entity.OrderItemId); _purchaseAccountant.EvaluateOrderStatus(orderItem?.Order); }
public IActionResult Detail(string Id) { var order = _orderService.Get(Id); if (order.UserId != _applicationContextAccessor.Current.CurrentCustomer.UserID) { return(RedirectToAction("Index")); } return(View(new OrderDetailViewModel { Order = order, OrderItems = _orderItemService.Get(m => m.OrderId == Id) })); }
public Domain.Orders.Order_Item Get(int id) { return(_Service.Get(id)); }