コード例 #1
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);
                    }
                }
            }
        }
コード例 #2
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));
        }
コード例 #3
0
        private void DoValidate()
        {
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };

            this.Gateway = base.GetParameter("HIGW", false);
            this.Gateway = this.Gateway.Replace("_", ".");
            if (this.Gateway == "hishop.plugins.payment.wxqrcode.wxqrcoderequest")
            {
                string wXQRCodePayResult = this.GetWXQRCodePayResult();
                nameValueCollection.Add("notify_data", wXQRCodePayResult);
            }
            this.Notify = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            if (this.Notify == null)
            {
                Globals.AppendLog(nameValueCollection, "通知对象获取失败" + this.Amount, this.Page.Request.Url.ToString(), "", "WapInpourPage");
                this.ResponseStatus(true, "verifyfaild");
            }
            else
            {
                if (this.isBackRequest)
                {
                    string hIGW = this.Gateway.Replace(".", "_");
                    this.Notify.ReturnUrl = Globals.FullPath(base.GetRouteUrl("InpourReturn_url", new
                    {
                        HIGW = hIGW
                    })) + "?" + this.Page.Request.Url.Query;
                }
                this.InpourId      = this.Notify.GetOrderId();
                this.Amount        = this.Notify.GetOrderAmount();
                this.InpourRequest = MemberProcessor.GetInpourBlance(this.InpourId);
                if (this.InpourRequest == null)
                {
                    Globals.AppendLog(nameValueCollection, "未找到相应的充值记录---Amount:" + this.Amount, this.Page.Request.Url.ToString(), "", "WapInpourPage");
                    this.ResponseStatus(true, "success");
                }
                else
                {
                    this.Amount  = this.InpourRequest.InpourBlance;
                    this.paymode = TradeHelper.GetPaymentMode(this.InpourRequest.PaymentId);
                    if (this.paymode == null)
                    {
                        Globals.AppendLog(nameValueCollection, "未获取到支付方式信息", this.Page.Request.Url.ToString(), "", "WapInpourPage");
                        this.ResponseStatus(true, "gatewaynotfound");
                    }
                    else
                    {
                        this.Notify.Finished          += this.Notify_Finished;
                        this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                        this.Notify.Payment           += this.Notify_Payment;
                        this.Notify.VerifyNotify(600000, HiCryptographer.Decrypt(this.paymode.Settings));
                    }
                }
            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.Form
            };

            this.Gateway = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            this.OrderId = this.Notify.GetOrderId();
            this.Order   = ShoppingProcessor.GetOrderInfo(this.OrderId);
            if (this.Order == null)
            {
                Globals.WriteLog(nameValueCollection, "订单信息不存在", "", "", "alipay");
                base.Response.Write("success");
            }
            else
            {
                this.Amount = this.Notify.GetOrderAmount();
                if (this.Amount <= decimal.Zero)
                {
                    this.Amount = this.Order.GetTotal(false);
                }
                this.hasNotify = !string.IsNullOrEmpty(this.Order.GatewayOrderId);
                if (this.Order.PreSaleId > 0 && this.Order.DepositGatewayOrderId.ToNullString() == this.Notify.GetGatewayOrderId())
                {
                    base.Response.Write("success");
                }
                else
                {
                    if (this.Order.PreSaleId > 0 && !this.Order.DepositDate.HasValue)
                    {
                        this.Order.DepositGatewayOrderId = this.Notify.GetGatewayOrderId();
                    }
                    else
                    {
                        this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
                    }
                    PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.ws_wappay.wswappayrequest");
                    if (paymentMode == null)
                    {
                        paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.alipaywx.alipaywxrequest");
                        if (paymentMode == null)
                        {
                            Globals.WriteLog(nameValueCollection, "支付方式获取失败hishop.plugins.payment.ws_wappay.wswappayrequest", "", "", "alipay");
                            base.Response.Write("success");
                            return;
                        }
                    }
                    this.Notify.Finished          += this.Notify_Finished;
                    this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                    this.Notify.Payment           += this.Notify_Payment;
                    this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(paymentMode.Settings));
                }
            }
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.Response.Write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\"/>");
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.QueryString
            };

            nameValueCollection.Add("IsReturn", "true");
            this.Gateway = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            this.OrderId = this.Notify.GetOrderId();
            this.Order   = ShoppingProcessor.GetOrderInfo(this.OrderId);
            if (this.Order == null)
            {
                base.Response.Write("<p style=\"font-size:16px;\">找不到对应的订单,你付款的订单可能已经被删除</p>");
            }
            else
            {
                this.Amount = this.Notify.GetOrderAmount();
                if (this.Amount <= decimal.Zero)
                {
                    this.Amount = this.Order.GetTotal(false);
                }
                if (this.Order.PreSaleId > 0 && this.Order.DepositGatewayOrderId.ToNullString() == this.Notify.GetGatewayOrderId())
                {
                    base.Response.Write("<p style=\"font-size:16px;\">预售订单,订金已支付成功</p>");
                }
                else
                {
                    if (this.Order.PreSaleId > 0 && !this.Order.DepositDate.HasValue)
                    {
                        this.Order.DepositGatewayOrderId = this.Notify.GetGatewayOrderId();
                    }
                    else
                    {
                        this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
                    }
                    PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.ws_wappay.wswappayrequest");
                    if (paymentMode == null)
                    {
                        paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.alipaywx.alipaywxrequest");
                        if (paymentMode == null)
                        {
                            base.Response.Write("<p style=\"font-size:16px;\">找不到对应的支付方式,该支付方式可能已经被删除</p>");
                            return;
                        }
                    }
                    this.Notify.Finished          += this.Notify_Finished;
                    this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                    this.Notify.Payment           += this.Notify_Payment;
                    this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(paymentMode.Settings));
                }
            }
        }
