修改支付
This commit is contained in:
parent
f37a01601b
commit
b86f3df2bc
|
|
@ -1,4 +1,5 @@
|
|||
using Microsoft.Extensions.Caching.Memory;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
@ -12,6 +13,9 @@ namespace XLib.DotNetCore.CacheHelper
|
|||
/// </summary>
|
||||
public class MemoryCacheHelper
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static MemoryCache cache = new MemoryCache(new MemoryCacheOptions());
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -22,8 +26,7 @@ namespace XLib.DotNetCore.CacheHelper
|
|||
/// <returns></returns>
|
||||
public static T? GetCache<T>(string cacheName) where T : class, new()
|
||||
{
|
||||
|
||||
return cache.TryGetValue(cacheName, out var value) ? value as T : null;
|
||||
return cache.TryGetValue<T?>(cacheName, out var value) ? value : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -22,4 +22,8 @@
|
|||
<PackageReference Include="StackExchange.Redis" Version="2.8.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="JwtInfrastructure\Extend\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -66,7 +66,8 @@ namespace HuanMeng.MiaoYu.Code.Payment.WeChat
|
|||
var response = await client.ExecuteCreatePayTransactionJsapiAsync(request);
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
var paramMap = client.GenerateParametersForAppPayRequest(request.AppId, response.PrepayId);
|
||||
var paramMap = client.GenerateParametersForJsapiPayRequest(request.AppId, response.PrepayId);
|
||||
|
||||
//Console.WriteLine("PrepayId:" + response.PrepayId);
|
||||
return new(orderId, JsonConvert.SerializeObject(paramMap));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.4" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user