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