コード例 #6
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);
            Globals.Debuglog("充值支付:0-" + JsonConvert.SerializeObject(this.Notify), "_DebugAlipayPayNotify.txt");
            try
            {
                StringBuilder builder = new StringBuilder();
                foreach (string str in parameters)
                {
                    builder.Append(str + ":" + parameters[str] + ";");
                }
                Globals.Debuglog(builder.ToString(), "_DebugAlipayPayNotify.txt");
            }
            catch (Exception)
            {
            }
            if (this.isBackRequest)
            {
                this.Notify.ReturnUrl = Globals.FullPath("/pay/RePaymentReturn_url.aspx") + "?" + this.Page.Request.Url.Query;
            }
            Globals.Debuglog("充值支付:1-" + JsonConvert.SerializeObject(this.Notify), "_DebugAlipayPayNotify.txt");
            this.PayId = this.Notify.GetOrderId();
            this.Model = MemberAmountProcessor.GetAmountDetailByPayId(this.PayId);
            if (this.Model != null)
            {
                this.Amount             = this.Model.TradeAmount;
                this.Model.GatewayPayId = this.Notify.GetGatewayOrderId();
                PaymentModeInfo paymentMode = MemberAmountProcessor.GetPaymentMode(this.Model.TradeWays);
                if (paymentMode == null)
                {
                    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);
                }
            }
        }
コード例 #7
0
 private void DoValidate()
 {
     System.Collections.Specialized.NameValueCollection parameters = new System.Collections.Specialized.NameValueCollection
     {
         this.Page.Request.Form,
         this.Page.Request.QueryString
     };
     this.Gateway = this.Page.Request.QueryString["HIGW"];
     this.Notify  = PaymentNotify.CreateInstance(this.Gateway, parameters);
     if (this.isBackRequest)
     {
         this.Notify.ReturnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[]
         {
             this.Gateway
         })) + "?" + this.Page.Request.Url.Query;
     }
     this.OrderId = this.Notify.GetOrderId();
     this.Order   = TradeHelper.GetOrderInfo(this.OrderId);
     if (this.Order == null)
     {
         this.ResponseStatus(true, "ordernotfound");
     }
     else
     {
         this.Amount = this.Notify.GetOrderAmount();
         if (this.Amount <= 0m)
         {
             this.Amount = this.Order.GetTotal();
         }
         this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
         PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(this.Order.PaymentTypeId);
         if (paymentMode == null)
         {
             this.ResponseStatus(true, "gatewaynotfound");
         }
         else
         {
             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));
         }
     }
 }
コード例 #8
0
        private void DoValidate()
        {
            NameValueCollection values2 = new NameValueCollection();

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

            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();
            this.Order   = ShoppingProcessor.GetOrderInfo(this.OrderId);
            if (this.Order == null)
            {
                this.ResponseStatus(true, "ordernotfound");
            }
            else
            {
                this.Amount = this.Notify.GetOrderAmount();
                if (this.Amount <= 0M)
                {
                    this.Amount = this.Order.GetTotal();
                }
                this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
                PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode(this.Order.PaymentTypeId);
                if (paymentMode == null)
                {
                    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);
                    this.Notify.VerifyNotify(0x7530, HiCryptographer.Decrypt(paymentMode.Settings));
                }
            }
        }
