1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- ini_set('date.timezone','Asia/Shanghai');
- require_once "../lib/WxPay.Api.php";
- require_once "WxPay.NativePay.php";
- require_once 'log.php';
- $notify = new NativePay();
- $url1 = $notify->GetPrePayUrl("123456789");
- $input = new WxPayUnifiedOrder();
- $input->SetBody("test");
- $input->SetAttach("test");
- $input->SetOut_trade_no(WxPayConfig::MCHID.date("YmdHis"));
- $input->SetTotal_fee("1");
- $input->SetTime_start(date("YmdHis"));
- $input->SetTime_expire(date("YmdHis", time() + 600));
- $input->SetGoods_tag("test");
- $input->SetNotify_url("http://paysdk.weixin.qq.com/example/notify.php");
- $input->SetTrade_type("NATIVE");
- $input->SetProduct_id("123456789");
- $result = $notify->GetPayUrl($input);
- $url2 = $result["code_url"];
- ?>
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>微信支付样例-退款</title>
- </head>
- <body>
- <div style="margin-left: 10px;color:#556B2F;font-size:30px;font-weight: bolder;">扫描支付模式一</div><br/>
- <img alt="模式一扫码支付" src="http://paysdk.weixin.qq.com/example/qrcode.php?data=<?php echo urlencode($url1);?>" style="width:150px;height:150px;"/>
- <br/><br/><br/>
- <div style="margin-left: 10px;color:#556B2F;font-size:30px;font-weight: bolder;">扫描支付模式二</div><br/>
- <img alt="模式二扫码支付" src="http://paysdk.weixin.qq.com/example/qrcode.php?data=<?php echo urlencode($url2);?>" style="width:150px;height:150px;"/>
-
- </body>
- </html>
|