JAlpha
JAlpha
  • 发布:2015-04-30 09:31
  • 更新:2015-05-26 17:20
  • 阅读:3524

大侠,请教个问题?你们写的那个payment demo,微信支付后台是用的微信的JS API还是Native API?急!还有那个返回的order有什么要求?请尽量详细点。我们这老报-1错误。。。

分类:HTML5+

xhr.onreadystatechange=function(){
switch(xhr.readyState){
case 4:
w.close();w=null;
if(xhr.status==200){
outLine("----- 请求订单成功 -----");
outLine( xhr.responseText );
var order=xhr.responseText;
// if(id=='wxpay'){
// try{order = JSON.parse(order);}catch(e){
// outLine("----- 订单数据格式解析错误 -----");
// plus.nativeUI.alert("订单数据格式解析错误!",null,"捐赠");
// return;
// }
// }
alert("order:"+order);
alert("pays:"+JSON.stringify(pays[id]));
plus.payment.request(pays[id],order,function(result){
outLine("----- 支付成功 -----");
plus.nativeUI.alert("支付成功:感谢你的支持,我们会继续努力完善产品。",function(){
back();
},"捐赠");
},function(e){
outLine("----- 支付失败 -----");
outLine("["+e.code+"]:"+e.message);
plus.nativeUI.alert("更多错误信息请参考支付(Payment)规范文档:http://www.html5plus.org/#specification#/specification/Payment.html",null,"支付失败:"+e.code);
});
}else{
outLine("----- 请求订单失败 -----");
outLine( xhr.status );
plus.nativeUI.alert("获取订单信息失败!",null,"捐赠");
}
break;
default:
break;
}

2015-04-30 09:31 负责人:无 分享
已邀请:
mitoriko

mitoriko

都不是,这个需要微信开放平台申请移动应用,然后用开放平台那套appid什么的,万恶的微信啊,折腾死人不偿命

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