当前位置:网站首页>5 minutes to achieve wechat cloud applet payment function (including source code)
5 minutes to achieve wechat cloud applet payment function (including source code)
2022-04-23 19:19:00 【"Technology makes customers"】
1 First on the renderings

Fast implementation of payment function , How fast ? Yes Five whips So fast , Don't build your own server , Don't buy domain name , Don't file domain names , No need to support https. Just a simple cloud function , You can easily realize the payment function of wechat applet
2 preparation
1, Non personal applets , Personal apps don't pay ( Applet appid)
2, The merchant number that has applied for wechat payment ( Merchant id, Merchant secret key ).
3, Connect your merchant ID in the app ( The app is bound with the merchant number )
4, Wechat app opens cloud development
3 Open the door
(1) Initialize the cloud development environment
(2) Create cloud functions pay
(3) Introduce third-party payment dependency tenpay
pay Folder right-click Select open at terminal , Installation dependency npm i tenpay
After installation , our pay There will be one more cloud function package.json file
(4) Write cloud functions
(5) Simply write a page and call the cloud function
Abnormal problems
-
Error: errCode: -404011 cloud function execution error
Because it wasn't uploaded and deployed , Right click the cloud function to upload and deploy -
Signature error
Wechat payment signature error
Source code
Official account 《 Source code trust Mart 》 reply payment Access to the source code
Author related articles
Decompile to get any wechat applet source code —— Just read this one
How to get the promotion link of meituan hungry to make money
版权声明
本文为["Technology makes customers"]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210559120957.html
边栏推荐
- Screen right-click menu in souI
- 坐标转换WGS-84 转 GCJ-02 和 GCJ-02转WGS-84
- Android Development: the client obtains the latest value in the database in real time and displays it on the interface
- 数据分析学习目录
- Openlayers 5.0 thermal diagram
- JS calculation time difference
- openlayers draw矩形
- Redis optimization series (III) solve common problems after master-slave configuration
- Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
- C1000k TCP connection upper limit test
猜你喜欢
Prefer composition to inheritance
[记录]TypeError: this.getOptions is not a function
Raspberry pie 18b20 temperature
The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
Matlab 2019 installation of deep learning toolbox model for googlenet network
Some records used by VS2010
Android Development: the client obtains the latest value in the database in real time and displays it on the interface
Installation, use and problem summary of binlog2sql tool
Switching power supply design sharing and power supply design skills diagram
mysql通过binlog恢复或回滚数据
随机推荐
为何PostgreSQL即将超越SQL Server?
開關電源設計分享及電源設計技巧圖解
SSDB foundation 1
SQL of contention for system time plus time in ocrale database
Redis core technology and practice 1 - start with building a simple key value database simplekv
Openlayers draw rectangle
Circuit on-line simulation
开关电源设计分享及电源设计技巧图解
The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
Intuitive understanding of the essence of two-dimensional rotation
On the forced conversion of C language pointer
Codeforces Round #783 (Div. 2) D题解
8266 obtain 18b20 temperature
@Analysis of conditional on Web Application
binlog2sql 工具安装使用及问题汇总
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
NiO related Basics
An example of using JNI to directly access surface data
Modify the font size of hint in editext
Parsing headless jsonarray arrays