起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1316|回复: 1

[处理中3] 微信支付(generatePrepayId))失败

[复制链接]

3

主题

8

帖子

14

积分

新手上路

Rank: 1

积分
14
QQ
发表于 2017-10-23 10:16:12 | 显示全部楼层 |阅读模式
weixin.generatePrepayId({
                                "body" : self.data.productName,
                                "feeType" : "1",// 1是人民币
                                "notifyUrl" : notifyUrl,
                                "totalFee" : Math.round(parseFloat(totalMoney).toFixed(2) * 100),// 总金额,以分为单位,所以要乘以100
                                "traceId" : traceID,
                                "tradeNo" : self.orderId
                        }, function(prepayId) {
                                justep.Util.hint("220:" + prepayId);
                                weixin.sendPayReq(prepayId, function(message) {
                                        var responseCode = parseInt(message);
                                        if (responseCode === 0) {
                                                justep.Util.hint("微信支付完成!");
                                                sendData = {
                                                        ok : true,
                                                        msg : "",
                                                        orderId : -1
                                                };
                                                self.comp("windowReceiver1").windowEnsure(sendData);// 关闭当前窗口
                                        } else if (!isNaN(responseCode)) {
                                                justep.Util.hint("微信返回错误码:" + responseCode);
                                        } else {
                                                justep.Util.hint("微信支付请求被拒绝");
                                        }
                                }, function(message) {
                                        justep.Util.hint("微信支付请求被拒绝");
                                });
                        }, function(message) {
                                justep.Util.hint("234:" + message);
//                                justep.Util.hint("微信生成预支付订单失败");
                        });

参数为:
Object {body: "aaa", feeType: "1", notifyUrl: "http://222.173.147.86:29280/baas/test/recharge/weixinNotify", totalFee: 2200, traceId: "201710230939268239"…}
body: "aaa"
feeType: "1"
notifyUrl: "http://222.173.147.86:29280/baas/test/recharge/weixinNotify"
totalFee: 2200
traceId: "201710230939268239"
tradeNo: "C7BAF90151000001BD65C4C01B10BE80"

为什么执行失败?报错“234:Fail”
发表于 2017-10-23 11:50:04 | 显示全部楼层
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-4-28 20:23 , Processed in 0.082190 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表