Example #1
0
        private void btnSubmit_Click(object sender, System.EventArgs e)
        {
            string          text        = base.Request["PurchaseOrderId"];
            PaymentModeInfo paymentMode = SubsiteStoreHelper.GetPaymentMode(int.Parse(this.radioPaymentMode.SelectedValue));

            if (paymentMode != null)
            {
                SubsiteSalesHelper.SetPayment(text, paymentMode.ModeId, paymentMode.Name, paymentMode.Gateway);
            }
            if (paymentMode != null && paymentMode.Gateway.ToLower().Equals("hishop.plugins.payment.podrequest"))
            {
                this.ShowMsg("您选择的是货到付款方式,请等待主站发货", true);
                return;
            }
            if (paymentMode != null && paymentMode.Gateway.ToLower().Equals("hishop.plugins.payment.bankrequest"))
            {
                this.ShowMsg("您选择的是线下付款方式,请与主站管理员联系", true);
                return;
            }
            base.Response.Redirect(string.Concat(new string[]
            {
                Globals.ApplicationPath,
                "/Shopadmin/purchaseOrder/Pay.aspx?PurchaseOrderId=",
                text,
                "&PayMode=",
                this.radioPaymentMode.SelectedValue
            }));
        }
Example #2
0
 private void btnMondifyPay_Click(object sender, System.EventArgs e)
 {
     this.order = OrderHelper.GetOrderInfo(this.orderId);
     if (this.ddlpayment.SelectedValue.HasValue && this.ddlpayment.SelectedValue == -1)
     {
         this.order.PaymentTypeId = 0;
         this.order.PaymentType   = "货到付款";
         this.order.Gateway       = "hishop.plugins.payment.podrequest";
     }
     else if (this.ddlpayment.SelectedValue.HasValue && this.ddlpayment.SelectedValue == 99)
     {
         this.order.PaymentTypeId = 99;
         this.order.PaymentType   = "线下付款";
         this.order.Gateway       = "hishop.plugins.payment.offlinerequest";
     }
     else if (this.ddlpayment.SelectedValue.HasValue && this.ddlpayment.SelectedValue == 88)
     {
         this.order.PaymentTypeId = 88;
         this.order.PaymentType   = "微信支付";
         this.order.Gateway       = "hishop.plugins.payment.weixinrequest";
     }
     else
     {
         PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(this.ddlpayment.SelectedValue.Value);
         this.order.PaymentTypeId = paymentMode.ModeId;
         this.order.PaymentType   = paymentMode.Name;
         this.order.Gateway       = paymentMode.Gateway;
     }
     if (OrderHelper.UpdateOrderPaymentType(this.order))
     {
         this.ShowMsgAndReUrl("修改支付方式成功", true, "OrderDetails.aspx?OrderId=" + this.orderId + "&t=" + System.DateTime.Now.ToString("HHmmss"));
         return;
     }
     this.ShowMsg("修改支付方式失败", false);
 }
Example #3
0
        protected void btnOK_Click(object sender, System.EventArgs e)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            masterSettings.EnableAppShengPay = this.radEnableAppShengPay.SelectedValue;
            SettingsManager.Save(masterSettings);
            string          text        = string.Format("<xml><SenderId>{0}</SenderId><SellerKey>{1}</SellerKey><Seller_account_name></Seller_account_name></xml>", this.txtPartner.Text, this.txtKey.Text);
            PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode("Ecdev.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest");

            if (paymentMode == null)
            {
                PaymentModeInfo paymentMode2 = new PaymentModeInfo
                {
                    Name            = "盛付通手机网页支付",
                    Gateway         = "Ecdev.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest",
                    Description     = string.Empty,
                    IsUseInpour     = false,
                    Charge          = 0m,
                    IsPercent       = false,
                    ApplicationType = PayApplicationType.payOnWAP,
                    Settings        = HiCryptographer.Encrypt(text)
                };
                SalesHelper.CreatePaymentMode(paymentMode2);
            }
            else
            {
                PaymentModeInfo paymentModeInfo = paymentMode;
                paymentModeInfo.Settings        = HiCryptographer.Encrypt(text);
                paymentModeInfo.ApplicationType = PayApplicationType.payOnWAP;
                SalesHelper.UpdatePaymentMode(paymentModeInfo);
            }
            this.ShowMsg("修改成功", true);
        }
        public PaymentModeActionStatus CreateUpdateDeletePaymentMode(PaymentModeInfo paymentMode, DataProviderAction action)
        {
            if (paymentMode == null)
            {
                return(PaymentModeActionStatus.UnknowError);
            }
            DbCommand storedProcCommand = this.database.GetStoredProcCommand("cp_PaymentType_CreateUpdateDelete");

            this.database.AddInParameter(storedProcCommand, "Action", DbType.Int32, (int)action);
            this.database.AddOutParameter(storedProcCommand, "Status", DbType.Int32, 4);
            if (action == DataProviderAction.Create)
            {
                this.database.AddOutParameter(storedProcCommand, "ModeId", DbType.Int32, 4);
            }
            else
            {
                this.database.AddInParameter(storedProcCommand, "ModeId", DbType.Int32, paymentMode.ModeId);
            }
            if (action != DataProviderAction.Delete)
            {
                this.database.AddInParameter(storedProcCommand, "Name", DbType.String, paymentMode.Name);
                this.database.AddInParameter(storedProcCommand, "Description", DbType.String, paymentMode.Description);
                this.database.AddInParameter(storedProcCommand, "Gateway", DbType.String, paymentMode.Gateway);
                this.database.AddInParameter(storedProcCommand, "IsUseInpour", DbType.Boolean, paymentMode.IsUseInpour);
                this.database.AddInParameter(storedProcCommand, "IsUseInDistributor", DbType.Boolean, paymentMode.IsUseInDistributor);
                this.database.AddInParameter(storedProcCommand, "Charge", DbType.Currency, paymentMode.Charge);
                this.database.AddInParameter(storedProcCommand, "IsPercent", DbType.Boolean, paymentMode.IsPercent);
                this.database.AddInParameter(storedProcCommand, "Settings", DbType.String, paymentMode.Settings);
            }
            this.database.ExecuteNonQuery(storedProcCommand);
            return((PaymentModeActionStatus)((int)this.database.GetParameterValue(storedProcCommand, "Status")));
        }
