plus.payment.getChannels(function(channels) {
console.log('getChannels callback');
console.log(JSON.stringify(channels));
...
...
}
在iPad mini上的输出信息:
11:34:23.063 getChannels callback
11:34:23.087 []
在iPhone和iPad上的输出信息:
12:50:26.332 getChannels callback
12:50:26.357 [{"id":"appleiap","description":"In-App Purchase","serviceReady":true}]
function requestOrder(ids){
plus.nativeUI.showWaiting(window.codeMsg('check_pay_env'));
console.log('4')
iapChannel.requestOrder(ids,function(e){
plus.nativeUI.closeWaiting();
console.log('requestOrder success: '+JSON.stringify(e));
iappay(ids[0]);
},function(e){
console.log('requestOrder failed: '+JSON.stringify(e));
plus.nativeUI.closeWaiting();
plus.nativeUI.alert(window.codeMsg('warning_pay_failed') + ":"+JSON.stringify(e), null, window.codeMsg('warning_pay_failed'));
});
console.log('5')
}
执行以上代码时,在iPad上进入失败回调函数;在iPhone上成功。