当前位置:网站首页>微信支付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"];
//这里写更新数据库订单状态的代码
边栏推荐
- How to realize the center progress bar in wechat applet
- How to design test cases
- 总结的一些内存问题
- Redis' cache penetration, cache breakdown and cache avalanche
- ESP8266 成为客户端和服务器
- Niubi | the tools I have treasured for many years have made me free to fish with pay
- The superficial understanding of the industrial Internet finally brought the development of the industrial Internet into the strange circle of the consumer Internet
- 将Nagios监控信息存入MySQL
- KubeVela 1.4:让应用交付更安全、上手更简单、过程更透明
- Deployment of microservices based on kubernetes platform
猜你喜欢

latex中 & 号什么含义?

Ten of the most heart piercing tests / programmer jokes, read the vast crowd, how to find?

机器学习编译入门课程学习笔记第二讲 张量程序抽象

Analysis of PostgreSQL storage structure

实现多方数据安全共享,解决普惠金融信息不对称难题

ESP8266 成为客户端和服务器

Fastjson V2 简单使用手册

10 airbags are equipped as standard, and Chery arizer 8 has no dead corner for safety protection

Win11如何优化服务?Win11优化服务的方法

Deployment of microservices based on kubernetes platform
随机推荐
Using Obsidian with Hugo, markdown's local editing software is seamlessly connected with online
深入解析 Apache BookKeeper 系列:第四篇—背压
Strictly minor spanning tree
AtCoder Beginner Contest 257
Online customer service system code_ H5 customer service_ Docking with official account_ Support app_ Support for multiple languages
实现多方数据安全共享,解决普惠金融信息不对称难题
Neo4j load CSV configuration and use
Online education program user login and registration
软件测试报告包含哪些内容?如何获取高质量软件测试报告?
微信小程序通过点击事件传参(data-)
B_ QuRT_ User_ Guide(34)
电脑设备管理器在哪里可以找到
Anfulai embedded weekly report no. 271: June 20, 2022 to June 26, 2022
Web APIs comprehensive case -tab column switching - dark horse programmer
Smart streetlights | cloud computing lights up the "spark" of smart cities
与AI结对编程式是什么体验 Copilot vs AlphaCode, Codex, GPT-3
Apache server OpenSSL upgrade
Yolo target detection
The superficial understanding of the industrial Internet finally brought the development of the industrial Internet into the strange circle of the consumer Internet
Classic case of multithreading