QiFeng.ZWY.Utility/WeChartSignHelper.cs

(开头部分) 23KB

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

using log4net;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Web;
using System.Xml;

namespace QiFeng.LMSD.Utility
{
    public class WeChartSignHelper
    {

        private const string Url = "https://api.mch.weixin.qq.com/pay/unifiedorder";
        private static ILog _fileLog = LogManager.GetLogger(typeof(WeChartSignHelper));

        #region UseFunc

        /// <summary>
        /// 微信加签
        /// 调用从这里开始
        /// 直接调用该方法即可完成加签步骤
        /// </summary>
        /// <param name="appid"></param>
        /// <param name="mch_id"></param>
        /// <param name="body"></param>
        /// <param name="out_trade_no"></param>
        /// <param name="total_fee"></param>
        /// <param name="notify_url"></param>
        /// <param name="key"></param>
        /// <param name="detail"></param>
        /// <param name="attach"></param>
        /// <param name="time_start"></param>
        /// <param name="time_expire"></param>
        /// <param name="goods_tag"></param>
        /// <param name="limit_pay"></param>
        /// <param name="scene_info"></param>
        /// <returns></returns>
        public static SignResult GetWeChartSign(string appid, string mch_id, string body, string out_trade_no, string total_fee/*, string spbill_create_ip*/, string notify_url, string key, string detail = null, string attach = null, string time_start = null, string time_expire = null, string goods_tag = null, string limit_pay = null, string scene_info = null)
        {
            SignResult result;
            try
            {
                var nonce_str = getRandomStringByLength(32);

                SortedDictionary<string, object> M = new SortedDictionary<string, object>();
                M.Add("appid", appid);
                M.Add("mch_id", mch_id);
                M.Add("body", body);
                M.Add("out_trade_no", out_trade_no);
                M.Add("total_fee", total_fee);
                M.Add("spbill_create_ip", Dns.GetHostAddresses(System.Net.Dns.GetHostName()).Where(u => u.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).First().ToString());
                M.Add("notify_url", notify_url);
后面还有 591 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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