资源简介


资源截图

代码片段和文件信息

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using orgine_client_helper.Entity.Plugin;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using System.Threading.Tasks;
using WeChatFacePay.Helper;

namespace WeChatFacePay
{
    public class FacePay
    {
        private readonly HttpClient httpClient = new HttpClient();



        /// 
        /// 刷脸支付
        /// 

        public async Task StartFacePay(string out_trade_no)
        {
            Entiy.FacePay pay = new Entiy.FacePay();
            //Debug.WriteLine(“start....“);
            OwnLog.AddLog(“微信刷脸支付开始:--“);
            if (!_Init())
            {
                OwnLog.AddLog(“微信刷脸支付初始化失败:“);
                return null;
            }

            if (!_RefreshAuthinfo())
            {
                OwnLog.AddLog(“获取授权信息失败:“);
                return null;
            }

            var res = _GetFaceCode(TotalFee out_trade_no);
            string face_code = res.Item1;
            string openid = res.Item2;
            string sub_openid = res.Item3;
            if (string.IsNullOrEmpty(face_code))
            {
                pay.rc = -1;
                OwnLog.AddLog(“Get face_code Fail !!!“);
                return null;
            }
            pay.doPayOut = _FaceCodePay(face_code openid out_trade_no TotalFee).Result;
            bool pay_succ = true;
            pay.rc = 1;
            if (pay.doPayOut.pay_list is null || pay.doPayOut.pay_list.Length <= 0)
            {
                pay.rc = -1;
                pay_succ = false;
                return pay;
            }
            OwnLog.AddLog(“Face_code pay succ: “ + pay_succ);
            _UpdatePayResult(pay_succ);
            return pay;
        }

        /// 
        /// 刷脸认证
        /// 

        public void StartFaceAuth(ref int rc)
        {
            rc = 0;
            string AuthResult = ““;
            OwnLog.AddLog(“微信刷脸授权开始:--“);
            if (!_Init())
                return;
            if (!_RefreshAuthinfo())
                return;

            var res = _GetFaceSid();
            string face_sid = res.Item1;
            string openid = res.Item2;
            string sub_openid = res.Item3;
            OwnLog.AddLog(“face_sid: “ + res);
            if (string.IsNullOrEmpty(face_sid))
            {
                rc = -1;
                OwnLog.AddLog(“face_sid为空“);
                return;
            }

            bool result = _ReqAuth(face_sid ref AuthResult);

            rc = result ? 1 : -1;
        }

        /// 
        /// 微信刷脸支付交互
        /// 

        /// 
        /// 
        public Jobject CallWxpayFace(Jobject jreq)
        {
            if (!jreq.ContainsKey(“version“))
                jreq[“version“] = “1“;
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-11-02 14:16  WeChatFacePay\
     目录           0  2020-07-23 13:33  WeChatFacePay\.vs\
     目录           0  2020-07-23 13:33  WeChatFacePay\.vs\WeChatFacePay\
     目录           0  2020-07-23 13:33  WeChatFacePay\.vs\WeChatFacePay\v16\
     文件        6144  2020-07-23 13:33  WeChatFacePay\.vs\WeChatFacePay\v16\.suo
     目录           0  2020-11-02 14:16  WeChatFacePay\bin\
     目录           0  2020-11-02 14:16  WeChatFacePay\bin\Debug\
     文件      675752  2019-04-22 01:06  WeChatFacePay\bin\Debug\Newtonsoft.Json.dll
     文件       75264  2020-07-15 18:02  WeChatFacePay\bin\Debug\orgine-client-helper.dll
     文件       32256  2020-08-07 14:03  WeChatFacePay\bin\Debug\WeChatFacePay.dll
     文件       50688  2020-08-07 14:03  WeChatFacePay\bin\Debug\WeChatFacePay.pdb
     目录           0  2020-07-23 10:19  WeChatFacePay\bin\Release\
     文件       22683  2020-07-29 07:55  WeChatFacePay\FacePay.cs
     目录           0  2020-11-02 14:16  WeChatFacePay\Helper\
     文件         349  2020-07-23 17:44  WeChatFacePay\Helper\Entiy.cs
     文件        1215  2020-07-23 10:35  WeChatFacePay\Helper\OwnLog.cs
     目录           0  2020-11-02 14:16  WeChatFacePay\obj\
     目录           0  2020-11-02 14:16  WeChatFacePay\obj\Debug\
     文件        7114  2020-07-29 11:19  WeChatFacePay\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2020-07-23 10:19  WeChatFacePay\obj\Debug\TempPE\
     文件           0  2020-08-07 14:03  WeChatFacePay\obj\Debug\WeChatFacePay.csproj.CopyComplete
     文件          42  2020-08-07 14:03  WeChatFacePay\obj\Debug\WeChatFacePay.csproj.CoreCompileInputs.cache
     文件        1255  2020-08-07 14:03  WeChatFacePay\obj\Debug\WeChatFacePay.csproj.FileListAbsolute.txt
     文件         950  2020-08-07 14:03  WeChatFacePay\obj\Debug\WeChatFacePay.csproj.GenerateResource.cache
     文件       20648  2020-08-07 14:03  WeChatFacePay\obj\Debug\WeChatFacePay.csprojAssemblyReference.cache
     文件       32256  2020-08-07 14:03  WeChatFacePay\obj\Debug\WeChatFacePay.dll
     文件       50688  2020-08-07 14:03  WeChatFacePay\obj\Debug\WeChatFacePay.pdb
     文件         180  2020-08-07 14:03  WeChatFacePay\obj\Debug\WeChatFacePay.WxpayFaceService.resources
     文件         143  2020-07-29 07:48  WeChatFacePay\packages.config
     目录           0  2020-11-02 14:16  WeChatFacePay\Properties\
     文件        1318  2020-07-23 10:19  WeChatFacePay\Properties\AssemblyInfo.cs
............此处省略5个文件信息

评论

共有 条评论