コード例 #9
0
        private void DoValidate()
        {
            NameValueCollection values2 = new NameValueCollection();

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

            this.Gateway = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, parameters);
            Globals.Debuglog("订单支付:0-" + JsonConvert.SerializeObject(this.Notify), "_Debuglog.txt");
            if (this.isBackRequest)
            {
                this.Notify.ReturnUrl = Globals.FullPath("/pay/PaymentReturn_url.aspx") + "?" + this.Page.Request.Url.Query;
            }
            Globals.Debuglog("订单支付:1-" + JsonConvert.SerializeObject(this.Notify), "_Debuglog.txt");
            this.OrderId   = this.Notify.GetOrderId();
            this.orderlist = ShoppingProcessor.GetOrderMarkingOrderInfo(this.OrderId);
            if (this.orderlist.Count != 0)
            {
                int modeId = 0;
                foreach (OrderInfo info in this.orderlist)
                {
                    this.Amount        += info.GetAmount();
                    info.GatewayOrderId = this.Notify.GetGatewayOrderId();
                    modeId = info.PaymentTypeId;
                }
                PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode(modeId);
                if (paymentMode == null)
                {
                    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);
                }
            }
        }
コード例 #10
0
 private void DoValidate()
 {
     System.Collections.Specialized.NameValueCollection parameters = new System.Collections.Specialized.NameValueCollection
     {
         this.Page.Request.Form,
         this.Page.Request.QueryString
     };
     this.Gateway = this.Page.Request.QueryString["HIGW"];
     this.Notify  = PaymentNotify.CreateInstance(this.Gateway, parameters);
     if (this.isBackRequest)
     {
         this.Notify.ReturnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("DistributorInpourReturn_url", new object[]
         {
             this.Gateway
         }));
         PaymentNotify expr_AC = this.Notify;
         expr_AC.ReturnUrl = expr_AC.ReturnUrl + "?" + this.Page.Request.Url.Query;
     }
     this.InpourId      = this.Notify.GetOrderId();
     this.Amount        = this.Notify.GetOrderAmount();
     this.InpourRequest = SubsiteStoreHelper.GetInpouRequest(this.InpourId);
     if (this.InpourRequest == null)
     {
         this.ResponseStatus(true, "success");
     }
     else
     {
         this.Amount  = this.InpourRequest.InpourBlance;
         this.paymode = SubsiteStoreHelper.GetPaymentMode(this.InpourRequest.PaymentId);
         if (this.paymode == null)
         {
             this.ResponseStatus(true, "gatewaynotfound");
         }
         else
         {
             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(this.paymode.Settings));
         }
     }
 }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NameValueCollection values2 = new NameValueCollection();

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

            this.Gateway = this.Page.Request.QueryString["HIGW"];
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, parameters);
            if (this.isBackRequest)
            {
                this.Notify.ReturnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("DistributorPaymentReturn_url", new object[] { this.Gateway })) + "?" + this.Page.Request.Url.Query;
            }
            this.PurchaseOrderId = this.Notify.GetOrderId();
            this.PurchaseOrder   = SubsiteSalesHelper.GetPurchaseOrder(this.PurchaseOrderId);
            if (this.PurchaseOrder == null)
            {
                this.ResponseStatus(true, "purchaseordernotfound");
            }
            else
            {
                this.Amount = this.Notify.GetOrderAmount();
                if (this.Amount <= 0M)
                {
                    this.Amount = this.PurchaseOrder.GetPurchaseTotal();
                }
                PaymentModeInfo paymentMode = SubsiteStoreHelper.GetPaymentMode(this.PurchaseOrder.PaymentTypeId);
                if (paymentMode == null)
                {
                    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);
                    this.Notify.VerifyNotify(0x7530, HiCryptographer.Decrypt(paymentMode.Settings));
                }
            }
        }
