当前位置:网站首页>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
边栏推荐
- SQL Server database in clause and exists clause conversion
- 高层次人才一站式服务平台开发 人才综合服务平台系统
- Tencent cloud GPU best practices - remote development training using jupyter pycharm
- Pdf reference learning notes
- Machine learning catalog
- An 8266 crash
- Disable Ctrl + Alt + Del
- Minesweeping II of souI instance
- Accessing private members using templates
- Codeworks round 783 (Div. 2) d problem solution
猜你喜欢
The difference between ordinary inner class and static inner class
Switching power supply design sharing and power supply design skills diagram
redis优化系列(三)解决主从配置后的常见问题
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
MySQL restores or rolls back data through binlog
Wechat applet part of the mobile phone Preview PDF did not respond
[record] typeerror: this getOptions is not a function
【C语言进阶11——字符和字符串函数及其模拟实现(2))】
Sword finger offer II 116 Number of provinces - spatial complexity O (n), time complexity O (n)
JVM的类加载过程
随机推荐
openlayers 5.0 热力图
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
binlog2sql 工具安装使用及问题汇总
Why is PostgreSQL about to surpass SQL Server?
SSDB基础2
机器学习目录
On the forced conversion of C language pointer
8266 obtain 18b20 temperature
Openlayers 5.0 two centering methods
Openlayers draw rectangle
Pdf reference learning notes
网络协议之:sctp流控制传输协议
The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
2021-2022-2 ACM集训队每周程序设计竞赛(8)题解
[transfer] summary of new features of js-es6 (one picture)
Sogou cell thesaurus analysis (only extract words and word frequency)
Customize the non slidable viewpage and how to use it
JS to get the local IP address
Steps to build a deep learning environment GPU
Problems caused by flutter initialroute and home