当前位置:网站首页>微信支付WxPayPubHelper v3版 回调xml为空的原因
微信支付WxPayPubHelper v3版 回调xml为空的原因
2022-06-30 22:35:00 【viqecel】
查找到发现,原因是服务器升级到php7版本后,比如微信支付回调中有这一段代码,其中 x m l = xml = xml=GLOBALS[‘HTTP_RAW_POST_DATA’];//在PHP7 中.这个写法已禁用.修改为file_get_contents(‘php://input’);即可
include_once("./log_.php");
include_once("../WxPayPubHelper/WxPayPubHelper.php");
//使用通用通知接口
$notify = new Notify_pub();
//存储微信的回调
$xml = file_get_contents('php://input'); //改为这个正常了
//$xml =$GLOBALS['HTTP_RAW_POST_DATA'];//在PHP7 中.这个写法已禁用
$notify->saveData($xml);
//验证签名,并回应微信。
//对后台通知交互时,如果微信收到商户的应答不是成功或超时,微信认为通知失败,
//微信会通过一定的策略(如30分钟共8次)定期重新发起通知,
//尽可能提高通知的成功率,但微信不保证通知最终能成功。
if($notify->checkSign() == FALSE){
$notify->setReturnParameter("return_code","FAIL");//返回状态码
$notify->setReturnParameter("return_msg","签名失败");//返回信息
}else{
$notify->setReturnParameter("return_code","SUCCESS");//设置返回码
$oid=$notify->data["out_trade_no"];
//这里写更新数据库订单状态的代码
边栏推荐
- Esp8266 becomes client and server
- 多線程經典案例
- 在线客服系统代码_h5客服_对接公众号_支持APP_支持多语言
- Redis' transaction and locking mechanism
- I want to know who I need to know to open a stock account? In addition, is it safe to open a mobile account?
- 对于产业互联网的粗浅认识,最终将产业互联网的发展带入到了消费互联网的怪圈之中
- Golang application ━ installation, configuration and use of Hugo blog system
- 腾讯3年,功能测试进阶自动化测试,送给在手工测试中迷茫的你
- The sandbox is being deployed on the polygon network
- [Android, kotlin, tflite] mobile device integration depth learning light model tflite (image classification)
猜你喜欢
Anfulai embedded weekly report no. 271: June 20, 2022 to June 26, 2022
latex左侧大括号 latex中大括号多行公式
Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing
What is the experience of pairing with AI? Pilot vs alphacode, Codex, gpt-3
JVM Part 21 of interview with big companies Q & A
Label Contrastive Coding based Graph Neural Network for Graph Classification
Introduction to machine learning compilation course learning notes lesson 2 tensor program abstraction
In depth analysis of Apache bookkeeper series: Part 4 - back pressure
How to realize the center progress bar in wechat applet
During telecommuting, the project team punched in the wechat group | solicited papers from the community
随机推荐
Swift 5.0 - creation and use of swift framework
Online customer service system code_ H5 customer service_ Docking with official account_ Support app_ Support for multiple languages
The Sandbox 正在 Polygon 网络上进行部署
Is it difficult to get a certified equipment supervisor? What is the relationship with the supervising engineer?
Two way data binding in wechat applet
Introduction to machine learning compilation course learning notes lesson 2 tensor program abstraction
Tencent has been conducting advanced automated functional testing for 3 years. It is a gift to you who are confused in manual testing
将Nagios监控信息存入MySQL
Anfulai embedded weekly report no. 271: June 20, 2022 to June 26, 2022
多线程经典案例
What is flush software? In addition, is it safe to open an account online now?
How to change the win11 computer name? Win11 method of changing computer name
Redis的缓存穿透、缓存击穿和缓存雪崩
Graduation project
Technical principle of decentralized exchange system development - digital currency decentralized exchange system development (illustrative case)
What are database OLAP and OLTP? Same and different? Applicable scenarios
零样本和少样本学习
多線程經典案例
MIT博士论文 | 优化理论与机器学习实践
Doker's container data volume