コード例 #12
0
        void DoValidate()
        {
            NameValueCollection values2 = new NameValueCollection();

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

            Gateway = Page.Request.QueryString["HIGW"];
            Notify  = PaymentNotify.CreateInstance(Gateway, parameters);
            if (isBackRequest)
            {
                Notify.ReturnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("DistributorInpourReturn_url", new object[] { Gateway }));
                Notify.ReturnUrl = Notify.ReturnUrl + "?" + Page.Request.Url.Query;
            }
            InpourId      = Notify.GetOrderId();
            Amount        = Notify.GetOrderAmount();
            InpourRequest = SubsiteStoreHelper.GetInpouRequest(InpourId);
            if (InpourRequest == null)
            {
                ResponseStatus(true, "success");
            }
            else
            {
                Amount  = InpourRequest.InpourBlance;
                paymode = SubsiteStoreHelper.GetPaymentMode(InpourRequest.PaymentId);
                if (paymode == null)
                {
                    ResponseStatus(true, "gatewaynotfound");
                }
                else
                {
                    Notify.Finished          += new EventHandler <FinishedEventArgs>(Notify_Finished);
                    Notify.NotifyVerifyFaild += new EventHandler(Notify_NotifyVerifyFaild);
                    Notify.Payment           += new EventHandler(Notify_Payment);
                    Notify.VerifyNotify(0x7530, Cryptographer.Decrypt(paymode.Settings));
                }
            }
        }
コード例 #13
0
        private void DoValidate()
        {
            NameValueCollection values2 = new NameValueCollection();

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

            this.Gateway = this.Page.Request.QueryString["HIGW"];
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, parameters);
            if (this.isBackRequest)
            {
                this.Notify.ReturnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("InpourReturn_url", new object[] { this.Gateway })) + "?" + this.Page.Request.Url.Query;
            }
            this.InpourId      = this.Notify.GetOrderId();
            this.Amount        = this.Notify.GetOrderAmount();
            this.InpourRequest = PersonalHelper.GetInpourBlance(this.InpourId);
            if (this.InpourRequest == null)
            {
                this.ResponseStatus(true, "success");
            }
            else
            {
                this.Amount  = this.InpourRequest.InpourBlance;
                this.paymode = TradeHelper.GetPaymentMode(this.InpourRequest.PaymentId);
                if (this.paymode == null)
                {
                    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);
                    this.Notify.VerifyNotify(0x7530, HiCryptographer.Decrypt(this.paymode.Settings));
                }
            }
        }
コード例 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.Response.Write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\"/>");
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };

            nameValueCollection.Add("IsReturn", "true");
            this.Gateway      = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            this.Notify       = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            this.OrderId      = this.Notify.GetOrderId();
            this.Order        = ShoppingProcessor.GetOrderInfo(this.OrderId);
            this.offlineOrder = StoresHelper.GetStoreCollectionInfo(this.OrderId);
            if (this.Order == null && this.offlineOrder == null)
            {
                base.Response.Write("success");
            }
            else
            {
                PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.ws_wappay.wswappayrequest");
                if (paymentMode == null)
                {
                    Globals.WriteLog(nameValueCollection, "支付方式获取失败hishop.plugins.payment.ws_wappay.wswappayrequest", "", "", "alipay");
                    base.Response.Write("success");
                }
                else
                {
                    this.Amount = this.Notify.GetOrderAmount();
                    if (this.Order == null)
                    {
                        this.isOfflineOrder = true;
                    }
                    else
                    {
                        if (this.Amount <= decimal.Zero)
                        {
                            this.Amount = this.Order.GetTotal(true);
                        }
                        this.offlineOrder         = StoresHelper.GetStoreCollectionInfoOfOrderId(this.OrderId);
                        this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
                        this.Order.PaymentType    = paymentMode.Name;
                        this.Order.PaymentTypeId  = paymentMode.ModeId;
                        this.Order.Gateway        = paymentMode.Gateway;
                        if (this.offlineOrder == null)
                        {
                            this.offlineOrder = StoresHelper.GetStoreCollectionInfoOfOrderId(this.Order.OrderId);
                        }
                    }
                    if (this.offlineOrder != null)
                    {
                        if (this.Amount <= decimal.Zero)
                        {
                            this.Amount = this.offlineOrder.PayAmount;
                        }
                        this.offlineOrder.GateWayOrderId  = this.Notify.GetGatewayOrderId();
                        this.offlineOrder.PaymentTypeId   = paymentMode.ModeId;
                        this.offlineOrder.PaymentTypeName = paymentMode.Name;
                        this.offlineOrder.GateWay         = paymentMode.Gateway;
                    }
                    this.Notify.Finished          += this.Notify_Finished;
                    this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                    this.Notify.Payment           += this.Notify_Payment;
                    this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(paymentMode.Settings));
                }
            }
        }
