fix(tenpayv2): 修复押金支付接口 IsSuccessful 判断错误的问题
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeLint / Lint (push) Has been cancelled

This commit is contained in:
Ge
2025-09-29 09:08:25 +08:00
committed by GitHub
parent fb8599b8e1
commit 17d9326812

View File

@@ -171,5 +171,18 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
[System.Text.Json.Serialization.JsonPropertyName("time_end")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.DigitalDateTimeOffsetConverter))]
public DateTimeOffset? EndTime { get; set; }
/// <inheritdoc/>
/// <remarks>
/// 针对押金支付接口,当押金支付不需要等待用户输入密码时,微信会直接冻结资金并返回表示交易成功的响应体,
/// 此时错误代码 err_code 节点的值为 "SUCCESS",应当被视为成功。
/// </remarks>
public override bool IsSuccessful()
{
bool ret1 = GetRawStatus() == 200 && "SUCCESS".Equals(ReturnCode);
bool ret2 = string.IsNullOrEmpty(ErrorCode) || "0".Equals(ErrorCode) || "SUCCESS".Equals(ErrorCode);
bool ret3 = string.IsNullOrEmpty(ResultCode) || "SUCCESS".Equals(ResultCode);
return ret1 && ret2 && ret3;
}
}
}