Example #5
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["modeId"], out this.modeId))
     {
         base.GotoResourceNotFound();
         return;
     }
     this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
     if (!this.Page.IsPostBack)
     {
         PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(this.modeId);
         if (paymentMode == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         Globals.EntityCoding(paymentMode, false);
         this.txtSelectedName.Value = paymentMode.Gateway.ToLower();
         ConfigData configData = new ConfigData(HiCryptographer.Decrypt(paymentMode.Settings));
         this.txtConfigData.Value           = configData.SettingsXml;
         this.txtName.Text                  = paymentMode.Name;
         this.fcContent.Text                = paymentMode.Description;
         this.txtCharge.Text                = paymentMode.Charge.ToString("F", System.Globalization.CultureInfo.InvariantCulture);
         this.chkIsPercent.Checked          = paymentMode.IsPercent;
         this.radiIsUseInpour.SelectedValue = paymentMode.IsUseInpour;
     }
 }
Example #6
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (this.ValidateCreateOrder())
     {
         PurchaseOrderInfo purchaseOrderInfo = this.GetPurchaseOrderInfo();
         if (purchaseOrderInfo.PurchaseOrderItems.Count == 0)
         {
             this.ShowMsg("您暂时未选择您要添加的商品", false);
         }
         else if (SubsiteSalesHelper.CreatePurchaseOrder(purchaseOrderInfo))
         {
             SubsiteSalesHelper.ClearPurchaseShoppingCart();
             int.Parse(this.radioPaymentMode.SelectedValue);
             PaymentModeInfo paymentMode = SubsiteStoreHelper.GetPaymentMode(int.Parse(this.radioPaymentMode.SelectedValue));
             if ((paymentMode != null) && paymentMode.Gateway.ToLower().Equals("hishop.plugins.payment.podrequest"))
             {
                 this.ShowMsg("您选择的是货到付款方式,请等待主站发货", true);
             }
             else if ((paymentMode != null) && paymentMode.Gateway.ToLower().Equals("hishop.plugins.payment.bankrequest"))
             {
                 this.ShowMsg("您选择的是线下付款方式,请与主站管理员联系", true);
             }
             else
             {
                 base.Response.Redirect(Globals.ApplicationPath + "/Shopadmin/purchaseOrder/Pay.aspx?PurchaseOrderId=" + purchaseOrderInfo.PurchaseOrderId + "&PayMode=" + this.radioPaymentMode.SelectedValue);
             }
         }
         else
         {
             this.ShowMsg("提交采购单失败", false);
         }
     }
 }
