87,909
社区成员
发帖
与我相关
我的任务
分享
<xml>
<appid>xxxxxxxx</appid>
<body>apptest</body>
<device_info>1000</device_info>
<mch_id>xxxxxxx</mch_id>
<nonce_str>7dFmQ0IObIaERC8V7aoL7O9qHrqOpV4W</nonce_str>
<notify_url>http://wc.withdingdong.com/ddg-cn-front/wechat/callback.do</notify_url>
<openid>oL7ybwFlDw9vbMWsoxXDBONRh4Ds</openid>
<out_trade_no>20160905151323</out_trade_no>
<sign>3A73680E82103BB81B1685FE28CAB3B7</sign>
<spbill_create_ip>211.232.12.229</spbill_create_ip>
<total_fee>30</total_fee>
<trade_type>JSAPI</trade_type>
</xml>
<xml>
<return_code><![CDATA[SUCCESS]]></return_code>
<return_msg><![CDATA[OK]]></return_msg>
<appid><![CDATA[xxxxxxxx]]></appid>
<mch_id><![CDATA[xxxx]]></mch_id>
<device_info><![CDATA[1000]]></device_info>
<nonce_str><![CDATA[cX2K8DButlczNTRA]]></nonce_str>
<sign><![CDATA[61EA03C7097386D311CF0A1D1E5310BF]]></sign>
<result_code><![CDATA[SUCCESS]]></result_code>
<prepay_id><![CDATA[wx20160905141322c7b28eee5e0522173488]]></prepay_id>
<trade_type><![CDATA[JSAPI]]></trade_type>
</xml>
wx.config({
appId: 'xxxxxxx',
timestamp: '1473056003' ,
nonceStr: 'cX2K8DButlczNTRA',
signature: '61EA03C7097386D311CF0A1D1E5310BF',
jsApiList: ['chooseWXPay']
});
wx.ready(function(res){
wx.chooseWXPay({
timestamp: '1473056003',
nonceStr: 'cX2K8DButlczNTRA',
package: 'prepay_id=wx20160905141322c7b28eee5e0522173488',
signType: 'MD5',
paySign: '61EA03C7097386D311CF0A1D1E5310BF',
success: function (res) {
alert('success' + JSON.stringify(res));
},
cancel: function (res) {
alert('cancel' + JSON.stringify(res));
},
fail: function (res) {
alert('fail:' + JSON.stringify(res));
}
});
});
wx.error(function (res) {
alert("error:" + JSON.stringify(res));
});
wc.withdingdong.com/ddg-cn-front/wechat/detail.do