当前位置:网站首页>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
边栏推荐
猜你喜欢

MySQL restores or rolls back data through binlog

该买什么设备,Keysight 给你挑好了

On the forced conversion of C language pointer

【C语言进阶11——字符和字符串函数及其模拟实现(2))】

First experience of using fluent canvas

Audio signal processing and coding - 2.5.3 the discrete cosine transform
![[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born](/img/0a/ed4eab6589e1c072edc247463e889e.png)
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born

開關電源設計分享及電源設計技巧圖解

Use of fluent custom fonts and pictures

Reflection on the performance of some OpenGL operations in the past
随机推荐
openlayers 5.0 加载arcgis server 切片服务
mysql通过binlog恢复或回滚数据
Redis core technology and practice 1 - start with building a simple key value database simplekv
SQL of contention for system time plus time in ocrale database
@Analysis of conditional on Web Application
Wechat video extraction and receiving file path
2022.04.23(LC_763_划分字母区间)
数据分析学习目录
Some records used by VS2010
Sogou cell thesaurus analysis (only extract words and word frequency)
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
【玩转Lighthouse】腾讯云轻量服务器搭建全平台视频解析视频下载网站
PostgreSQL
openlayers 5.0 两种居中方式
First experience of using fluent canvas
SSDB基础2
Getting started with vcpkg
C1000k TCP connection upper limit test 1
[report] Microsoft: application of deep learning methods in speech enhancement
Gossip: on greed