Example #7
0
        private void DoValidate()
        {
            NameValueCollection values2 = new NameValueCollection();

            values2.Add(this.Page.Request.Form);
            values2.Add(this.Page.Request.QueryString);
            NameValueCollection parameters = values2;

            if (!this.isBackRequest)
            {
                parameters.Add("IsReturn", "true");
            }
            this.Gateway = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, parameters);
            if (this.isBackRequest)
            {
                this.Notify.ReturnUrl = Globals.FullPath("/pay/PaymentReturn_url.aspx") + "?" + this.Page.Request.Url.Query;
            }
            this.OrderId = this.Notify.GetOrderId();
            string gatewayOrderId = this.Notify.GetGatewayOrderId();

            if (string.IsNullOrEmpty(this.OrderId))
            {
                Globals.Debuglog(" OrderId:没获取到,GetewayOrderId:" + gatewayOrderId, "_DebuglogPaymentTest.txt");
                this.ResponseStatus(true, "noorderId");
            }
            else
            {
                this.orderlist = ShoppingProcessor.GetOrderMarkingOrderInfo(this.OrderId, false);
                if (this.orderlist.Count == 0)
                {
                    Globals.Debuglog("更新订单失败,也许是订单已后台付款,OrderId:" + this.OrderId, "_DebugAlipayPayNotify.txt");
                    this.ResponseStatus(true, "nodata");
                }
                else
                {
                    int modeId = 0;
                    foreach (OrderInfo info in this.orderlist)
                    {
                        this.Amount        += info.GetTotal();
                        info.GatewayOrderId = gatewayOrderId;
                        modeId = info.PaymentTypeId;
                    }
                    PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode(modeId);
                    if (paymentMode == null)
                    {
                        Globals.Debuglog("gatewaynotfound" + this.OrderId, "_DebugAlipayPayNotify.txt");
                        this.ResponseStatus(true, "gatewaynotfound");
                    }
                    else
                    {
                        this.Notify.Finished          += new EventHandler <FinishedEventArgs>(this.Notify_Finished);
                        this.Notify.NotifyVerifyFaild += new EventHandler(this.Notify_NotifyVerifyFaild);
                        this.Notify.Payment           += new EventHandler(this.Notify_Payment);
                        string configXml = HiCryptographer.Decrypt(paymentMode.Settings);
                        this.Notify.VerifyNotify(0x7530, configXml);
                    }
                }
            }
        }
Example #8
0
        private void DoValidate()
        {
            PayConfiguration    config     = PayConfiguration.GetConfig();
            NameValueCollection parameters = new NameValueCollection();

            parameters.Add(this.Page.Request.Form);
            parameters.Add(this.Page.Request.QueryString);
            string tmpGatewayName = this.Page.Request.QueryString[Globals.GATEWAY_KEY];

            if (string.IsNullOrEmpty(tmpGatewayName))
            {
                this.ResponseStatus(true, "gatewaynotfound");
                return;
            }
            this.GatewayName = tmpGatewayName.ToLower();
            GatewayProvider provider = config.Providers[this.GatewayName] as GatewayProvider;

            if (provider == null)
            {
                this.ResponseStatus(true, "gatewaynotfound");
                return;
            }
            this.Notify = NotifyQuery.Instance(provider.NotifyType, parameters);
            if (this.isBackRequest)
            {
                this.Notify.ReturnUrl = Globals.FullPath(string.Format(Globals.PAYMENT_RETURN_URL, this.GatewayName));
            }
            this.RechargeId      = long.Parse(this.Notify.GetOrderId(), CultureInfo.InvariantCulture);
            this.Amount          = this.Notify.GetOrderAmount();
            this.RechargeRequest = PaymentModeManage.GetRechargeRequest(this.RechargeId);
            if (this.RechargeRequest == null)
            {
                this.ResponseStatus(true, "success");
            }
            else
            {
                this.Amount  = this.RechargeRequest.RechargeBlance;
                this.paymode = PaymentModeManage.GetPaymentModeByName(this.RechargeRequest.PaymentGateway);
                if (this.paymode == null)
                {
                    this.ResponseStatus(true, "gatewaynotfound");
                }
                else
                {
                    PayeeInfo payee = new PayeeInfo
                    {
                        EmailAddress  = this.paymode.EmailAddress,
                        Partner       = this.paymode.Partner,
                        Password      = this.paymode.Password,
                        PrimaryKey    = this.paymode.SecretKey,
                        SecondKey     = this.paymode.SecondKey,
                        SellerAccount = this.paymode.MerchantCode
                    };
                    this.Notify.PaidToIntermediary += new NotifyEventHandler(this.notify_PaidToIntermediary);
                    this.Notify.PaidToMerchant     += new NotifyEventHandler(this.notify_PaidToMerchant);
                    this.Notify.NotifyVerifyFaild  += new NotifyEventHandler(this.notify_NotifyVerifyFaild);
                    this.Notify.VerifyNotify(0x7530, payee);
                }
            }
        }
 protected override void AttachChildControls()
 {
     int.TryParse(this.Page.Request.QueryString["modeId"], out this.paymentModeId);
     decimal.TryParse(this.Page.Request.QueryString["blance"], out this.balance);
     this.litUserName    = (Literal)this.FindControl("litUserName");
     this.lblPaymentName = (Literal)this.FindControl("lblPaymentName");
     this.imgPayment     = (HiImage)this.FindControl("imgPayment");
     this.lblBlance      = (FormatedMoneyLabel)this.FindControl("lblBlance");
     this.litPayCharge   = (Literal)this.FindControl("litPayCharge");
     this.btnConfirm     = ButtonManager.Create(this.FindControl("btnConfirm"));
     PageTitle.AddSiteNameTitle("充值确认", HiContext.Current.Context);
     this.btnConfirm.Click += new EventHandler(this.btnConfirm_Click);
     if (!this.Page.IsPostBack)
     {
         if ((this.paymentModeId == 0) || (this.balance == 0M))
         {
             this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("user_InpourRequest"));
         }
         else
         {
             PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(this.paymentModeId);
             this.litUserName.Text = HiContext.Current.User.Username;
             if (paymentMode != null)
             {
                 this.lblPaymentName.Text    = paymentMode.Name;
                 this.lblBlance.Money        = this.balance;
                 this.ViewState["PayCharge"] = paymentMode.CalcPayCharge(this.balance);
                 this.litPayCharge.Text      = Globals.FormatMoney(paymentMode.CalcPayCharge(this.balance));
             }
         }
     }
 }
