mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 01:58:14 +08:00
test(tenpayv3): 修改配置项
This commit is contained in:
@@ -26,8 +26,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
|
||||
{
|
||||
MerchantId = TestConfigs.WechatMerchantId,
|
||||
MerchantV3Secret = TestConfigs.WechatMerchantSecret,
|
||||
MerchantCertificateSerialNumber = TestConfigs.WechatMerchantCertSerialNumber,
|
||||
MerchantCertificatePrivateKey = TestConfigs.WechatMerchantCertPrivateKey,
|
||||
MerchantCertificateSerialNumber = TestConfigs.WechatMerchantCertificateSerialNumber,
|
||||
MerchantCertificatePrivateKey = TestConfigs.WechatMerchantCertificatePrivateKey,
|
||||
AutoEncryptRequestSensitiveProperty = true,
|
||||
AutoDecryptResponseSensitiveProperty = true
|
||||
});
|
||||
@@ -39,8 +39,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
|
||||
{
|
||||
MerchantId = TestConfigs.WechatMerchantId,
|
||||
MerchantV3Secret = TestConfigs.WechatMerchantSecret,
|
||||
MerchantCertificateSerialNumber = TestConfigs.WechatMerchantCertSerialNumber,
|
||||
MerchantCertificatePrivateKey = TestConfigs.WechatMerchantCertPrivateKey,
|
||||
MerchantCertificateSerialNumber = TestConfigs.WechatMerchantCertificateSerialNumber,
|
||||
MerchantCertificatePrivateKey = TestConfigs.WechatMerchantCertificatePrivateKey,
|
||||
AutoEncryptRequestSensitiveProperty = false,
|
||||
AutoDecryptResponseSensitiveProperty = false
|
||||
});
|
||||
|
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
|
||||
@@ -11,8 +12,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
|
||||
{
|
||||
MerchantId = TestConfigs.WechatMerchantId,
|
||||
MerchantV3Secret = TestConfigs.WechatMerchantSecret,
|
||||
MerchantCertificateSerialNumber = TestConfigs.WechatMerchantCertSerialNumber,
|
||||
MerchantCertificatePrivateKey = TestConfigs.WechatMerchantCertPrivateKey,
|
||||
MerchantCertificateSerialNumber = TestConfigs.WechatMerchantCertificateSerialNumber,
|
||||
MerchantCertificatePrivateKey = TestConfigs.WechatMerchantCertificatePrivateKey,
|
||||
PlatformCertificateManager = certificateManager
|
||||
});
|
||||
}
|
||||
@@ -21,6 +22,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
|
||||
{
|
||||
var request = new Models.QueryCertificatesRequest();
|
||||
var response = await Instance.ExecuteQueryCertificatesAsync(request);
|
||||
|
||||
if (!response.IsSuccessful())
|
||||
throw new Exception();
|
||||
|
||||
foreach (var certificate in Instance.DecryptResponseSensitiveProperty(response).CertificateList)
|
||||
{
|
||||
Instance.PlatformCertificateManager.AddEntry(new Settings.CertificateEntry(certificate));
|
||||
|
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
|
||||
var config = jdoc.RootElement.GetProperty("TestConfig");
|
||||
WechatMerchantId = config.GetProperty("MerchantId").GetString()!;
|
||||
WechatMerchantSecret = config.GetProperty("MerchantSecret").GetString()!;
|
||||
WechatMerchantCertSerialNumber = config.GetProperty("MerchantCertSerialNumber").GetString()!;
|
||||
WechatMerchantCertPrivateKey = config.GetProperty("MerchantCertPrivateKey").GetString()!;
|
||||
WechatMerchantCertificateSerialNumber = config.GetProperty("MerchantCertificateSerialNumber").GetString()!;
|
||||
WechatMerchantCertificatePrivateKey = config.GetProperty("MerchantCertificatePrivateKey").GetString()!;
|
||||
WechatAppId = config.GetProperty("AppId").GetString()!;
|
||||
WechatOpenId = config.GetProperty("OpenId").GetString()!;
|
||||
|
||||
@@ -35,8 +35,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
|
||||
|
||||
public static readonly string WechatMerchantId;
|
||||
public static readonly string WechatMerchantSecret;
|
||||
public static readonly string WechatMerchantCertSerialNumber;
|
||||
public static readonly string WechatMerchantCertPrivateKey;
|
||||
public static readonly string WechatMerchantCertificateSerialNumber;
|
||||
public static readonly string WechatMerchantCertificatePrivateKey;
|
||||
public static readonly string WechatAppId;
|
||||
public static readonly string WechatOpenId;
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
{
|
||||
{
|
||||
"TestConfig": {
|
||||
"MerchantId": "请在此填写用于测试的微信商户号",
|
||||
"MerchantSecret": "请在此填写用于测试的微信商户 API v3 密钥",
|
||||
"MerchantCertSerialNumber": "请在此填写用于测试的微信商户 API 证书序列号",
|
||||
"MerchantCertPrivateKey": "请在此填写用于测试的微信商户 API 证书私钥(字符串格式)",
|
||||
"MerchantCertificateSerialNumber": "请在此填写用于测试的微信商户 API 证书序列号",
|
||||
"MerchantCertificatePrivateKey": "请在此填写用于测试的微信商户 API 证书私钥(字符串格式)",
|
||||
"AppId": "请在此填写用于测试的微信 AppId",
|
||||
"OpenId": "请在此填写用于测试的微信用户唯一标识"
|
||||
},
|
||||
|
Reference in New Issue
Block a user