In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "how to develop the access function of WeChat Mini Programs and WeChat Pay". The editor shows you the operation process through an actual case, and the operation method is simple, fast and practical. I hope this article "how to develop the access function of WeChat Mini Programs and WeChat Pay" can help you solve the problem.
1. WeChat Pay's official document provides a sample of the PHP script WeChat Pay, which can be downloaded.
2. The sample has encapsulated each class, we just need to add a namespace, create a new directory wxpay under the extend directory of TP5, copy the classes in the sample to this directory, and then add a namespace
Results of sample modification
One of the most important classes is WxPayApi.php. After adding the namespace, the form is as follows, and the modifications of other classes are similar:
3. Introduce namespaces where needed, and new can be used with a single object. For example, a unified API for issuing orders:
Introduce the required classes first:
Encapsulate the external unified order issuing API, and directly return the parameters needed by Mini Program to call the payment API:
Similar to the repayment interface, it can be encapsulated through a unified order class.
II. Mini Program end integration
Mini Program is very simple. You only need to pass the data returned by the API to WeChat Pay's js interface.
The example returned by the API is as follows:
Examples of data returned by the integration API are as follows:
This is the end of the content about "how to develop the access function of WeChat Mini Programs and WeChat Pay". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.