Example #10
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                this.radEnableAppAliPay.SelectedValue = masterSettings.EnableAppAliPay;
                this.radEnableWapAliPay.SelectedValue = masterSettings.EnableAppWapAliPay;

                PaymentModeInfo paymentModeApp = SalesHelper.GetPaymentMode("Ecdev.plugins.payment.ws_apppay.wswappayrequest");
                if (paymentModeApp != null)
                {
                    string xmlApp = HiCryptographer.Decrypt(paymentModeApp.Settings);
                    System.Xml.XmlDocument docApp = new System.Xml.XmlDocument();
                    docApp.LoadXml(xmlApp);
                    this.txtAppPartner.Text = docApp.GetElementsByTagName("Partner")[0].InnerText;
                    this.txtAppKey.Text     = docApp.GetElementsByTagName("Key")[0].InnerText;
                    this.txtAppAccount.Text = docApp.GetElementsByTagName("Seller_account_name")[0].InnerText;
                }

                PaymentModeInfo paymentModeWap = SalesHelper.GetPaymentMode("Ecdev.plugins.payment.ws_wappay.wswappayrequest");
                if (paymentModeWap != null)
                {
                    string xmlWap = HiCryptographer.Decrypt(paymentModeWap.Settings);
                    System.Xml.XmlDocument docWap = new System.Xml.XmlDocument();
                    docWap.LoadXml(xmlWap);
                    this.txtPartner.Text = docWap.GetElementsByTagName("Partner")[0].InnerText;
                    this.txtKey.Text     = docWap.GetElementsByTagName("Key")[0].InnerText;
                    this.txtAccount.Text = docWap.GetElementsByTagName("Seller_account_name")[0].InnerText;
                }
            }
        }
Example #11
0
        protected override void AttachChildControls()
        {
            string payId = this.Page.Request.QueryString["PayId"];
            MemberAmountDetailedInfo amountDetailByPayId = MemberAmountProcessor.GetAmountDetailByPayId(payId);

            if (amountDetailByPayId == null)
            {
                this.Page.Response.Redirect("/Vshop/MemberRecharge.aspx");
            }
            this.Page.Request.Url.ToString().ToLower();
            int    num       = Globals.RequestQueryNum("IsAlipay");
            string userAgent = this.Page.Request.UserAgent;

            if (((num != 1) && userAgent.ToLower().Contains("micromessenger")) && (amountDetailByPayId.TradeWays == TradeWays.Alipay))
            {
                this.Page.Response.Redirect("/Pay/IframeAlipayCharge.aspx?PayId=" + payId);
            }
            else if (amountDetailByPayId.TradeWays == TradeWays.WeChatWallet)
            {
                this.Page.Response.Redirect("~/pay/wx_SubmitCharge.aspx?PayId=" + payId);
            }
            else if ((amountDetailByPayId.TradeWays != TradeWays.WeChatWallet) && (amountDetailByPayId.TradeWays != TradeWays.LineTransfer))
            {
                PaymentModeInfo paymentMode = MemberAmountProcessor.GetPaymentMode(amountDetailByPayId.TradeWays);
                string          attach      = "";
                string          showUrl     = string.Format("http://{0}/vshop/", HttpContext.Current.Request.Url.Host);
                PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), payId, amountDetailByPayId.TradeAmount, "会员充值", "充值号-" + payId, "", amountDetailByPayId.TradeTime, showUrl, Globals.FullPath("/pay/RePaymentReturn_url.aspx"), Globals.FullPath("/pay/RePaymentNotify_url.aspx"), attach).SendRequest();
            }
        }
Example #12
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            PaymentModeInfo   paymentMode       = TradeHelper.GetPaymentMode(this.paymentModeId);
            InpourRequestInfo inpourRequestInfo = new InpourRequestInfo
            {
                InpourId     = this.GenerateInpourId(),
                TradeDate    = DateTime.Now,
                InpourBlance = this.balance,
                UserId       = HiContext.Current.UserId,
                PaymentId    = paymentMode.ModeId
            };

            if (MemberProcessor.AddInpourBlance(inpourRequestInfo))
            {
                string     attach     = "";
                HttpCookie httpCookie = HiContext.Current.Context.Request.Cookies["Token_" + HiContext.Current.UserId.ToString()];
                if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                {
                    attach = httpCookie.Value;
                }
                string         text           = inpourRequestInfo.InpourId.ToString(CultureInfo.InvariantCulture);
                string         hIGW           = paymentMode.Gateway.Replace(".", "_");
                PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), text, inpourRequestInfo.InpourBlance, "预付款充值", "操作流水号-" + text, HiContext.Current.User.Email.ToNullString(), inpourRequestInfo.TradeDate, Globals.FullPath("/"), Globals.FullPath(base.GetRouteUrl("InpourReturn_url", new
                {
                    HIGW = hIGW
                })), Globals.FullPath(base.GetRouteUrl("InpourNotify_url", new
                {
                    HIGW = hIGW
                })), attach);
                paymentRequest.SendRequest();
            }
        }
