支付通道:支付寶 、微信 、掃碼 、動(dòng)態(tài)碼、小程序支付、API代付、分賬
扣扣:963194679
php調(diào)起微信jsapi接口:
<script type="text/javascript">
//調(diào)用微信JS api 支付
function jsApiCall()
{
? ? WeixinJSBridge.invoke(
? ? ? ? 'getBrandWCPayRequest',
? ? ? ? {$jsonArray['response']['body']['PayInfo']},
? ? ? ? function(res){
? ? ? ? ? ? if(res.err_msg == "get_brand_wcpay_request:ok" ){
? ? ? ? ? ? ? ? window.location.replace('{$completeUrl}');
? ? ? ? ? ? }
? ? ? ? ? ? //WeixinJSBridge.log(res.err_msg);
? ? ? ? ? ? //alert(res.err_msg);
? ? ? ? ? ? //WeixinJSBridge.call('closeWindow');
? ? ? ? }
? ? );
}
function callpay()
{
? ? if (typeof WeixinJSBridge == "undefined"){
? ? ? ? if( document.addEventListener ){
? ? ? ? ? ? document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
? ? ? ? }else if (document.attachEvent){
? ? ? ? ? ? document.attachEvent('WeixinJSBridgeReady', jsApiCall);
? ? ? ? ? ? document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
? ? ? ? }
? ? }else{
? ? ? ? jsApiCall();
? ? }
}
callpay();
</script>