예제 #1
0
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Wechat SDK</title>
</head>
<body ontouchstart="">

<h1>微信支付测试&nbsp;&nbsp;<a href="javascript:;" onclick="window.location.reload()">刷新</a></h1>
<h4>Github: <a href="http://github.com/thenbsp/Wechat">http://github.com/thenbsp/Wechat</a></h4>
<h4>WeixinJSBridge invoke 方式:</h4>
<button type="button" onclick="WXPayment()" style="font-size:16px;height:38px;">支付 ¥<?php 
echo $order->getParams('total_fee') / 100;
?>
 元</button>

<script>
var WXPayment = function() {

    if( typeof WeixinJSBridge === 'undefined' ) {
        alert('请在微信在打开页面!');
        return false;
    }

    WeixinJSBridge.invoke('getBrandWCPayRequest', <?php 
echo $config;
?>
, function(res){