mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-11 18:26:20 +08:00
chore(tenpayv3): 新增基于 .NET Framework 4.7 的示例项目
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample_Net5.Services.HttpClients.Implements
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.HttpClients.Implements
|
||||
{
|
||||
using SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings;
|
||||
|
||||
@@ -15,7 +15,9 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample_Net5.Services.HttpClients.
|
||||
|
||||
public CertificateManager Create(string merchantId)
|
||||
{
|
||||
// 注意:这里的工厂方法是为了演示多租户而存在的;如果你的项目只存在唯一一个租户,那么直接注入 `CertificateManager` 就可以
|
||||
// NOTICE:
|
||||
// 这里的工厂方法是为了演示多租户而存在的,可根据商户号生成不同的证书管理器。
|
||||
// 如果你的项目只存在唯一一个租户,那么直接注入 `CertificateManager` 即可。
|
||||
|
||||
return _dict.GetOrAdd(merchantId, new InMemoryCertificateManager());
|
||||
}
|
||||
|
||||
@@ -5,10 +5,8 @@ using Flurl.Http;
|
||||
using Flurl.Http.Configuration;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample_Net5.Services.HttpClients.Implements
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Services.HttpClients.Implements
|
||||
{
|
||||
using SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings;
|
||||
|
||||
partial class WechatTenpayHttpClientFactory : IWechatTenpayHttpClientFactory
|
||||
{
|
||||
private readonly System.Net.Http.IHttpClientFactory _httpClientFactory;
|
||||
@@ -29,7 +27,9 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample_Net5.Services.HttpClients.
|
||||
|
||||
public WechatTenpayClient Create(string merchantId)
|
||||
{
|
||||
// 注意:这里的工厂方法是为了演示多租户而存在的;如果你的项目只存在唯一一个租户,那么直接注入 `WechatTenpayClient` 就可以
|
||||
// NOTICE:
|
||||
// 这里的工厂方法是为了演示多租户而存在的,可根据商户号生成不同的 API 客户端。
|
||||
// 如果你的项目只存在唯一一个租户,那么直接注入 `WechatTenpayClient` 即可。
|
||||
|
||||
var tenpayMerchantOptions = _tenpayOptions.Merchants?.FirstOrDefault(e => string.Equals(merchantId, e.MerchantId));
|
||||
if (tenpayMerchantOptions == null)
|
||||
|
||||
Reference in New Issue
Block a user