I believe everyone always makes mistakes in the payment process, and Shitou specially provides examples.
1. Set up the test directory
In the WeChat public platform settings, in the payment test state, set the test directory, add the tester's WeChat ID to the whitelist, and the directory of the page where the payment is initiated must accurately match the set one. Only by sending the payment link to the corresponding public account session window can the payment test be initiated normally. Note that the official directory must not be set the same as the test directory, otherwise payment errors will occur.
2. Set up a formal payment directory
Enter the modification column according to the order of the columns in the picture, check JSAPI web payment to enable this permission, and configure the payment authorization directory. This directory must be the exact directory of the page where the payment is initiated. Payment cannot be called normally under the subdirectory.
3. Web account
First log in to the management backend->Click Developer Center->Web account, and click Modify
If the web page account is not filled in, a redirect_uri parameter error will be reported
After the preparation work is done, then just upload the code that Shitou gave you
Thinkphp-way.rar (1.09 MB Download: 9 times)