当前位置:网站首页>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
边栏推荐
- PlatoFarm推出正式版游戏经济模型的特点分析
- Typora operation skill description (I)
- Learn go language 0x05: the exercise code of map in go language journey
- Xdotool key Wizard
- Excel·VBA自定义函数获取单元格多数值
- JDBC – PreparedStatement – 如何设置 Null 值?
- 26. 删除有序数组中的重复项
- How to use JDBC callablestatement The wasnull () method is called to check whether the value of the last out parameter is SQL null
- 关于JUC三大常用辅助类
- 精彩回顾|「源」来如此 第六期 - 开源经济与产业投资
猜你喜欢
Mysql8.0安装指南
Introduction to neo4j authoritative guide, recommended by Qiu Bojun, Zhou Hongxiang, Hu Xiaofeng, Zhou Tao and other celebrities
Excel·VBA自定义函数获取单元格多数值
26. Delete duplicates in ordered array
redis优化系列(二)Redis主从原理、主从常用配置
进程间通信 -- 消息队列
VIM + ctags + cscope development environment construction guide
Visual solutions to common problems (VIII) mathematical formulas
Google Earth Engine(GEE)——将原始影像进行升尺度计算(以海南市为例)
数据库管理软件SQLPro for SQLite for Mac 2022.30
随机推荐
Analysis on the characteristics of the official game economic model launched by platoffarm
Xdotool key Wizard
Learning go language 0x02: understanding slice
期货开户哪个公司好?安全靠谱的期货公司谁能推荐几家?
Usage Summary of datetime and timestamp in MySQL
Using El popconfirm and El backtop does not take effect
学习 Go 语言 0x06:《Go 语言之旅》中 斐波纳契闭包 练习题代码
Prevent SQL injection in web projects
Let the LAN group use the remote device
An interesting interview question
Visual common drawing (IV) histogram
Detailed explanation of MySQL creation stored procedure and function
Excel · VBA custom function to obtain multiple cell values
Visual common drawing (V) scatter diagram
闹钟场景识别
JDBC – PreparedStatement – 如何设置 Null 值?
MySQL数据库10秒内插入百万条数据的实现
Pytorch implementation of transformer
MySQL sorting feature details
Learn go language 0x03: understand the dependency between variables and initialization order