コード例 #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.parameters = new NameValueCollection
     {
         this.Page.Request.Form,
         this.Page.Request.QueryString
     };
     try
     {
         this.Gateway = "Hishop.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest";
         this.Notify  = PaymentNotify.CreateInstance(this.Gateway, this.parameters);
         this.OrderId = this.Notify.GetOrderId();
         this.Order   = ShoppingProcessor.GetOrderInfo(this.OrderId);
         if (this.Order == null)
         {
             Globals.AppendLog(this.parameters, "订单信息为空", this.OrderId, "", "ShengPay_Return1");
             base.Response.Write("OK");
         }
         else
         {
             this.Amount = this.Notify.GetOrderAmount();
             if (this.Amount <= decimal.Zero)
             {
                 this.Amount = this.Order.GetTotal(true);
             }
             this.hasNotify = !string.IsNullOrEmpty(this.Order.GatewayOrderId);
             if (this.Order.PreSaleId > 0 && this.Order.DepositGatewayOrderId.ToNullString() == this.Notify.GetGatewayOrderId())
             {
                 Globals.AppendLog(this.parameters, "预售订单已更新过状态", this.OrderId, "", "ShengPay_Return1");
                 base.Response.Write("OK");
             }
             else
             {
                 if (this.Order.PreSaleId > 0 && !this.Order.DepositDate.HasValue)
                 {
                     this.Order.DepositGatewayOrderId = this.Notify.GetGatewayOrderId();
                 }
                 else
                 {
                     this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
                 }
                 PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode("Hishop.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest");
                 if (paymentMode == null)
                 {
                     Globals.AppendLog(this.parameters, "未找到支付方式", this.OrderId, "", "ShengPay_Return1");
                     base.Response.Write("OK");
                 }
                 else
                 {
                     this.Notify.Finished          += this.Notify_Finished;
                     this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                     this.Notify.Payment           += this.Notify_Payment;
                     this.Notify.VerifyNotify(30000, HiCryptographer.TryDecypt(paymentMode.Settings));
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Globals.WriteExceptionLog_Page(ex, this.parameters, "ShengPayNotify");
     }
 }
コード例 #16
0
        private void DoValidate()
        {
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };

            if (!this.isBackRequest)
            {
                nameValueCollection.Add("IsReturn", "true");
            }
            this.Gateway = RouteConfig.GetParameter(this.Page, "HIGW", false);
            this.Gateway = this.Gateway.Replace("_", ".");
            this.Gateway = this.Gateway.Replace("ws.wappay", "ws_wappay");
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            if (this.Notify == null)
            {
                this.ResponseStatus(false, "verifyfaild");
                Globals.AppendLog(nameValueCollection, "获取支付通知信息失败", this.Page.Request.Url.ToString(), "", "WapInpourPage");
            }
            else
            {
                if (this.isBackRequest)
                {
                    string hIGW = this.Gateway.Replace(".", "_");
                    this.Notify.ReturnUrl = Globals.FullPath(base.GetRouteUrl("WapInpourNotify", new
                    {
                        HIGW = hIGW
                    })) + "?" + this.Page.Request.Url.Query;
                }
                this.InpourId      = this.Notify.GetOrderId();
                this.Amount        = this.Notify.GetOrderAmount();
                this.InpourRequest = MemberProcessor.GetInpourBlance(this.InpourId);
                if (this.InpourRequest == null)
                {
                    if (this.isBackRequest)
                    {
                        Globals.AppendLog(nameValueCollection, "未找到相应的充值记录...Amount:" + this.Notify.GetOrderAmount(), this.Page.Request.Url.ToString(), "", "WapInpourPage");
                        this.ResponseStatus(true, "fail");
                    }
                    else
                    {
                        BalanceDetailInfo balanceDetailInfoOfInpurId = MemberProcessor.GetBalanceDetailInfoOfInpurId(this.InpourId);
                        if (balanceDetailInfoOfInpurId == null)
                        {
                            Globals.AppendLog(nameValueCollection, "未找到相应的明细记录...InpourId:" + this.InpourId, this.Page.Request.Url.ToString(), "", "WapInpourPage");
                            this.ResponseStatus(true, "fail");
                        }
                        else
                        {
                            if (balanceDetailInfoOfInpurId.Income.HasValue)
                            {
                                this.Amount = balanceDetailInfoOfInpurId.Income.Value.ToDecimal(0);
                            }
                            else
                            {
                                this.Amount = default(decimal);
                            }
                            this.ResponseStatus(true, "success");
                        }
                    }
                }
                else
                {
                    if (this.InpourRequest != null)
                    {
                        this.Amount = this.InpourRequest.InpourBlance;
                    }
                    this.paymode = TradeHelper.GetPaymentMode(this.Gateway);
                    if (this.paymode == null)
                    {
                        Globals.AppendLog(nameValueCollection, "未获取到支付方式信息", this.Page.Request.Url.ToString(), "", "WapInpourPage");
                        this.ResponseStatus(true, "gatewaynotfound");
                    }
                    else
                    {
                        this.Notify.Finished          += this.Notify_Finished;
                        this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                        this.Notify.Payment           += this.Notify_Payment;
                        this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(this.paymode.Settings));
                    }
                }
            }
        }
