当前位置:网站首页>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 errorWechat 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
边栏推荐
- Summary of several relationships of UML class diagram
- Minesweeping II of souI instance
- static类变量快速入门
- An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
- SQL Server database in clause and exists clause conversion
- Screen right-click menu in souI
- MySQL restores or rolls back data through binlog
- ArcMap connecting ArcGIS Server
- Using 8266 as serial port debugging tool
- 2022.04.23 (lc_763_divided into letter interval)
猜你喜欢

2022.04.23(LC_763_划分字母区间)
![[报告] Microsoft :Application of deep learning methods in speech enhancement](/img/29/2d2addd826359fdb0920e06ebedd29.png)
[报告] Microsoft :Application of deep learning methods in speech enhancement

Android Development: the client obtains the latest value in the database in real time and displays it on the interface

Raspberry pie uses root operation, and the graphical interface uses its own file manager

Redis optimization series (III) solve common problems after master-slave configuration

I just want to leave a note for myself

Matlab 2019 installation of deep learning toolbox model for googlenet network

8266 obtain 18b20 temperature

Common SQL commands

2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
随机推荐
Problems caused by flutter initialroute and home
Why is PostgreSQL about to surpass SQL Server?
All table queries and comment description queries of SQL Server
SSDB基础2
openlayers 5.0 热力图
[record] typeerror: this getOptions is not a function
Codeforces Round #784 (Div. 4)
Keysight has chosen what equipment to buy for you
腾讯云GPU最佳实践-使用jupyter pycharm远程开发训练
Common SQL commands
Redis core technology and practice 1 - start with building a simple key value database simplekv
c1000k TCP 连接上限测试1
Circuit on-line simulation
MySQL practical skills
An 8266 crash
坐标转换WGS-84 转 GCJ-02 和 GCJ-02转WGS-84
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
为何PostgreSQL即将超越SQL Server?
JS calculation time difference
Summary of several relationships of UML class diagram