/// <summary>
        /// 提现申请数据提交
        /// </summary>
        /// <returns></returns>
        public JsonResult ApplyWithDrawSubmit(string pluginId, string destination, string code, decimal amount, int WithdrawType)
        {
            int result = MemberApplication.CheckCode(pluginId, code, destination, CurrentUser.Id);

            if (result > 0)
            {
                Himall.DTO.ShopWithDraw model = new ShopWithDraw()
                {
                    SellerId         = CurrentUser.Id,
                    SellerName       = CurrentUser.UserName,
                    ShopId           = CurrentSellerManager.ShopId,
                    WithdrawalAmount = amount,
                    WithdrawType     = (Himall.CommonModel.WithdrawType)WithdrawType
                };

                bool isbool = BillingApplication.ShopApplyWithDraw(model);

                if (isbool)
                {
                    return(Json(new { success = true, msg = "成功!" }));
                }
                else
                {
                    return(Json(new { success = false, msg = "余额不足,无法提现!" }));
                }
            }
            else
            {
                return(Json(new { success = false, msg = "验证码错误!" }));
            }
        }
예제 #2
0
        /// <summary>
        /// 提现申请数据提交
        /// </summary>
        /// <returns></returns>
        public object ApplyWithDrawSubmit(ApplyWithDrawSubmitPostModel model)
        {
            CheckShopManageLogin();

            if (!CheckCertificate(model.Certificate))
            {
                return(ErrorResult("凭证无效"));
            }

            Himall.DTO.ShopWithDraw info = new ShopWithDraw()
            {
                SellerId         = CurrentUser.Id,
                SellerName       = CurrentUser.UserName,
                ShopId           = CurrentShop.Id,
                WithdrawalAmount = model.Amount,
                WithdrawType     = WithdrawType.BankCard
            };

            if (model.Amount <= 0)
            {
                return(ErrorResult("提现金额不正确"));
            }

            bool isbool = BillingApplication.ShopApplyWithDraw(info);

            if (isbool)
            {
                return(Json(new { success = true, msg = "成功!" }));
            }
            else
            {
                return(Json(new { success = false, msg = "余额不足,无法提现!" }));
            }
        }
예제 #3
0
        public object ApplyWithDraw(ApplayWithDrawParam applay)
        {
            long userId  = UserCookieEncryptHelper.Decrypt(applay.userKey, CookieKeysCollection.USERROLE_SELLERADMIN);
            var  manager = ServiceProvider.Instance <IManagerService> .Create.GetSellerManager(userId);

            var shopinfo = ServiceProvider.Instance <IShopService> .Create.GetShop(manager.ShopId);

            Himall.DTO.ShopWithDraw model = new ShopWithDraw()
            {
                SellerId         = manager.Id,
                SellerName       = manager.UserName,
                ShopId           = shopinfo.Id,
                WithdrawalAmount = applay.amount,
                WithdrawType     = (Himall.CommonModel.WithdrawType)applay.withdrawType
            };

            bool isbool = BillingApplication.ShopApplyWithDraw(model);

            if (isbool)
            {
                return(Json(new { success = true, msg = "成功!" }));
            }
            else
            {
                return(Json(new { success = false, msg = "余额不足,无法提现!" }));
            }
        }
예제 #4
0
 public JsonResult ConfirmPay(long id, int status, string remark)
 {
     if (BillingApplication.ShopApplyWithDraw(id, (Himall.CommonModel.WithdrawStaus)status, remark, Request.UserHostAddress, CurrentManager.UserName))
     {
         return(Json(new { success = true, msg = "成功!" }));
     }
     else
     {
         return(Json(new { success = false, msg = "操作失败!" }));
     }
 }
예제 #5
0
        public JsonResult ConfirmPay(long id, int status, string remark)
        {
            var result = BillingApplication.ShopApplyWithDraw(id, (Mall.CommonModel.WithdrawStaus)status, remark, Request.HttpContext.Features.Get <IHttpConnectionFeature>()?.RemoteIpAddress.ToString(), CurrentManager.UserName, webRoot: CurrentUrlHelper.CurrentUrlNoPort());

            if (result.Success)
            {
                return(Json(new { success = true, msg = "成功!", jumpurl = result.JumpUrl, status = !string.IsNullOrWhiteSpace(result.JumpUrl) ? 2 : 0 }));
            }
            else
            {
                return(Json(new { success = false, msg = "操作失败,可能微信证书设置错误或者扣款账号余额不足,检查完稍后再试。" }));
            }
        }
예제 #6
0
        /// <summary>
        /// 提现申请数据提交
        /// </summary>
        /// <returns></returns>
        public JsonResult ApplyWithDrawSubmit(string pluginId, string destination, string code, decimal amount, int WithdrawType, string Account, string AccountName)
        {
            long userId = MemberApplication.GetMemberUserIdOrShop(CurrentUser, CurrentSellerManager);
            int  result = MemberApplication.CheckCode(pluginId, code, destination, userId);

            if (result > 0)
            {
                var sitesetting = SiteSettingApplication.SiteSettings;
                if (amount <= sitesetting.ShopWithDrawMinimum && amount >= sitesetting.ShopWithDrawMaximum)
                {
                    return(Json(new { success = false, msg = "提现金额不能小于:" + sitesetting.ShopWithDrawMinimum + " 元,不能大于:" + sitesetting.ShopWithDrawMaximum + " 元" }));
                }
                Himall.DTO.ShopWithDraw model = new ShopWithDraw()
                {
                    SellerId         = userId,
                    SellerName       = CurrentSellerManager.UserName,
                    ShopId           = CurrentSellerManager.ShopId,
                    WithdrawalAmount = amount,
                    WithdrawType     = (Himall.CommonModel.WithdrawType)WithdrawType,
                    Account          = Account,
                    AccountName      = AccountName
                };
                if (model.WithdrawType == CommonModel.WithdrawType.ALipay)
                {
                    if (string.IsNullOrEmpty(model.Account) || string.IsNullOrEmpty(model.AccountName))
                    {
                        return(Json(new { success = false, msg = "支付宝提现请填写支付账号与真实姓名!" }));
                    }
                }

                bool isbool = BillingApplication.ShopApplyWithDraw(model);

                if (isbool)
                {
                    return(Json(new { success = true, msg = "成功!" }));
                }
                else
                {
                    return(Json(new { success = false, msg = "余额不足,无法提现!" }));
                }
            }
            else
            {
                return(Json(new { success = false, msg = "验证码错误!" }));
            }
        }