2020-12-28 14:55:48 +08:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Hncore.Infrastructure.Extension;
|
|
|
|
|
using Hncore.Infrastructure.Serializer;
|
|
|
|
|
using Hncore.Infrastructure.Service;
|
|
|
|
|
using Hncore.Infrastructure.WebApi;
|
|
|
|
|
using Hncore.Payment.Request;
|
|
|
|
|
using Hncore.Payment.Response;
|
|
|
|
|
using PaymentCenterClient;
|
|
|
|
|
|
|
|
|
|
namespace Hncore.Payment.ClientExtension
|
|
|
|
|
{
|
|
|
|
|
public static class WechatJsPay
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 微信小程序、公众号支付下单
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<ApiResult> WechatJsPayCreateOrder(this ServiceHttpClient client,
|
|
|
|
|
WechatJsPayCreateOrderRequest request)
|
|
|
|
|
{
|
|
|
|
|
var res = await client.CreateInternalClient()
|
|
|
|
|
.PostAsJsonGetString($"{client.BaseUrl}/api/paymentcenter/v1/WechatJsPay/CreateOrder",
|
|
|
|
|
request);
|
|
|
|
|
//WechatJsPayCreateOrderResponse
|
|
|
|
|
return res.FromJsonTo<ApiResult>();
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-07 20:25:03 +08:00
|
|
|
}
|