当前位置:网站首页>Applet payment
Applet payment
2022-04-23 11:11:00 【Morning blown by Maple】
payment
uni.requestPayment Is a unified client payment of various platforms API, Whether it's in a small program or App in , All clients use this API Call payment . Ben API When operating at each end , It will be automatically converted to the native payment call at each end API.
uni.requestPayment( object ) Parameter description
provider Required , by String, Service provider , adopt uni.getProvider obtain
orderInfo Required , by String or Object, Order data
timeStamp Wechat applet is required , by String, The current timestamp
nonceStr Wechat applet is required , by String, Random string , The length is 32 Less than characters
package Wechat applet is required , by String, Unified order interface returns prepay_id Parameter values
signType Wechat applet is required , by String, Signature algorithm , It should be consistent with the value when placing an order in the background
paySign Wechat applet is required , by String, Signature
bannedChannels Not required , by Array<String>, Need hidden payment methods
success Not required , by Function, Interface call successful callback
fail Not required , by Function, Callback for interface call failure
complete Not required , by Function, The callback function at the end of the interface call ( Successful call 、 Failure will be carried out )
App Platform payment process
Payment platform function application =》 manifest.json
Configure payment parameters in =》 uni-app
Call inside API Make payment
App payment
uni.requestPayment({
provider: 'alipay',
orderInfo: 'orderInfo', // WeChat 、 Alipay order data 【 Pay attention to the order information of wechat , Key values should be all lowercase , Hump naming is not allowed 】
success: function (res) {
console.log('success:' + JSON.stringify(res));
},
fail: function (err) {
console.log('fail:' + JSON.stringify(err));
}
})
Wechat app payment
uni.requestPayment({
provider: 'wxpay',
timeStamp: String(Date.now()),
nonceStr: 'A1B2C3D4E5',
package: 'prepay_id=wx20180101abcdefg',
signType: 'MD5',
paySign: '',
success: function (res) {
console.log('success:' + JSON.stringify(res));
},
fail: function (err) {
console.log('fail:' + JSON.stringify(err));
}
})
版权声明
本文为[Morning blown by Maple]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231107040376.html
边栏推荐
- 软件测试人员,如何优秀的提Bug?
- VIM + ctags + cscope development environment construction guide
- MySQL8. 0 upgraded stepping on the pit Adventure
- Visual common drawing (I) stacking diagram
- Visualization Road (11) detailed explanation of Matplotlib color
- 进程间通信 -- 消息队列
- 采用百度飞桨EasyDL完成指定目标识别
- Usage Summary of datetime and timestamp in MySQL
- Learning go language 0x02: understanding slice
- Understand the key points of complement
猜你喜欢
Jupyter lab top ten high productivity plug-ins
Introduction to neo4j authoritative guide, recommended by Qiu Bojun, Zhou Hongxiang, Hu Xiaofeng, Zhou Tao and other celebrities
《Neo4j权威指南》简介,求伯君、周鸿袆、胡晓峰、周涛等大咖隆重推荐
STM32接电机驱动,杜邦线供电,然后反烧问题
redis优化系列(二)Redis主从原理、主从常用配置
Microsoft Access database using PHP PDO ODBC sample
Visual solutions to common problems (VIII) mathematical formulas
CUMCM 2021-B:乙醇偶合制备C4烯烃(2)
MySQL Router重装后重新连接集群进行引导出现的——此主机中之前已配置过的问题
C语言之结构体(进阶篇)
随机推荐
VIM usage
Mysql8.0安装指南
mysql插入datetime类型字段不加单引号插入不成功
MySQL分区表实现按月份归类
数据库管理软件SQLPro for SQLite for Mac 2022.30
MBA-day6 逻辑学-假言推理练习题
学习 Go 语言 0x02:对切片 Slice 的理解
Typora operation skill description (I) md
Cumcm 2021 - B: préparation d'oléfines C4 par couplage éthanol (2)
Explain in detail the pitfalls encountered in DTS due to the time zone problems of timestamp and datetime in MySQL
Chapter 1 of technical Xiaobai (express yourself)
Special members and magic methods
mysql分表之后如何平滑上线详解
Jupyter lab top ten high productivity plug-ins
期货开户哪个公司好?安全靠谱的期货公司谁能推荐几家?
Detailed explanation of MySQL creation stored procedure and function
MySQL面试题讲解之如何设置Hash索引
Promise details
Mba-day6 logic - hypothetical reasoning exercises
Learn go language 0x05: the exercise code of map in go language journey