微信支付成功后,回调接口重复调用的问题
发布于 4 年前 作者 tao61 17690 次浏览 来自 问答

我小程序调用统一支付接口成功了

设置的notify_url也有返回值

但是我处理完逻辑之后,给微信返回成功响应

为啥微信还会重复调用notify_url

代码:

 ResultNotify resultNotify = new ResultNotify(this);

string result = resultNotify.ProcessNotify();

FileStream fs = new FileStream(“E:\\WeChatResult\\Result.txt”,FileMode.Append);

byte[] bytes = Encoding.Unicode.GetBytes(result);

fs.Write(bytes,0,bytes.Length);

fs.Flush();

fs.Close();

string xmlRes = “<xml>” + “<return_code><![CDATA[SUCCESS]]></return_code>”

                            + “<return_msg><![CDATA[OK]]></return_msg>” + "</xml> ";

this.Response.ContentEncoding = Encoding.Unicode;

this.Response.ContentType = “text/xml”;

this.Response.Write(xmlRes);

this.Response.Flush();

this.Response.Close();

1 回复

建议检查下返回数据是否正确,是否是微信要的数据

回到顶部