WeChat official account payment: calling and paying jsapi lacks the parameter timeStamp and other error solutions

Source: Internet
Author: User
: This article mainly introduces the pitfalls of public account payment: the call to pay for jsapi lacks the parameter timeStamp and other error solutions. if you are interested in the PHP Tutorial, please refer to it. I have been busy for a long time. when I get busy, I really feel like I am just a machine that makes money (it seems like I can make a lot of money, huh, huh). This is a little free time, I want to share with you the problems and solutions encountered during the development of public account payment some time ago. if these "hidden traps" are not enough, or problems may occur at critical moments, it's really a big deal.

The shopping mall activities of the Double 12 customers are gaining momentum, but some users frequently say that they cannot pay, and there are problems, as shown below:


At that time, the problem was very strange. I tested the problem multiple times. I had to solve the problem quickly and finally found a solution:

The reason is that a string variable in the program is incorrectly set to the numeric type. the solution is simple. you only need to add double quotation marks to it.

Open the WxPay. JsApiPay. php file.

Set $ jsapi-> SetTimeStamp ($ timeStamp );

Change to $ jsapi-> SetTimeStamp ("$ timeStamp ");

Another thing to note is that because public account payment requires webpage authorization to obtain user information, the page address for initiating payment cannot have parameters. Otherwise, the system will prompt that returnurl does not exist.

Well, this is my personal solution. we have a good solution. You are welcome to propose it and learn and make progress together. thank you!

The above introduces the pitfalls of public account payment: the call to pay jsapi lacks the parameter timeStamp and other error solutions, including some content, hope to be helpful to friends who are interested in PHP tutorials.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.