You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.4 KiB
PHTML

<?php
require_once "lib/WxPay.Api.php";
require_once "WxPay.NativePay.php";
defined('BASEPATH') OR exit('No direct script access allowed');
class Wxpay_native
{
protected $ci;
public function __construct()
{
$this->ci =& get_instance();
}
//模式二
/**
* 流程:
* 1、调用统一下单取得code_url生成二维码
* 2、用户扫描二维码进行支付
* 3、支付完成之后微信服务器会通知支付成功
* 4、在支付成功通知中需要查单确认是否真正支付成功notify.php
*/
public function qrcode_url()
{
$input = new WxPayUnifiedOrder();
$input->SetBody("test");
$input->SetAttach("test");
$input->SetOut_trade_no("sdkphp123456789".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/notify.php");
$input->SetTrade_type("NATIVE");
$input->SetProduct_id("123456789");
$result = $notify->GetPayUrl($input);
$url2 = $result["code_url"];
}
}
/* End of file Wxpay_native.php */
/* Location: ./CHT/third_party/pay/libraries/wxpay/Wxpay_native.php */