【支付】快手小程序 调起内置支付 uniapp

  1. 提交订单,后端返回 重要数据 包含 appid ,时间戳 一些 (把数据 JSON.parse处理一下)
  2. 调起内置支付

在这里插入图片描述
在这里插入图片描述

后端返回的数据格式 是string  先转换为 对象
orderString: "{"result":1,"error_msg":"success","order_info":{"order_no":"123032010886493080435","order_info_token":"ChJrc01wUGF5Lm9yZGVyVG9rZW4SUAN0H69V8zDxXRhbi4197tnTwpnqsL5CP5AW9o0G3awDas76smk8MbrpNsjfsKcdsnjOpgumRTSGNvyLP4jPYMJTxbSuRXziT8xzRZPGQEceGhJWpWd9TLPYWCbXad2vn_QSiXkiIC79ZTRuXo7hvdcBjt_-3vX1WGtbZ0JXv8_ztO_g6KOYKAUwAQ"}}"

调用内置支付 具体写法


// #ifdef MP-KUAISHOU
that.kspay(JSON.parse(res.orderString));
// #endif





kspay(orderString){
				let _this = this;
				ks.pay({
				    serviceId: '1',
				    orderInfo: orderString.order_info,
				    success:function success(res) {
				        uni.showToast({
				        	title: '支付成功',
				        	icon: 'none'
				        });
						_this.showPay = false;
				    },
				    fail:function fail(res) {
				        console.log(res)
						_this.showPay = false;
						uni.showToast({
							title: '支付失败',
							icon: 'none'
						})
				    },
				    complete:function complete(res) {
				        console.log(res)
				    }
				});
			},
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值