コード例 #17
0
		protected void Page_Load(object sender, EventArgs e)
		{
			NameValueCollection nameValueCollection = new NameValueCollection
			{
				this.Page.Request.Form,
				this.Page.Request.QueryString
			};
			this.Gateway = "hishop.plugins.payment.ws_wappay.wswappayrequest";
			this.Notify = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
			this.OrderId = this.Notify.GetOrderId();
			this.Order = ShoppingProcessor.GetOrderInfo(this.OrderId);
			this.offlineOrder = StoresHelper.GetStoreCollectionInfo(this.OrderId);
			if (this.Order == null && this.offlineOrder == null)
			{
				Globals.AppendLog(nameValueCollection, "通知信息为空", "", "", "AppStore_wxPay");
				base.Response.Write("success");
			}
			else
			{
				PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.ws_wappay.wswappayrequest");
				if (paymentMode == null)
				{
					Globals.WriteLog(nameValueCollection, "支付方式获取失败hishop.plugins.payment.ws_wappay.wswappayrequest", "", "", "alipay");
					base.Response.Write("success");
				}
				else
				{
					this.Amount = this.Notify.GetOrderAmount();
					if (this.Order == null)
					{
						this.isOfflineOrder = true;
					}
					else
					{
						if (this.Amount <= decimal.Zero)
						{
							this.Amount = this.Order.GetTotal(true);
						}
						this.offlineOrder = StoresHelper.GetStoreCollectionInfoOfOrderId(this.OrderId);
						this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
						this.Order.PaymentType = paymentMode.Name;
						this.Order.PaymentTypeId = 2;
						this.Order.Gateway = paymentMode.Gateway;
						if (this.offlineOrder == null)
						{
							this.offlineOrder = StoresHelper.GetStoreCollectionInfoOfOrderId(this.Order.OrderId);
						}
					}
					if (this.offlineOrder != null)
					{
						if (this.Amount <= decimal.Zero)
						{
							this.Amount = this.offlineOrder.PayAmount;
						}
						this.offlineOrder.GateWayOrderId = this.Notify.GetGatewayOrderId();
						this.offlineOrder.PaymentTypeId = 2;
						this.offlineOrder.PaymentTypeName = paymentMode.Name;
						this.offlineOrder.GateWay = paymentMode.Gateway;
					}
					this.Notify.Finished += this.Notify_Finished;
					this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
					this.Notify.Payment += this.Notify_Payment;
					this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(paymentMode.Settings));
				}
			}
		}
