Parcourir la source

Revert "."

This reverts commit d8ca716306c495718a9e28c463acd229e8d0796b.
Roc il y a 7 ans
Parent
commit
3dc3fb79bf

+ 8 - 12
samples/WebApplicationSample/Startup.cs

@@ -1,8 +1,4 @@
-using System;
-using System.Buffers.Text;
-using System.Net.Http;
-using System.Security.Cryptography.X509Certificates;
-using System.Text.Encodings.Web;
+using System.Text.Encodings.Web;
 using System.Text.Unicode;
 using Essensoft.AspNetCore.Payment.Alipay;
 using Essensoft.AspNetCore.Payment.JDPay;
@@ -51,13 +47,13 @@ namespace WebApplicationSample
             //    return handler;
             //});
 
-            services.AddHttpClient("wechatpayCertificateName").ConfigurePrimaryHttpMessageHandler(() =>
-            {
-                var certificate = new X509Certificate2(Convert.FromBase64String(Configuration["WeChatPay:Certificate"]), Configuration["WeChatPay:MchId"], X509KeyStorageFlags.MachineKeySet);
-                var handler = new HttpClientHandler();
-                handler.ClientCertificates.Add(certificate);
-                return handler;
-            });
+            //services.AddHttpClient("wechatpayCertificateName").ConfigurePrimaryHttpMessageHandler(() =>
+            //{
+            //    var certificate = new X509Certificate2("", "", X509KeyStorageFlags.MachineKeySet);
+            //    var handler = new HttpClientHandler();
+            //    handler.ClientCertificates.Add(certificate);
+            //    return handler;
+            //});
 
             // 引入Payment 依赖注入
             services.AddAlipay();

+ 0 - 1
src/Essensoft.AspNetCore.Payment.WeChatPay/WeChatPayClient.cs

@@ -175,7 +175,6 @@ namespace Essensoft.AspNetCore.Payment.WeChatPay
                 }
 
                 sortedTxtParams.Add(mch_id, options.MchId);
-                sortedTxtParams.Add(sign_type, SIGN_TYPE_HMAC_SHA256);
                 signType = false; // HMAC-SHA256
             }
             else if (request is WeChatPayRefundRequest)