请问下面代码在支付返回成功后,调用updateWxpayfacePayResult,为什么取消不了支付等待的UI界面?一直显示微信支付的等待UI界面,一分多钟后才超时返回,另这个等待界面秒数是否可调?
bool pay_succ = _AuthCodePay(auth_code).Result;
_UpdatePayResult(pay_succ);
private async Task<bool> _AuthCodePay(string auth_code)
{
try
{
var body = new Dictionary<string, string>
{
{ "out_trade_no", _GetOutTradeNo() },
{ "auth_code", auth_code },
{ "mch_id", _sp_mch_id },
{ "sub_mch_id",_sub_mch_id },
};
var req = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("http://121.45.24.16:8080/wx_face_pay/re.php"),
Content = new FormUrlEncodedContent(body)
};
HttpResponseMessage resp = await httpClient.SendAsync(req);
string resp_body = await resp.Content.ReadAsStringAsync();
Debug.WriteLine("auth_code pay resp: " + resp_body);
JObject respJson = JObject.Parse(resp_body);
return (string)respJson["return_code"] == "SUCCESS" && (string)respJson["result_code"] == "SUCCESS";
}catch (Exception e)
{
_WriteLog("auth_code pay exception: " + e.ToString());
return false;
}
}
private bool _UpdatePayResult(bool success)
{
_Init();
JObject jreq = JObject.FromObject(new
{
cmd = "updateWxpayfacePayResult",
appid = _sp_appid,
mch_id = _sp_mch_id,
store_id = _store_no,
authinfo = _authinfo,
payresult = success ? "SUCCESS" : "ERROR",
});
JObject jresp = CallWxpayFaceEx(jreq);
if (jresp == null || (string)jresp["return_code"] != "SUCCESS")
{
_WriteLog("Update PayResult Fail: " + (jresp != null ? jresp.ToString() : "null"));
return false;
}
_WriteLog("Update PayResult Success: " + jresp.ToString());
return true;
}
您好,您的问题建议您前往微信支付APIV3文档, 点击右下角‘技术咨询’实时寻求技术帮助。若您的问题得到解决,请回社区晒出解决方案,以帮助更多遇到此问题的人,感谢您的支持~