作者 魏强

转移支付

  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <title>微信支付</title>
  5 + <meta charset="utf-8" />
  6 + <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no" />
  7 + <link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/css/lanren.css">
  8 + <script type="text/javascript">
  9 + //调用微信JS api 支付
  10 + function jsApiCall()
  11 + {
  12 + WeixinJSBridge.invoke(
  13 + "getBrandWCPayRequest",
  14 + {$jsApiParameters},
  15 + function(res){
  16 + WeixinJSBridge.log(res.err_msg);
  17 + alert(res.err_code+res.err_desc+res.err_msg);
  18 + if (res.err_msg=='get_brand_wcpay_request:cancel'){
  19 + //支付取消逻辑
  20 + }else if (res.err_msg=='get_brand_wcpay_request:ok'){
  21 + //支付成功逻辑
  22 + }else{
  23 + //支付失败逻辑
  24 + }
  25 + }
  26 + );
  27 + }
  28 + function callpay()
  29 + {
  30 + if (typeof WeixinJSBridge == "undefined"){
  31 + if( document.addEventListener ){
  32 + document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
  33 + }else if (document.attachEvent){
  34 + document.attachEvent('WeixinJSBridgeReady', jsApiCall);
  35 + document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
  36 + }
  37 + }else{
  38 + jsApiCall();
  39 + }
  40 + }
  41 + </script>
  42 +</head>
  43 +<body>
  44 +
  45 +<div class="wenx_xx">
  46 + <div class="mz">DEF0000000001</div>
  47 + <div class="wxzf_price">¥0.01</div>
  48 +</div>
  49 +<div class="skf_xinf">
  50 + <div class="all_w"> <span class="bt">收款方</span> <span class="fr">{$site_info.site_name}</span> </div>
  51 +</div>
  52 +<a onclick="callpay()" class="ljzf_but all_w">立即支付</a>
  53 +<script type="text/javascript">
  54 + callpay();
  55 +</script>
  56 +</body>
  57 +</html>
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <title>微信支付成功</title>
  5 + <meta charset="utf-8" />
  6 + <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no" />
  7 + <link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/css/lanren.css">
  8 +</head>
  9 +<body >
  10 +<div class="zfcg_box ">
  11 + <div class="all_w">
  12 + <img src="__TMPL__/public/assets/images/cg_03.jpg" > 支付成功 </div>
  13 +
  14 +</div>
  15 +<div class="cgzf_info">
  16 + <div class="wenx_xx">
  17 + <div class="mz">{$site_info.site_name|default='请定义商品名称'}</div>
  18 + <div class="wxzf_price">¥{$info.real_price|default='请定义商品金额'}</div>
  19 + </div>
  20 +
  21 + <div class="spxx_shop">
  22 + <div class=" mlr_pm">
  23 + <table width="100%" border="0" cellspacing="0" cellpadding="0">
  24 + <tr>
  25 + <td>交易时间</td>
  26 + <td align="right">{$info.pay_time|date='Y-m-d H:i:s',###}</td>
  27 + </tr>
  28 + <tr>
  29 + <td>商户单号</td>
  30 + <td align="right">{$info.order_sn|default='请定义商户单号'}</td>
  31 + </tr>
  32 + <tr>
  33 + <td>交易单号</td>
  34 + <td align="right">{$info.transaction_id|default='请定义交易单号'}</td>
  35 + </tr>
  36 + </table>
  37 + </div>
  38 + </div>
  39 +</div>
  40 +<div class="wzxfcgde_tb"><img src="__TMPL__/public/assets/images/cg_07.jpg" ></div>
  41 +</body>
  42 +</html>