WeChat applet WeChat payment access development

Source: Internet
Author: User
This article mainly describes the pitfalls encountered during the development of small program access payment, which are divided into two major blocks: Encapsulation of small program end and background interface. The main content of this article is as follows: 1. backend interface encapsulation; 2. integration of small programs; 3. Summary of step-by-step attacks. This article mainly describes the pitfalls encountered during the development of small program access payment, which are divided into two major blocks: Encapsulation of small program end and background interface. The main content of this article is as follows:

1. backend interface encapsulation;

2. integration of small program terminals;

3. Summary.

I. backend interface encapsulation

Perform interface encapsulation based on ThinkPHP 5 as follows:

1. the official payment documents provide PHP script payment samples and download them;

2. the sample has encapsulated each class. we only need to add a namespace to create a directory wxpay under the extend directory of TP5 and copy the class in the sample to the directory, add the namespace;

III. Summary

1. the payment API of jssdk, the public account used by the mini-program Payment API, has an error in the parameter in the official documentation, that is, the "I" in the uploaded appid must be in uppercase, otherwise, a Parameter error is always prompted. I have been debugging on this for a long time and want to see some of my friends.

2. after the unified order interface is called, the results returned by the unified order cannot be directly returned to the applet, and the signature must be re-generated.

3. if you have any questions, please leave a message.

The above is the details of small program payment access development. For more information, see other related articles in the first PHP community!

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.