コード例 #18
0
        private void DoValidate()
        {
            ErrorLog.Write("标准支付回调开始...");

            try
            {
                System.Collections.Generic.SortedDictionary <string, string> requestFormPost = this.GetRequestPostForm();
                WriteRequestFormToLog(requestFormPost);
                System.Collections.Generic.SortedDictionary <string, string> requestQueryStringPost = this.GetRequestPostForm();
                WriteRequestQueryStringToLog(requestQueryStringPost);
            }
            catch
            {
                ErrorLog.Write("标准支付回调开始:错误:");
            }

            System.Collections.Specialized.NameValueCollection parameters = new System.Collections.Specialized.NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };
            this.Gateway = this.Page.Request.QueryString["HIGW"];
            ErrorLog.Write("标准支付回调,支持回调Gateway:" + this.Gateway);
            this.Notify = PaymentNotify.CreateInstance(this.Gateway, parameters);
            if (this.isBackRequest)
            {
                ErrorLog.Write("标准支付回调,支持回调");

                this.Notify.ReturnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[]
                {
                    this.Gateway
                })) + "?" + this.Page.Request.Url.Query;
            }
            this.OrderId = this.Notify.GetOrderId();
            this.Order   = TradeHelper.GetOrderInfo(this.OrderId);
            if (this.Order == null)
            {
                ErrorLog.Write("标准支付回调,订单不存在:" + this.OrderId);

                this.ResponseStatus(true, "ordernotfound");
                return;
            }
            this.Amount = this.Notify.GetOrderAmount();
            if (this.Amount <= 0m)
            {
                this.Amount = this.Order.GetTotal();
            }
            this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();

            ErrorLog.Write(string.Format("标准支付回调,订单号:{0},网关:{1},流水号:{2}", this.OrderId, this.Gateway, this.Order.GatewayOrderId));
            //PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(this.Order.PaymentTypeId);
            PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(this.Gateway);

            if (paymentMode == null)
            {
                ErrorLog.Write(string.Format("标准支付回调,不支持的网关,订单号:{0},网关:{1},流水号:{2}", this.OrderId, this.Gateway, this.Order.GatewayOrderId));
                this.ResponseStatus(true, "gatewaynotfound");
                return;
            }

            if (this.Order.Gateway.ToLower() != this.Gateway.ToLower())
            {
                ErrorLog.Write(string.Format("标准支付回调,变更网关,订单号:{0},网关:{1},流水号:{2},新网关:{3}", this.OrderId, this.Order.Gateway, this.Order.GatewayOrderId, this.Gateway));

                PaymentModeInfo paymentType = SalesHelper.GetPaymentMode(this.Gateway);
                if (paymentType != null)
                {
                    this.Order.Gateway       = this.Gateway;
                    this.Order.PaymentTypeId = paymentType.ModeId;
                    this.Order.PaymentType   = paymentType.Name;
                }
            }

            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));
        }
