Skip to content

Commit

Permalink
修改 ReturnJsonBase.Signed -> ReturnJsonBase.VerifySignSuccess
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySu committed Aug 23, 2021
1 parent 8412649 commit 5ff1475
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public async Task<IActionResult> PayNotifyUrl()
//}

//验证请求是否从微信发过来(安全)
if (orderReturnJson.Signed == true && trade_state == "SUCCESS")
if (orderReturnJson.VerifySignSuccess == true && trade_state == "SUCCESS")
{
res = "success";//正确的订单处理
//直到这里,才能认为交易真正成功了,可以进行数据库操作,但是别忘了返回规定格式的消息!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void JsAPiAsyncTest()

Assert.IsNotNull(result);
Assert.IsTrue(result.ResultCode.Success);
Assert.IsTrue(result.Signed == true);//通过验证
Assert.IsTrue(result.VerifySignSuccess == true);//通过验证

}

Expand All @@ -54,7 +54,7 @@ public void CertificatesTest()
Assert.IsNotNull(certs);
Console.WriteLine(certs.ToJson(true));
Assert.IsTrue(certs.ResultCode.Success);
Assert.IsNull(certs.Signed);//不参与验证
Assert.IsNull(certs.VerifySignSuccess);//不参与验证

Console.WriteLine();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ public class ReturnJsonBase
/// <summary>
/// 回复签名是否正确 在有错误的情况下,或不要求验证签名时 为null
/// </summary>
public bool? Signed { get; set; } = null;
public bool? VerifySignSuccess { get; set; } = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public async Task<T> RequestAsync<T>(string url, object data, int timeOut = Conf
try
{
var pubKey = await TenPayV3InfoCollection.GetAPIv3PublicKeyAsync(this._tenpayV3Setting, wechatpaySerial);
result.Signed = TenPaySignHelper.VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignatureBase64, content, pubKey);
result.VerifySignSuccess = TenPaySignHelper.VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignatureBase64, content, pubKey);
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public async Task<T> AesGcmDecryptGetObjectAsync<T>(string aes_key = null, strin
var wechatpayNonce = _httpContext.Request.Headers?["Wechatpay-Nonce"];
var wechatpaySignature = _httpContext.Request.Headers?["Wechatpay-Signature"];

result.Signed = await TenPaySignHelper.VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignature, Body, this._tenpayV3Setting);
result.VerifySignSuccess = await TenPaySignHelper.VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignature, Body, this._tenpayV3Setting);
result.ResultCode = null;

return result;
Expand Down

0 comments on commit 5ff1475

Please sign in to comment.