Exemplo n.º 1
0
        public IActionResult CreatOrder(decimal amount, [FromServices] IPayServiceWeixin payServiceWeixin)
        {
            string viewName = payServiceWeixin.RechargeViewName;

            if (amount > 50)
            {
                return(View(viewName, player.Account));
            }
            var order = payServiceWeixin.CreatPayOrder(player, amount);

            ViewBag.wxJsApiParam = payServiceWeixin.CreateWxJsApiParam(order);
            ViewBag.amount       = amount;
            return(View(viewName, player.Account));
            //新建订单
        }
Exemplo n.º 2
0
        // public IActionResult CreatOrder(decimal amount)
        public IActionResult CreatOrder(decimal amount, [FromServices] IPayServiceWeixin payServiceWeixin)
        {
            string viewName = payServiceWeixin.RechargeViewName;

            if (amount > 10)
            {
                return(View(viewName, player.Account));
            }
            //PayOrder payOrder = new PayOrder(player.WeixinName, amount);
            //ViewBag.wxJsApiParam = payOrder.CreateWxJsApiParam();
            //IstoreHouse.AddEntity<PayOrder>(payOrder);
            //IstoreHouse.SaveChanges();
            var order = payServiceWeixin.CreatPayOrder(player, amount);

            ViewBag.wxJsApiParam = payServiceWeixin.CreateWxJsApiParam(order);
            ViewBag.amount       = amount;
            return(View(viewName, player.Account));
            //新建订单
        }