Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AlipayCaeNotifyModel model = new AlipayCaeNotifyModel();
            SortedDictionary <string, string> sPara = AlipayCoreHelper.GetRequestPost(Request.Form);
            string tmpPara = AlipayCoreHelper.GetPreSignStr(sPara);

            Log.Inf("[Alipay_CAEPayNotify_Request]:" + tmpPara + "|" + Request.Form["sign"]);

            if (sPara != null && sPara.Count > 0)
            {
                model.Sign         = Request.Form["sign"];
                model.Body         = Request.Form["body"];
                model.Buyer_Email  = Request.Form["buyer_email"];
                model.Buyer_Id     = Request.Form["buyer_id"];
                model.Notify_Id    = Request.Form["notify_id"];
                model.Notify_Time  = Request.Form["notify_time"];
                model.Notify_Type  = Request.Form["notify_type"];
                model.Out_Trade_No = Request.Form["out_trade_no"];
                model.Payment_Type = Request.Form["payment_type"];
                model.Seller_Email = Request.Form["seller_email"];
                model.Seller_Id    = Request.Form["seller_id"];
                model.Subject      = Request.Form["subject"];
                model.Total_Fee    = Request.Form["total_fee"];
                model.Trade_No     = Request.Form["trade_no"];
                model.Trade_Status = Request.Form["trade_status"];
                model.Gmt_Create   = Request.Form["gmt_create"];
                model.Gmt_payment  = Request.Form["gmt_payment"];
                model.sPara        = sPara;

                TradePayResponse result = payNotifyClient.AlipayCaeNotify(model);
                Log.Inf("[Alipay_CAEPayNotify_Response]:" + SerializerHelper.SerializerToXml <TradePayResponse>(result));

                if (!(result.Status == "-1"))
                {
                    string[] data = result.RequestUrl.Split('|');

                    if (!(string.IsNullOrEmpty(data[0]) || string.IsNullOrEmpty(data[1])))
                    {
                        string tmp = HttpHelper.PostData(data[0], data[1]);
                    }
                    Response.Write("success");
                }
                else
                {
                    Response.Write("fail");
                }
            }
            else
            {
                Response.Write("无通知参数");
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AlipayPayReturnModel model = new AlipayPayReturnModel();
            SortedDictionary <string, string> sPara = AlipayCoreHelper.GetRequestGet(Request.QueryString);
            string tmpPara = AlipayCoreHelper.GetPreSignStr(sPara);

            Log.Inf("[Alipay_PayReturn_Request]:" + tmpPara + "|" + Request.Form["sign"]);

            if (sPara != null && sPara.Count > 0)
            {
                model.Sign         = sPara["sign"];
                model.Body         = sPara["body"];
                model.Buyer_Email  = sPara["buyer_email"];
                model.Buyer_Id     = sPara["buyer_id"];
                model.Notify_Id    = sPara["notify_id"];
                model.Notify_Time  = sPara["notify_time"];
                model.Notify_Type  = sPara["notify_type"];
                model.Out_Trade_No = sPara["out_trade_no"];
                model.Payment_Type = sPara["payment_type"];
                model.Seller_Email = sPara["seller_email"];
                model.Seller_Id    = sPara["seller_id"];
                model.Subject      = sPara["subject"];
                model.Total_Fee    = sPara["total_fee"];
                model.Trade_No     = sPara["trade_no"];
                model.Trade_Status = sPara["trade_status"];
                model.sPara        = sPara;
                TradePayResponse result = payNotifyClient.AlipayPayReturn(model);
                Log.Inf("[Alipay_PayReturn_Response]:" + SerializerHelper.SerializerToXml <TradePayResponse>(result));

                if (!(result.Status == "-1"))
                {
                    if (!string.IsNullOrEmpty(result.RequestUrl))
                    {
                        Response.Redirect(result.RequestUrl);
                    }
                    else
                    {
                        Response.Write("验证成功");
                    }
                }
                else
                {
                    Response.Write("验证失败");
                }
            }
            else
            {
                Response.Write("无返回参数");
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AlipayUnFreezeNotifyModel         model = new AlipayUnFreezeNotifyModel();
            SortedDictionary <string, string> sPara = AlipayCoreHelper.GetRequestPost(Request.Form);
            string tmpPara = AlipayCoreHelper.GetPreSignStr(sPara);

            Log.Inf("[Alipay_UnFreezeNotify_Request]:" + tmpPara + "|" + Request.Form["sign"]);

            if (sPara != null && sPara.Count > 0)
            {
                model.Sign   = Request.Form["sign"];
                model.Amount = Request.Form["amount"];
                model.UnFreeze_Out_Order_No = Request.Form["unfreeze_out_order_no"];
                model.Notify_Id             = Request.Form["notify_id"];
                model.Notify_Time           = Request.Form["notify_time"];
                model.Notify_Type           = Request.Form["notify_type"];
                model.Pay_Date      = Request.Form["pay_date"];
                model.Result_Code   = Request.Form["result_code"];
                model.Status        = Request.Form["status"];
                model.Trade_No      = Request.Form["trade_no"];
                model.User_Id       = Request.Form["user_id"];
                model.User_Logon_Id = Request.Form["user_logon_id"];
                model.sPara         = sPara;

                TradePayResponse result = payNotifyClient.AlipayUnFreezeNotify(model);

                Log.Inf("[Alipay_UnFreezeNotify_Response]:" + SerializerHelper.SerializerToXml <TradePayResponse>(result));
                Response.Write("success");

                if (!(result.Status == "-1"))
                {
                    string[] data = result.RequestUrl.Split('|');

                    if (!(string.IsNullOrEmpty(data[0]) || string.IsNullOrEmpty(data[1])))
                    {
                        string tmp = HttpHelper.PostData(data[0], data[1]);
                    }
                    Response.Write("success");
                }
                else
                {
                    Response.Write("fail");
                }
            }
            else
            {
                Response.Write("无通知参数");
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AlipayTransNotifyModel            model = new AlipayTransNotifyModel();
            SortedDictionary <string, string> sPara = AlipayCoreHelper.GetRequestPost(Request.Form);
            string tmpPara = AlipayCoreHelper.GetPreSignStr(sPara);

            Log.Inf("[Alipay_TransNotify_Request]:" + tmpPara + "|" + Request.Form["sign"]);

            if (sPara != null && sPara.Count > 0)
            {
                model.Sign            = Request.Form["sign"];
                model.Batch_No        = Request.Form["batch_no"];
                model.Notify_Id       = Request.Form["notify_id"];
                model.Notify_Time     = Request.Form["notify_time"];
                model.Notify_Type     = Request.Form["notify_type"];
                model.Pay_Account_No  = Request.Form["pay_account_no"];
                model.Pay_User_Id     = Request.Form["pay_user_id"];
                model.Pay_User_Name   = Request.Form["pay_user_name"];
                model.Success_Details = Request.Form["success_details"];
                model.Fail_Details    = Request.Form["fail_details"];
                model.sPara           = sPara;
                TradePayResponse result = payNotifyClient.AlipayTransNotify(model);

                Log.Inf("[Alipay_TransNotify_Response]:" + SerializerHelper.SerializerToXml <TradePayResponse>(result));

                if (!(result.Status == "-1"))
                {
                    string[] data = result.RequestUrl.Split('|');

                    if (!(string.IsNullOrEmpty(data[0]) || string.IsNullOrEmpty(data[1])))
                    {
                        string tmp = HttpHelper.PostData(data[0], data[1]);
                    }
                    Response.Write("success");
                }
                else
                {
                    Response.Write("fail");
                }
            }
            else
            {
                Response.Write("无通知参数");
            }
        }