コード例 #19
0
        private void DoValidate()
        {
            string text = "";
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };

            this.Gateway = base.GetParameter("HIGW", false);
            if (!string.IsNullOrEmpty(this.Gateway))
            {
                this.Gateway = this.Gateway.ToLower().Replace("_", ".");
                if (this.Gateway.ToLower().IndexOf("cmpay.d") > -1)
                {
                    this.Gateway = this.Gateway.ToLower().Replace("cmpay.d", "cmpay_d");
                }
            }
            else
            {
                this.Gateway = "";
            }
            if (this.Gateway == "hishop.plugins.payment.alipayqrcode.qrcoderequest" && nameValueCollection["goods_id"] != null && nameValueCollection["goods_id"] != "")
            {
                this.ValidateQRCode(nameValueCollection);
            }
            else
            {
                if (this.Gateway == "hishop.plugins.payment.wxqrcode.wxqrcoderequest")
                {
                    string wXQRCodePayResult = this.GetWXQRCodePayResult();
                    nameValueCollection.Add("notify_data", wXQRCodePayResult);
                }
                if (this.Gateway == "hishop.plugins.payment.alipayforextrade")
                {
                    nameValueCollection.Add("IsReturn", this.isBackRequest ? "false" : "true");
                }
                if (this.Gateway == "hishop.plugins.payment.alipaydirect.directrequest")
                {
                    if (this.isBackRequest)
                    {
                        nameValueCollection = new NameValueCollection
                        {
                            this.Page.Request.Form
                        };
                    }
                    else
                    {
                        nameValueCollection = new NameValueCollection
                        {
                            this.Page.Request.QueryString
                        };
                        nameValueCollection.Add("IsReturn", this.isBackRequest ? "false" : "true");
                    }
                }
                this.Notify = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
                if (this.isBackRequest)
                {
                    string hIGW = this.Gateway.Replace(".", "_");
                    this.Notify.ReturnUrl = Globals.FullPath(base.GetRouteUrl("PaymentReturn_url", new
                    {
                        HIGW = hIGW
                    })) + "?" + this.Page.Request.Url.Query;
                }
                this.OrderId = this.Notify.GetOrderId();
                this.Order   = TradeHelper.GetOrderInfo(this.OrderId);
                if (this.Order == null)
                {
                    Globals.AppendLog(this.pageParam, "订单信息为空", "", "", "PayNotify");
                    this.ResponseStatus(true, "ordernotfound");
                }
                else
                {
                    text = "OrderId:" + this.OrderId;
                    try
                    {
                        this.Amount = this.Notify.GetOrderAmount();
                    }
                    catch
                    {
                        this.Amount = default(decimal);
                    }
                    if (this.Amount <= decimal.Zero)
                    {
                        this.Amount = this.Order.GetTotal(true);
                    }
                    text           = text + "--Amount:" + this.Amount;
                    this.hasNotify = !string.IsNullOrEmpty(this.Order.GatewayOrderId);
                    if (this.Order.PreSaleId > 0 && this.Order.DepositGatewayOrderId.ToNullString() == this.Notify.GetGatewayOrderId())
                    {
                        this.ResponseStatus(true, "预售订单订金已支付成功");
                    }
                    else
                    {
                        if (this.Order.PreSaleId > 0 && !this.Order.DepositDate.HasValue)
                        {
                            this.Order.DepositGatewayOrderId = this.Notify.GetGatewayOrderId();
                        }
                        else
                        {
                            this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
                        }
                        text = text + "--GateWayOrderId:" + this.Notify.GetGatewayOrderId();
                        PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(this.Order.PaymentTypeId);
                        if (paymentMode == null)
                        {
                            Globals.WriteLog(nameValueCollection, "支付方式没找到" + this.Gateway, "", "", "PayNotify");
                            this.ResponseStatus(true, "gatewaynotfound");
                        }
                        else
                        {
                            this.Notify.Finished          += this.Notify_Finished;
                            this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                            this.Notify.Payment           += this.Notify_Payment;
                            try
                            {
                                this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(paymentMode.Settings));
                            }
                            catch (Exception ex)
                            {
                                if (!(ex is ThreadAbortException))
                                {
                                    Globals.WriteLog(nameValueCollection, ex.Message + "---程序错误1---" + this.Gateway, "", "", "PayNotify");
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #20
0
        public void ValidateQRCode(NameValueCollection parameters)
        {
            string str = "";

            this.Notify = PaymentNotify.CreateInstance(this.Gateway, parameters);
            string  text  = "";
            string  text2 = "";
            string  text3 = "";
            int     num   = 0;
            decimal d     = default(decimal);

            text  = this.Page.Request["sign"];
            text2 = this.Page.Request["goods_id"];
            int.TryParse(this.Page.Request["quantity"], out num);
            decimal.TryParse(this.Page.Request["price"], out d);
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary = this.getParamDict(parameters);
            string str2    = PaymentTemplatedWebControl.BuildQuery(dictionary, false);
            string orderId = text2;

            this.Order = TradeHelper.GetOrderInfo(orderId);
            if (this.Order == null)
            {
                Globals.WriteLog(parameters, "订单信息为空" + this.Gateway, "", "", "PayNotify");
                text3 = "PARAM_ILLEGAL";
            }
            else
            {
                PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(this.Order.PaymentTypeId);
                if (paymentMode == null)
                {
                    Globals.WriteLog(parameters, "支付方式为空" + this.Gateway, "", "", "PayNotify");
                    text3 = "PARAM_ILLEGAL";
                }
                else
                {
                    Globals.EntityCoding(paymentMode, false);
                    ConfigData configData = new ConfigData(HiCryptographer.Decrypt(paymentMode.Settings));
                    string     text4      = configData.SettingsXml.ToLower();
                    if (text4.IndexOf("<key>") > -1 && text4.IndexOf("</key>") > -1)
                    {
                        str = text4.Substring(text4.IndexOf("<key>") + 5, text4.IndexOf("</key>") - text4.IndexOf("<key>") - 5);
                    }
                    string b = FormsAuthentication.HashPasswordForStoringInConfigFile(str2 + str, "MD5").ToLower();
                    if (this.Order.GetTotal(true) != d)
                    {
                        Globals.WriteLog(parameters, "支付金额与订单金额不匹配" + this.Gateway, "", "", "PayNotify");
                        text3 = "PRICE_NOT_MATCH";
                    }
                    if (text != b)
                    {
                        Globals.WriteLog(parameters, "签名不匹配" + this.Gateway, "", "", "PayNotify");
                        text3 = "PARAM_ILLEGAL";
                    }
                }
            }
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.ContentType = "application/json";
            StringBuilder stringBuilder = new StringBuilder("{");

            if (text3 != "")
            {
                stringBuilder.AppendFormat("is_success:\"F\",error_code:\"{0}\"", text3);
            }
            else
            {
                stringBuilder.AppendFormat("is_success:\"T\",out_trade_no:\"{0}\"", this.Order.OrderId);
            }
            stringBuilder.Append("}");
            HttpContext.Current.Response.Write(stringBuilder.ToString());
            HttpContext.Current.Response.End();
        }