初始化代码
This commit is contained in:
56
weixinpay/example/WxPay.NativePay.php
Normal file
56
weixinpay/example/WxPay.NativePay.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
require_once "../lib/WxPay.Api.php";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
*
|
||||
|
||||
* 刷卡支付实现类
|
||||
|
||||
* @author widyhu
|
||||
|
||||
*
|
||||
|
||||
*/
|
||||
|
||||
class NativePay
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
*
|
||||
|
||||
* 生成扫描支付URL,模式一
|
||||
|
||||
* @param BizPayUrlInput $bizUrlInfo
|
||||
|
||||
*/
|
||||
|
||||
public function GetPrePayUrl($productId)
|
||||
|
||||
{
|
||||
|
||||
$biz = new WxPayBizPayUrl();
|
||||
|
||||
$biz->SetProduct_id($productId);
|
||||
|
||||
$values = WxpayApi::bizpayurl($biz);
|
||||
|
||||
$url = "weixin://wxpay/bizpayurl?" . $this->ToUrlParams($values);
|
||||
|
||||
return $url;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
*
|
||||
|
||||
* 参数数组转换为url参数
|
||||
|
||||
Reference in New Issue
Block a user