h***@hotmail.com
h***@hotmail.com
  • 发布:2017-07-24 17:04
  • 更新:2021-09-15 17:17
  • 阅读:7852

iap调起支付返回 Payment_appleiap:返回订单信息失败,http://ask.dcloud.net.cn/article/282

分类:5+ SDK
IAP

复制http://ask.dcloud.net.cn/article/497的调起支付,itunes connect已添加app内购买项目,只是状态为“准备提交”,是在itunes connect申请证书并且打包测试的。
代码如下:
document.getElementById("btn_pay").addEventListener('tap',function() {
pay("balance_six");
});

    var iapChannel;  
        var IAPOrders = ['balance_six'];  

        mui.plusReady(function() {  
            // 获取支付通道  
            plus.payment.getChannels(function(channels){  
                for (var i in channels) {  
                     alert(channels[i].id);  
                    if (channels[i].id == 'appleiap') {  
                         alert(4);  
                        iapChannel = channels[i];  
                        iapChannel.requestOrder(IAPOrders, function(event) {  
                            for (var index in event) {  
                                var OrderItem = event[index];  
                                alert("Title:" + OrderItem.title + "Price:" + OrderItem.price + "Description:" + OrderItem.description + "ProductID:" + OrderItem.productid);  
                            }  
                        }, function(errormsg) {  

//这里报错
alert("获取支付通道失败:" + errormsg.message);
});
}
}
}, function(e) {
alert("获取支付通道失败:" + e.message);
});
})
function pay(id) {
plus.payment.request(iapChannel, {
"productid": id,
"username": "appusername",
"quantity": 1
}, function(result) {
alert(JSON.stringify(result));
}, function(e) {
plus.nativeUI.alert("更多错误信息请参考支付(Payment)规范文档:http://www.html5plus.org/#specification#/specification/Payment.html", null, "支付失败:" + e.code);
});
}

2017-07-24 17:04 负责人:无 分享
已邀请:
wanghui

wanghui - php开发工程师,会vue

你用的是什么环境的证书打的包?测试环境需要使用测试环境的签名文件打包

h***@hotmail.com

h***@hotmail.com (作者)

就用的App Store and Ad Hoc这种,和这个应该没关系吧,我调支付错误它怎么连错误码都没有的

wanghui

wanghui - php开发工程师,会vue

首先确认用的是ios development的签名,再确认下“协议、税务和银行业务”是否在苹果后台设置好了

m15325

m15325

楼主的这个问题最后有解决吗?

1***@qq.com

1***@qq.com

var order = {
“ productid”:'owl_silvercoin_60000',
“ username”:“ Test2”,
“ quantity”:“ 2”
};
console.log(“ channel == 11 =:” JSON.stringify(channel));
console.log(“ order =:” JSON.stringify(order));
plus.payment.request(channel,order,function(paymentResult){
console.log(“ result ===支付完成=====”“);
},function(err){
console.log(”获取支付失败: “ JSON.stringify(err));
})

我调用了plus.payment.request后,没有响应。不知那里弄错了?请大神回答下,谢谢

y***@live.cn

y***@live.cn

你的问题解决了吗???
我最近也遇到这个问题。

该问题目前已经被锁定, 无法添加新回复