Example #13
0
 protected override void AttachChildControls()
 {
     int.TryParse(base.GetParameter("modeId", false), out this.paymentModeId);
     decimal.TryParse(base.GetParameter("blance", false), out this.balance);
     this.litUserName    = (Literal)this.FindControl("litUserName");
     this.lblPaymentName = (Literal)this.FindControl("lblPaymentName");
     this.imgPayment     = (HiImage)this.FindControl("imgPayment");
     this.lblBlance      = (FormatedMoneyLabel)this.FindControl("lblBlance");
     this.btnConfirm     = ButtonManager.Create(this.FindControl("btnConfirm"));
     PageTitle.AddSiteNameTitle("充值确认");
     this.btnConfirm.Click += this.btnConfirm_Click;
     if (!this.Page.IsPostBack)
     {
         if (this.paymentModeId == 0 || this.balance == decimal.Zero)
         {
             this.Page.Response.Redirect("/");
         }
         else
         {
             PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(this.paymentModeId);
             this.litUserName.Text = HiContext.Current.User.UserName;
             if (paymentMode != null)
             {
                 this.lblPaymentName.Text = paymentMode.Name;
                 this.lblBlance.Money     = this.balance;
             }
         }
     }
 }
Example #14
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            masterSettings.EnableAliOHAliPay = this.radEnableWapAliPay.SelectedValue;
            SettingsManager.Save(masterSettings);
            string          text        = string.Format("<xml><Partner>{0}</Partner><Key>{1}</Key><Seller_account_name>{2}</Seller_account_name></xml>", this.txtPartner.Text, this.txtKey.Text, this.txtAccount.Text);
            PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode("hishop.plugins.payment.ws_wappay.wswappayrequest");

            if (paymentMode == null)
            {
                PaymentModeInfo info2 = new PaymentModeInfo {
                    Name            = "支付宝手机网页支付",
                    Gateway         = "hishop.plugins.payment.ws_wappay.wswappayrequest",
                    Description     = string.Empty,
                    IsUseInpour     = false,
                    Charge          = 0M,
                    IsPercent       = false,
                    ApplicationType = PayApplicationType.payOnWAP,
                    Settings        = HiCryptographer.Encrypt(text)
                };
                SalesHelper.CreatePaymentMode(info2);
            }
            else
            {
                PaymentModeInfo info4 = paymentMode;
                info4.Settings        = HiCryptographer.Encrypt(text);
                info4.ApplicationType = PayApplicationType.payOnWAP;
                SalesHelper.UpdatePaymentMode(info4);
            }
            this.ShowMsg("修改成功", true);
        }
Example #15
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            System.Collections.Specialized.NameValueCollection parameters = new System.Collections.Specialized.NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };
            this.Gateway = "Ecdev.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest";
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, parameters);
            this.OrderId = this.Notify.GetOrderId();
            this.Order   = ShoppingProcessor.GetOrderInfo(this.OrderId);
            if (this.Order == null)
            {
                base.Response.Write("<p style=\"font-size:16px;\">找不到对应的订单,你付款的订单可能已经被删除</p>");
                return;
            }
            this.Amount = this.Notify.GetOrderAmount();
            if (this.Amount <= 0m)
            {
                this.Amount = this.Order.GetTotal();
            }
            this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
            PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode("Ecdev.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest");

            if (paymentMode == null)
            {
                base.Response.Write("<p style=\"font-size:16px;\">找不到对应的支付方式,该支付方式可能已经被删除</p>");
                return;
            }
            this.Notify.Finished          += new System.EventHandler <FinishedEventArgs>(this.Notify_Finished);
            this.Notify.NotifyVerifyFaild += new System.EventHandler(this.Notify_NotifyVerifyFaild);
            this.Notify.Payment           += new System.EventHandler(this.Notify_Payment);
            this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(paymentMode.Settings));
        }
