Comments (8)
yes, u r right, I'll fix it asap.
Thank you for your code review
from powerwechat.
It's okay, I'm just curious why You wrote it this way. Your code has taught me a lot
from powerwechat.
I'v just reviewed the code from EasyWechat: https://github.com/w7corp/easywechat/blob/5.x/src/Payment/Notify/Handler.php
It seems like the return value of function "toResponse" will always be 200 as http response status.
If you are similar with the php code, pls try to read the code. and let me know I am right about this translation from php code.
Also pls paste the link described by Wechat , which specify the note "微信官方文档表示当成功时应该发送HTTP应答状态码200或204,无需返回应答报文,当错误的时候应该发送HTTP应答状态码5XX或4XX,同时需返回应答报文"
Thx again for this issue
from powerwechat.
In fact, I am also curious about why easywechat would write this way. After reading this code, I also think they did send 200 directly, and they updated the writing method in the v6 version. The official explanation I mentioned is here:
https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_5.shtml
from powerwechat.
I have reviewed the code again,
Through the response code is 200 from the callback func, but you can also rewrite the response code 50x replied to WeChat , according to the err is nil or not
As PowerWechat is translated from EasyWechat 5.x, and this version is more valuable for us to use. We'll not upgrade the version from EasyWechat 6.x in recent days, We are all in new projects PowerX + RobotChat which are open source.
PowerWechat 对我们来说,是对php的一个告别,也同时致敬一下EasyWechat 5.x.
from powerwechat.
So when the WeChat callback does not have an order number and there is an issue with the order, I replied that WeChat 200 has completed the processing. WeChat should not have sent another notification, right?
from powerwechat.
How about join our Wechat group and let me show u the way to reply with response code 50x?
from powerwechat.
How do I join?
from powerwechat.
Related Issues (20)
- 希望能关闭日志输出 HOT 1
- 微信支付配置优化。。。 HOT 1
- 微信小程序无法获取小程序码 HOT 2
- 无法获取小程序码 HOT 3
- 微信支付中主动查询结果对象和解析微信通知的结果对象中部分属性定义不一致问题 HOT 7
- ide无法正确识别嵌套方法 HOT 4
- V3版本发送消息用户收不到 HOT 1
- 类型错误 HOT 1
- 不支持商家转账批次回调通知吗? HOT 1
- 框架有自动更新平台证书吗? HOT 1
- Q: 程序启动后会默认创建 wechat 目录 HOT 1
- 微信API请求类型错误 HOT 2
- services.PaymentApp.Security.GetCertificates(c.Request.Context())方法有可能实现为不需要传c.Request.Context()的吗? HOT 1
- 微信支付v3 API列表(投诉查询及处理接口) HOT 2
- 小游戏虚拟支付功能可以接入吗 HOT 2
- 企微回调是必须的吗? HOT 1
- 接收微信服务器消息不支持json格式数据吗 HOT 1
- “获取应用的jsapi_ticket”这个接口,文档里写的需要参数access_token,为什么函数里不传这个参数? HOT 5
- weComService.MiniProgram()报错 HOT 1
- 似乎依赖版本有问题 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerwechat.