!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pingpp=e()}}(function(){return function e(n,t,a){function r(l,o){if(!t[l]){if(!n[l]){var c="function"==typeof require&&require;if(!o&&c)return c(l,!0);if(i)return i(l,!0);var s=new Error("Cannot find module '"+l+"'");throw s.code="MODULE_NOT_FOUND",s}var d=t[l]={exports:{}};n[l][0].call(d.exports,function(e){var t=n[l][1][e];return r(t||e)},d,d.exports,e,n,t,a)}return t[l].exports}for(var i="function"==typeof require&&require,l=0;l>16,r>>8&255,255&r));switch(n){case 1:r=i(e,a)<<18|i(e,a+1)<<12|i(e,a+2)<<6,o.push(String.fromCharCode(r>>16,r>>8&255));break;case 2:r=i(e,a)<<18|i(e,a+1)<<12,o.push(String.fromCharCode(r>>16))}return o.join('')},t.getbyte=function(e,n){var a=e.charCodeAt(n);if(a>255)throw t.makeDOMException();return a},t.encode=function(e){if(1!==arguments.length)throw new SyntaxError('Not enough arguments');var n,a,r=t.PADCHAR,i=t.ALPHA,l=t.getbyte,o=[],c=(e=''+e).length-e.length%3;if(0===e.length)return e;for(n=0;n>18)),o.push(i.charAt(a>>12&63)),o.push(i.charAt(a>>6&63)),o.push(i.charAt(63&a));switch(e.length-c){case 1:a=l(e,n)<<16,o.push(i.charAt(a>>18)+i.charAt(a>>12&63)+r+r);break;case 2:a=l(e,n)<<16|l(e,n+1)<<8,o.push(i.charAt(a>>18)+i.charAt(a>>12&63)+i.charAt(a>>6&63)+r)}return o.join('')},e.url='pay.htm',e.pay=function(n){var i=encodeURIComponent(t.encode(n));r.call(a,'APURL')&&(e.url=a.APURL),location.href=e.url+'?goto='+i},e.decode=function(e){return t.decode(decodeURIComponent(e))},n.exports=e}()},{"../../stash":27}],10:[function(e,n,t){var a=e('./commons/redirect_base');n.exports={handleCharge:function(e){a.handleCharge(e)}}},{"./commons/redirect_base":7}],11:[function(e,n,t){arguments[4][10][0].apply(t,arguments)},{"./commons/redirect_base":7,dup:10}],12:[function(e,n,t){var a=e('./commons/redirect_base'),r=e('../callbacks'),i=e('../utils'),l={}.hasOwnProperty;n.exports={handleCharge:function(e){var n=e.extra;if(l.call(n,'pay_channel')){var t=n.pay_channel;'wx'!==t||i.inWeixin()?'alipay'!==t||i.inAlipay()?a.handleCharge(e):r.innerCallback('fail',r.error('Not in the Alipay browser')):r.innerCallback('fail',r.error('Not in the WeChat browser'))}else r.innerCallback('fail',r.error('invalid_charge','charge 格式不正确'))}}},{"../callbacks":1,"../utils":29,"./commons/redirect_base":7}],13:[function(e,n,t){var a=e('../utils'),r={}.hasOwnProperty;n.exports={JDPAY_WAP_URL_OLD:'https://m.jdpay.com/wepay/web/pay',JDPAY_H5_URL:'https://h5pay.jd.com/jdpay/saveOrder',JDPAY_PC_URL:'https://wepay.jd.com/jdpay/saveOrder',handleCharge:function(e){var n=e.credential[e.channel],t=this.JDPAY_H5_URL;r.call(n,'channelUrl')?(t=n.channelUrl,delete n.channelUrl):r.call(n,'merchantRemark')&&(t=this.JDPAY_WAP_URL_OLD),a.formSubmit(t,'post',n)}}},{"../utils":29}],14:[function(e,n,t){var a=e('../callbacks'),r=e('../utils'),i=e('../stash'),l={}.hasOwnProperty;n.exports={SRC_URL:'https://open.mobile.qq.com/sdk/qqapi.js?_bid=152',ID:'mqq_api',handleCharge:function(e){var n=e.credential[e.channel];l.call(n,'token_id')?(i.tokenId=n.token_id,r.loadUrlJs(this.ID,this.SRC_URL,this.callpay)):a.innerCallback('fail',a.error('invalid_credential','missing_token_id'))},callpay:function(){if('undefined'!=typeof mqq){if(0==mqq.QQVersion)return a.innerCallback('fail',a.error('Not in the QQ client')),void delete i.tokenId;mqq.tenpay.pay({tokenId:i.tokenId},function(e){0==e.resultCode?a.innerCallback('success'):a.innerCallback('fail',a.error(e.retmsg))})}else a.innerCallback('fail',a.error('network_err'));delete i.tokenId}}},{"../callbacks":1,"../stash":27,"../utils":29}],15:[function(e,n,t){var a=e('../utils');n.exports={UPACP_PC_URL:'https://gateway.95516.com/gateway/api/frontTransReq.do',handleCharge:function(e){var n=e.credential[e.channel];a.formSubmit(this.UPACP_PC_URL,'post',n)}}},{"../utils":29}],16:[function(e,n,t){var a=e('../utils');n.exports={UPACP_WAP_URL:'https://gateway.95516.com/gateway/api/frontTransReq.do',handleCharge:function(e){var n=e.credential[e.channel];a.formSubmit(this.UPACP_WAP_URL,'post',n)}}},{"../utils":29}],17:[function(e,n,t){var a=e('../stash'),r=e('../callbacks'),i={}.hasOwnProperty;n.exports={handleCharge:function(e){for(var n=e.credential[e.channel],t=['appId','timeStamp','nonceStr','package','signType','paySign'],l=0;l=200&&n<400&&'success'==e)a.innerCallback('success');else{var t='http_code:'+n+';response:'+e;a.innerCallback('fail',a.error('testmode_notify_fail',t))}},function(){a.innerCallback('fail',a.error('network_err'))})}}}},{"../callbacks":1,"../mods":25,"../stash":27,"../utils":29}],19:[function(e,n,t){var a=e('../utils'),r=e('../callbacks'),i={}.hasOwnProperty;n.exports={handleCharge:function(e){var n=e.credential[e.channel];'string'==typeof n?a.redirectTo(n):'object'==typeof n&&i.call(n,'url')?a.redirectTo(n.url):r.innerCallback('fail',r.error('invalid_credential','credential 格式不正确'))}}},{"../callbacks":1,"../utils":29}],20:[function(e,n,t){var a=e('../utils'),r=e('../callbacks'),i={}.hasOwnProperty;n.exports={YEEPAY_WAP_URL:'https://ok.yeepay.com/paymobile/api/pay/request',YEEPAY_WAP_TEST_URL:'http://mobiletest.yeepay.com/paymobile/api/pay/request',handleCharge:function(e){for(var n=e.channel,t=e.credential[n],l=['merchantaccount','encryptkey','data'],o=0;o')}n.id='p_analyse_iframe',n.src=this.SRC_URL+'/?puid='+e,n.style.display='none',document.body.appendChild(n)}setTimeout(function(){i.send()},0)}}}},{"./collection":21,"./stash":27,"./utils":29}],23:[function(e,n,t){!function(){function e(e,n){var t=(65535&e)+(65535&n);return(e>>16)+(n>>16)+(t>>16)<<16|65535&t}function t(e,n){return e<>>32-n}function a(n,a,r,i,l,o){return e(t(e(e(a,n),e(i,o)),l),r)}function r(e,n,t,r,i,l,o){return a(n&t|~n&r,e,n,i,l,o)}function i(e,n,t,r,i,l,o){return a(n&r|t&~r,e,n,i,l,o)}function l(e,n,t,r,i,l,o){return a(n^t^r,e,n,i,l,o)}function o(e,n,t,r,i,l,o){return a(t^(n|~r),e,n,i,l,o)}function c(n,t){n[t>>5]|=128<>>9<<4)]=t;var a,c,s,d,u,p=1732584193,f=-271733879,h=-1732584194,_=271733878;for(a=0;a>5]>>>n%32&255);return t}function d(e){var n,t=[];for(t[(e.length>>2)-1]=void 0,n=0;n>5]|=(255&e.charCodeAt(n/8))<16&&(r=c(r,8*e.length)),t=0;t<16;t+=1)i[t]=909522486^r[t],l[t]=1549556828^r[t];return a=c(i.concat(d(n)),512+8*n.length),s(c(l.concat(a),640))}function f(e){var n,t,a='';for(t=0;t>>4&15)+"0123456789abcdef".charAt(15&n);return a}function h(e){return unescape(encodeURIComponent(e))}function _(e){return u(h(e))}function y(e){return f(_(e))}function m(e,n){return p(h(e),h(n))}function g(e,n){return f(m(e,n))}n.exports=function(e,n,t){return n?t?m(n,e):g(n,e):t?_(e):y(e)}}()},{}],24:[function(e,n,t){var a=e('./version').v,r=e('./testmode'),i=e('./callbacks'),l=e('./mods'),o=e('./stash'),c=e('./collection'),s=e('./payment_elements'),d={}.hasOwnProperty,PingppSDK=function(){e('./init').init()};PingppSDK.prototype={version:a,createPayment:function(e,n,t,a){if('function'==typeof n&&(i.userCallback=n),s.init(e),d.call(s,'id'))if(d.call(s,'channel')){d.call(s,'app')&&('string'==typeof s.app?o.app_id=s.app:'object'==typeof s.app&&'string'==typeof s.app.id&&(o.app_id=s.app.id)),c.report({type:'pure_sdk_click',channel:s.channel,ch_id:s.id});var u=s.channel;if(d.call(s,'credential'))if(s.credential)if(d.call(s.credential,u))if(d.call(s,'livemode')){var p=l.getChannelModule(u);if(void 0===p)return console.error('channel module "'+u+'" is undefined'),void i.innerCallback('fail',i.error('invalid_channel','channel module "'+u+'" is undefined'));!1!==s.livemode?(void 0!==t&&(o.signature=t),'boolean'==typeof a&&(o.debug=a),p.handleCharge(s)):d.call(p,'runTestMode')?p.runTestMode(s):r.runTestMode(s)}else i.innerCallback('fail',i.error('invalid_charge','no_livemode_field'));else i.innerCallback('fail',i.error('invalid_credential','credential_is_incorrect'));else i.innerCallback('fail',i.error('invalid_credential','credential_is_undefined'));else i.innerCallback('fail',i.error('invalid_charge','no_credential'))}else i.innerCallback('fail',i.error('invalid_charge','no_channel'));else i.innerCallback('fail',i.error('invalid_charge','no_charge_id'))},setAPURL:function(e){o.APURL=e}},n.exports=new PingppSDK},{"./callbacks":1,"./collection":21,"./init":22,"./mods":25,"./payment_elements":26,"./stash":27,"./testmode":28,"./version":30}],25:[function(e,n,t){var a={}.hasOwnProperty,r={};n.exports=r,r.channels={alipay_pc_direct:e('./channels/alipay_pc_direct'),alipay_qr:e('./channels/alipay_qr'),alipay_wap:e('./channels/alipay_wap'),bfb_wap:e('./channels/bfb_wap'),cmb_wallet:e('./channels/cmb_wallet'),cp_b2b:e('./channels/cp_b2b'),fqlpay_qr:e('./channels/fqlpay_qr'),fqlpay_wap:e('./channels/fqlpay_wap'),isv_wap:e('./channels/isv_wap'),jdpay_wap:e('./channels/jdpay_wap'),qpay_pub:e('./channels/qpay_pub'),upacp_pc:e('./channels/upacp_pc'),upacp_wap:e('./channels/upacp_wap'),wx_lite:e('./channels/wx_lite'),wx_pub:e('./channels/wx_pub'),wx_wap:e('./channels/wx_wap'),yeepay_wap:e('./channels/yeepay_wap')},r.extras={ap:e('./channels/extras/ap')},r.getChannelModule=function(e){if(a.call(r.channels,e))return r.channels[e]},r.getExtraModule=function(e){if(a.call(r.extras,e))return r.extras[e]}},{"./channels/alipay_pc_direct":2,"./channels/alipay_qr":3,"./channels/alipay_wap":4,"./channels/bfb_wap":5,"./channels/cmb_wallet":6,"./channels/cp_b2b":8,"./channels/extras/ap":9,"./channels/fqlpay_qr":10,"./channels/fqlpay_wap":11,"./channels/isv_wap":12,"./channels/jdpay_wap":13,"./channels/qpay_pub":14,"./channels/upacp_pc":15,"./channels/upacp_wap":16,"./channels/wx_lite":17,"./channels/wx_pub":18,"./channels/wx_wap":19,"./channels/yeepay_wap":20}],26:[function(e,n,t){var a=e('./callbacks'),r={}.hasOwnProperty;n.exports={id:null,or_id:null,channel:null,app:null,credential:{},extra:null,livemode:null,order_no:null,time_expire:null,init:function(e){var n;if('string'==typeof e)try{n=JSON.parse(e)}catch(e){return void a.innerCallback('fail',a.error('json_decode_fail',e))}else n=e;{if(void 0!==n){if(r.call(n,'object')&&'order'==n.object){n.or_id=n.id,n.order_no=n.merchant_order_no;var t=n.charge_essentials;if(n.channel=t.channel,n.credential=t.credential,n.extra=t.extra,r.call(n,'charge')&&null!=n.charge)n.id=n.charge;else if(r.call(t,'id')&&null!=t.id)n.id=t.id;else if(r.call(n,'charges'))for(var i=0;i