当前位置:网站首页>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
边栏推荐
- Keysight has chosen what equipment to buy for you
- Openlayers 5.0 thermal diagram
- 浅谈c语言指针的强制转换
- OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
- 2022.04.23 (lc_763_divided into letter interval)
- 数据分析学习目录
- Class loading process of JVM
- C1000k TCP connection upper limit test 1
- Redis core technology and practice 1 - start with building a simple key value database simplekv
- Raspberry pie uses root operation, and the graphical interface uses its own file manager
猜你喜欢

First experience of using fluent canvas

OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!

OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!

SQL常用的命令

Application of DCT transform

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

2022.04.23(LC_763_划分字母区间)

RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`

Sword finger offer II 116 Number of provinces - spatial complexity O (n), time complexity O (n)

redis优化系列(三)解决主从配置后的常见问题
随机推荐
std::stoi stol stoul stoll stof stod
MySQL restores or rolls back data through binlog
【C语言进阶11——字符和字符串函数及其模拟实现(2))】
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
JVM的类加载过程
Strange problems in FrameLayout view hierarchy
Solve the problem of invalid listview Click
[报告] Microsoft :Application of deep learning methods in speech enhancement
Summary of several relationships of UML class diagram
SQL server requires to query the information of all employees with surname 'Wang'
C1000k TCP connection upper limit test 1
SSDB基础1
The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
The difference between ordinary inner class and static inner class
Sogou cell thesaurus analysis (only extract words and word frequency)
Openlayers 5.0 two centering methods
The platinum library cannot search the debug process records of some projection devices
js获取本机ip地址
An 8266 crash
SSDB基础2