Example #16
0
        public static string SendAlipayRefundRequest(OrderInfo order, decimal RefundMoney, string RefundOrderId)
        {
            string          str         = "backnotify";
            PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(order.PaymentTypeId);

            RefundMoney = (RefundMoney == 0M) ? order.GetTotal() : RefundMoney;
            string str2      = "hishop.plugins.refund.alipaydirect.directrequest";
            string returnUrl = string.Format("http://{0}/pay/RefundReturn.aspx?HIGW={1}", HttpContext.Current.Request.Url.Host, str2);
            string notifyUrl = string.Format("http://{0}/pay/RefundNotify.aspx?HIGW={1}", HttpContext.Current.Request.Url.Host, order.Gateway);

            string[]  orderId       = new string[] { order.GatewayOrderId };
            decimal[] amount        = new decimal[] { order.GetTotal() };
            decimal[] refundaAmount = new decimal[] { RefundMoney };
            string[]  body          = new string[] { order.RefundRemark };
            try
            {
                //RefundRequest.CreateInstance(str2, HiCryptographer.Decrypt(paymentMode.Settings), orderId, RefundOrderId, amount, refundaAmount, body, order.EmailAddress, DateTime.Now, returnUrl, notifyUrl, "退款").SendRequest();
            }
            catch (Exception exception)
            {
                //Globals.WriteLog("/log/backreturn.txt", string.Format("时间:{0}    支付宝原路返回错误:{1}    订单号:{2}      金额:{3}    网关:{4}<br><br>", new object[] { DateTime.Now, exception.Message, order.OrderId, RefundMoney, order.Gateway }));
                str = "ERROR";
            }
            return(str);
        }
Example #17
0
        public PaymentModeInfo GetPaymentMode(TradeWays ways)
        {
            string value = "";

            if (ways == TradeWays.Alipay)
            {
                value = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            }
            else if (ways == TradeWays.ShengFutong)
            {
                value = "Hishop.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest";
            }
            PaymentModeInfo result = new PaymentModeInfo();

            System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM Hishop_PaymentTypes WHERE Gateway = @Gateway");
            this.database.AddInParameter(sqlStringCommand, "Gateway", System.Data.DbType.String, value);
            using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
            {
                if (dataReader.Read())
                {
                    result = DataMapper.PopulatePayment(dataReader);
                }
            }
            return(result);
        }
Example #18
0
        public PaymentModeInfo GetPaymentMode(TradeWays ways)
        {
            string str = "";

            if (ways == TradeWays.Alipay)
            {
                str = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            }
            else if (ways == TradeWays.ShengFutong)
            {
                str = "Hishop.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest";
            }
            PaymentModeInfo info             = new PaymentModeInfo();
            DbCommand       sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM Hishop_PaymentTypes WHERE Gateway = @Gateway");

            this.database.AddInParameter(sqlStringCommand, "Gateway", DbType.String, str);
            using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
            {
                if (reader.Read())
                {
                    info = DataMapper.PopulatePayment(reader);
                }
            }
            return(info);
        }
Example #19
0
        private void GotoPay()
        {
            OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(this.orderId);

            if (orderInfo.Gateway == "Ecdev.plugins.payment.advancerequest")
            {
                this.Page.Response.Redirect("TransactionPwd.aspx?orderId=" + this.Page.Request.QueryString["orderId"] + "&totalAmount=" + orderInfo.GetTotal().ToString("F2"));
            }
            if (orderInfo.Gateway == "Ecdev.plugins.payment.ws_wappay.wswappayrequest")
            {
                PaymentModeInfo paymentMode    = ShoppingProcessor.GetPaymentMode(orderInfo.Gateway);
                string          attach         = "";
                string          showUrl        = string.Format("http://{0}/Wapshop/", System.Web.HttpContext.Current.Request.Url.Host);
                PaymentRequest  paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单支付", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, showUrl, Globals.FullPath("/pay/wap_alipay_return_url.aspx"), Globals.FullPath("/pay/wap_alipay_return_url.aspx"), attach);
                paymentRequest.SendRequest();
                return;
            }
            if (orderInfo.Gateway == "Ecdev.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest")
            {
                PaymentModeInfo paymentMode2 = ShoppingProcessor.GetPaymentMode(orderInfo.Gateway);
                string          attach2      = "";
                string          text         = string.Format("http://{0}/Wapshop/", System.Web.HttpContext.Current.Request.Url.Host);
                HiCryptographer.Decrypt(paymentMode2.Settings);
                PaymentRequest paymentRequest2 = PaymentRequest.CreateInstance(paymentMode2.Gateway, HiCryptographer.Decrypt(paymentMode2.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单支付", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, text, text, Globals.FullPath("/pay/wap_sheng_return_url.aspx"), attach2);
                paymentRequest2.SendRequest();
            }
        }
Example #20
0
        private void btnConfirm_Click(object sender, System.EventArgs e)
        {
            PaymentModeInfo   paymentMode       = SubsiteStoreHelper.GetPaymentMode(this.paymentModeId);
            InpourRequestInfo inpourRequestInfo = new InpourRequestInfo
            {
                InpourId     = this.GenerateInpourId(),
                TradeDate    = System.DateTime.Now,
                InpourBlance = this.balance,
                UserId       = Hidistro.Membership.Context.HiContext.Current.User.UserId,
                PaymentId    = paymentMode.ModeId
            };

            if (SubsiteStoreHelper.AddInpourBalance(inpourRequestInfo))
            {
                string attach = "";
                System.Web.HttpCookie httpCookie = Hidistro.Membership.Context.HiContext.Current.Context.Request.Cookies["Token_" + Hidistro.Membership.Context.HiContext.Current.User.UserId.ToString()];
                if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                {
                    attach = httpCookie.Value;
                }
                string         text           = inpourRequestInfo.InpourId.ToString(System.Globalization.CultureInfo.InvariantCulture);
                PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), text, inpourRequestInfo.InpourBlance + paymentMode.CalcPayCharge(inpourRequestInfo.InpourBlance), "预付款充值", "操作流水号-" + text, Hidistro.Membership.Context.HiContext.Current.User.Email, inpourRequestInfo.TradeDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("DistributorInpourReturn_url", new object[]
                {
                    paymentMode.Gateway
                })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("DistributorInpourNotify_url", new object[]
                {
                    paymentMode.Gateway
                })), attach);
                paymentRequest.SendRequest();
            }
        }
