SuLei.Web/api/payment/alipaymb/notify_url.aspx.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Xml;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SuLei.API.Payment.alipaymb;
using SuLei.Common;

namespace SuLei.Web.api.payment.alipaymb
{
    public partial class notify_url : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int site_payment_id = 0; //站点支付方式ID
            Dictionary<string, string> sPara = GetRequestPost();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(sPara["notify_data"]);
                string trade_no = xmlDoc.SelectSingleNode("/notify/trade_no").InnerText; //支付宝交易号
                string order_no = xmlDoc.SelectSingleNode("/notify/out_trade_no").InnerText.ToUpper(); //商户订单号
                string total_fee = xmlDoc.SelectSingleNode("/notify/total_fee").InnerText; //获取总金额
                string trade_status = xmlDoc.SelectSingleNode("/notify/trade_status").InnerText; //交易状态
                if (order_no.StartsWith("R")) //充值订单
                {
                    site_payment_id = new BLL.user_recharge().GetPaymentId(order_no);
                }
                else if (order_no.StartsWith("B")) //商品订单
                {
                    site_payment_id = new BLL.orders().GetPaymentId(order_no);
                }
                if (site_payment_id == 0)
                {
                    Response.Write("该订单号不存在");
                    return;
                }

                //找到站点支付方式ID开始验证
                Notify aliNotify = new Notify(site_payment_id);
                bool verifyResult = aliNotify.VerifyNotify(sPara, Request.Form["sign"]);
                if (verifyResult)//验证成功
                {
                    try
                    {
                        if (trade_status == "TRADE_FINISHED" || trade_status == "TRADE_SUCCESS")
                        {
                            if (order_no.StartsWith("R")) //充值订单
                            {
                                BLL.user_recharge bll = new BLL.user_recharge();
                                Model.user_recharge model = bll.GetModel(order_no);
                                if (model == null)
                                {
                                    Response.Write("该订单号不存在");
                                    return;
                                }
后面还有 95 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。