mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-20 02:29:40 +08:00
feat(tenpayv3): 构造器模式
This commit is contained in:
@@ -35,7 +35,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Controllers
|
||||
string content = await reader.ReadToEndAsync();
|
||||
_logger.LogInformation("接收到微信支付推送的数据:{0}", content);
|
||||
|
||||
using var client = _wechatTenpayClientFactory.Create(merchantId);
|
||||
var client = _wechatTenpayClientFactory.Create(merchantId);
|
||||
bool valid = client.VerifyEventSignature(
|
||||
webhookTimestamp: timestamp,
|
||||
webhookNonce: nonce,
|
||||
|
@@ -31,7 +31,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Controllers
|
||||
[Route("jsapi")]
|
||||
public async Task<IActionResult> CreateOrderByJsapi([FromBody] Models.CreateOrderByJsapiRequest requestModel)
|
||||
{
|
||||
using var client = _wechatTenpayClientFactory.Create(requestModel.MerchantId);
|
||||
var client = _wechatTenpayClientFactory.Create(requestModel.MerchantId);
|
||||
var request = new CreatePayTransactionJsapiRequest()
|
||||
{
|
||||
OutTradeNumber = "SAMPLE_OTN_" + DateTimeOffset.Now.ToString("yyyyMMddHHmmssfff"),
|
||||
|
@@ -31,7 +31,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Sample.Controllers
|
||||
[Route("")]
|
||||
public async Task<IActionResult> CreateRefund([FromBody] Models.CreateRefundRequest requestModel)
|
||||
{
|
||||
using var client = _wechatTenpayClientFactory.Create(requestModel.MerchantId);
|
||||
var client = _wechatTenpayClientFactory.Create(requestModel.MerchantId);
|
||||
var request = new CreateRefundDomesticRefundRequest()
|
||||
{
|
||||
TransactionId = requestModel.TransactionId,
|
||||
|
Reference in New Issue
Block a user