Example #21
0
        public static bool DeletePaymentMode(int modeId)
        {
            PaymentModeInfo paymentModeInfo = new PaymentModeInfo();

            paymentModeInfo.ModeId = modeId;
            return(new PaymentModeDao().CreateUpdateDeletePaymentMode(paymentModeInfo, DataProviderAction.Delete) == PaymentModeActionStatus.Success);
        }
Example #22
0
        public PaymentModeActionStatus CreateUpdateDeletePaymentMode(PaymentModeInfo paymentMode, DataProviderAction action)
        {
            if (paymentMode == null)
            {
                return(PaymentModeActionStatus.UnknowError);
            }

            PaymentModeActionStatus status = PaymentModeActionStatus.UnknowError;

            switch (action)
            {
            case DataProviderAction.Create:
                status = CreatePaymentMode(paymentMode);
                break;

            case DataProviderAction.Update:
                status = UpdatePaymentMode(paymentMode);
                break;

            case DataProviderAction.Delete:
                status = DeletePaymentMode(paymentMode);
                break;

            default:
                break;
            }
            return(status);
        }
Example #23
0
        public static bool DeletePaymentMode(int modeId)
        {
            PaymentModeInfo paymentMode = new PaymentModeInfo();

            paymentMode.ModeId = modeId;
            return(SalesProvider.Instance().CreateUpdateDeletePaymentMode(paymentMode, DataProviderAction.Delete) == PaymentModeActionStatus.Success);
        }
Example #24
0
        public PaymentModeInfo GetPaymentMode(int modeId)
        {
            PaymentModeInfo info   = new PaymentModeInfo();
            StringBuilder   strSql = new StringBuilder();

            strSql.Append("SELECT * FROM Pay_PaymentTypes WHERE ModeId = ?ModeId;SELECT Code FROM Pay_PaymentCurrencys WHERE ModeId = ?ModeId");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("?ModeId", MySqlDbType.Int32)
            };
            parameters[0].Value = modeId;
            using (IDataReader reader = DbHelperMySQL.ExecuteReader(strSql.ToString(), parameters))
            {
                if (reader.Read())
                {
                    info = this.PopupPayment(reader);
                }
                if (!reader.NextResult())
                {
                    return(info);
                }
                while (reader.Read())
                {
                    info.SupportedCurrencys.Add(reader.GetString(0));
                }
            }
            return(info);
        }
Example #25
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
         this.radEnableWapAliPay.SelectedValue = masterSettings.EnableWapAliPay;
         PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode("Ecdev.plugins.payment.ws_wappay.wswappayrequest");
         if (paymentMode != null)
         {
             string xml = HiCryptographer.Decrypt(paymentMode.Settings);
             System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
             xmlDocument.LoadXml(xml);
             this.txtPartner.Text = xmlDocument.GetElementsByTagName("Partner")[0].InnerText;
             this.txtKey.Text     = xmlDocument.GetElementsByTagName("Key")[0].InnerText;
             this.txtAccount.Text = xmlDocument.GetElementsByTagName("Seller_account_name")[0].InnerText;
         }
         //PaymentModeInfo paymentMode2 = SalesHelper.GetPaymentMode("Ecdev.plugins.payment.ws_apppay.wswappayrequest");
         //if (paymentMode2 != null)
         //{
         //    string xml2 = HiCryptographer.Decrypt(paymentMode2.Settings);
         //    System.Xml.XmlDocument xmlDocument2 = new System.Xml.XmlDocument();
         //    xmlDocument2.LoadXml(xml2);
         //}
     }
 }
Example #26
0
        public PaymentModeInfo GetPaymentMode(string gateway)
        {
            PaymentModeInfo info   = null;
            StringBuilder   strSql = new StringBuilder();

            strSql.Append("SELECT * FROM Pay_PaymentTypes WHERE Gateway = @Gateway LIMIT 1;SELECT Code FROM Pay_PaymentCurrencys WHERE ModeId = (SELECT ModeId FROM Pay_PaymentTypes WHERE Gateway = @Gateway LIMIT 1) ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@Gateway", MySqlDbType.VarChar)
            };
            parameters[0].Value = gateway;
            using (IDataReader reader = DbHelperMySQL.ExecuteReader(strSql.ToString(), parameters))
            {
                if (reader.Read())
                {
                    info = this.PopupPayment(reader);
                }
                if (!reader.NextResult())
                {
                    return(info);
                }
                while (reader.Read())
                {
                    info.SupportedCurrencys.Add(reader.GetString(0));
                }
            }
            return(info);
        }
