Giter Club home page Giter Club logo

Comments (8)

Matrix-X avatar Matrix-X commented on June 4, 2024

yes, u r right, I'll fix it asap.

Thank you for your code review

from powerwechat.

asd81738431 avatar asd81738431 commented on June 4, 2024

It's okay, I'm just curious why You wrote it this way. Your code has taught me a lot

from powerwechat.

Matrix-X avatar Matrix-X commented on June 4, 2024

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.

asd81738431 avatar asd81738431 commented on June 4, 2024

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.

Matrix-X avatar Matrix-X commented on June 4, 2024

I have reviewed the code again,

image image

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.

asd81738431 avatar asd81738431 commented on June 4, 2024

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.

Matrix-X avatar Matrix-X commented on June 4, 2024

How about join our Wechat group and let me show u the way to reply with response code 50x?

from powerwechat.

asd81738431 avatar asd81738431 commented on June 4, 2024

How do I join?

from powerwechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.