Example #27
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
     if (!base.IsPostBack)
     {
         SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
         this.radEnableAppShengPay.SelectedValue = masterSettings.EnableAppShengPay;
         PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode("Ecdev.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest");
         if (paymentMode != null)
         {
             string xml = HiCryptographer.Decrypt(paymentMode.Settings);
             System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
             xmlDocument.LoadXml(xml);
             try
             {
                 this.txtPartner.Text = xmlDocument.GetElementsByTagName("SenderId")[0].InnerText;
                 this.txtKey.Text     = xmlDocument.GetElementsByTagName("SellerKey")[0].InnerText;
             }
             catch
             {
                 this.txtPartner.Text = "";
                 this.txtKey.Text     = "";
             }
         }
         PaymentModeInfo paymentMode2 = SalesHelper.GetPaymentMode("Ecdev.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest");
         if (paymentMode2 != null)
         {
             string xml2 = HiCryptographer.Decrypt(paymentMode2.Settings);
             System.Xml.XmlDocument xmlDocument2 = new System.Xml.XmlDocument();
             xmlDocument2.LoadXml(xml2);
         }
     }
 }
Example #28
0
        private PaymentModeActionStatus DeletePaymentMode(PaymentModeInfo paymentMode)
        {
            List <CommandInfo> sqllist = new List <CommandInfo>();

            StringBuilder strSql1 = new StringBuilder();

            strSql1.AppendFormat(" DELETE FROM Pay_PaymentCurrencys WHERE ModeId= {0} ;", paymentMode.ModeId);
            MySqlParameter[] parameters1 =
            {
            };
            sqllist.Add(new CommandInfo(strSql1.ToString(), parameters1, EffentNextType.ExcuteEffectRows));

            StringBuilder strSql2 = new StringBuilder();

            strSql2.AppendFormat(" DELETE FROM Pay_PaymentTypes WHERE ModeId = {0} ;", paymentMode.ModeId);
            MySqlParameter[] parameters2 =
            {
            };
            sqllist.Add(new CommandInfo(strSql2.ToString(), parameters2, EffentNextType.ExcuteEffectRows));

            int count = DbHelperMySQL.ExecuteSqlTran(sqllist);

            if (count != 2)
            {
                return(PaymentModeActionStatus.UnknowError);
            }
            return(PaymentModeActionStatus.Success);
        }
Example #29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(Page.Request.QueryString["modeId"], out modeId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         btnUpdate.Click += new EventHandler(btnUpdate_Click);
         if (!Page.IsPostBack)
         {
             PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(modeId);
             if (paymentMode == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 Globals.EntityCoding(paymentMode, false);
                 txtSelectedName.Value = paymentMode.Gateway.ToLower();
                 ConfigData data = new ConfigData(Cryptographer.Decrypt(paymentMode.Settings));
                 txtConfigData.Value           = data.SettingsXml;
                 txtName.Text                  = paymentMode.Name;
                 fcContent.Text                = paymentMode.Description;
                 txtCharge.Text                = paymentMode.Charge.ToString("F", CultureInfo.InvariantCulture);
                 chkIsPercent.Checked          = paymentMode.IsPercent;
                 radiIsUseInpour.SelectedValue = paymentMode.IsUseInpour;
             }
         }
     }
 }
Example #30
0
        private void btnConfirm_Click(object sender, System.EventArgs e)
        {
            PaymentModeInfo   paymentMode       = TradeHelper.GetPaymentMode(this.paymentModeId);
            InpourRequestInfo inpourRequestInfo = new InpourRequestInfo
            {
                InpourId     = this.GenerateInpourId(),
                TradeDate    = System.DateTime.Now,
                InpourBlance = this.balance,
                UserId       = HiContext.Current.User.UserId,
                PaymentId    = paymentMode.ModeId
            };

            if (MemberProcessor.AddInpourBlance(inpourRequestInfo))
            {
                string attach = "";
                System.Web.HttpCookie httpCookie = HiContext.Current.Context.Request.Cookies["Token_" + HiContext.Current.User.UserId.ToString()];
                if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                {
                    attach = httpCookie.Value;
                }
                string         orderId        = inpourRequestInfo.InpourId.ToString(System.Globalization.CultureInfo.InvariantCulture);
                string         configXml      = HiCryptographer.Decrypt(paymentMode.Settings);
                decimal        amount         = inpourRequestInfo.InpourBlance + (decimal)this.ViewState["PayCharge"];
                PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, configXml, orderId, amount, "预付款充值", "操作流水号-" + orderId, HiContext.Current.User.Email, inpourRequestInfo.TradeDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("InpourReturn_url", new object[]
                {
                    paymentMode.Gateway
                })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("InpourNotify_url", new object[]
                {
                    paymentMode.Gateway
                })), attach);
            }
        }