mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-04-05 19:41:44 +08:00
[更新]增加app支付参数获取
This commit is contained in:
parent
fbf73b5ca4
commit
365b012ec6
@ -55,6 +55,17 @@ class Pay extends BasicWePay
|
||||
return $pay->jsapiParams($prepay_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取APP支付参数
|
||||
* @param string $prepay_id 统一下单预支付码
|
||||
* @return array
|
||||
*/
|
||||
public function createParamsForApp($prepay_id)
|
||||
{
|
||||
$pay = new Order($this->config->get());
|
||||
return $pay->appParams($prepay_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付规则二维码
|
||||
* @param string $product_id 商户定义的商品id 或者订单号
|
||||
@ -65,7 +76,7 @@ class Pay extends BasicWePay
|
||||
$pay = new Order($this->config->get());
|
||||
return $pay->qrcParams($product_id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
* @param array $options
|
||||
|
@ -100,6 +100,25 @@ class Order extends BasicWePay
|
||||
return "weixin://wxpay/bizpayurl?" . http_build_query($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信App支付秘需参数
|
||||
* @param string $prepayId 统一下单预支付码
|
||||
* @return array
|
||||
*/
|
||||
public function appParams($prepayId)
|
||||
{
|
||||
$data = [
|
||||
'appid' => $this->config->get('appid'),
|
||||
'partnerid' => $this->config->get('mch_id'),
|
||||
'prepayid' => (string)$prepayId,
|
||||
'package' => 'Sign=WXPay',
|
||||
'time_stamp' => (string)time(),
|
||||
'nonce_str' => Tools::createNoncestr(),
|
||||
];
|
||||
$data['sign'] = $this->getPaySign($data, 'MD5');
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷卡支付 撤销订单
|
||||
* @param array $options
|
||||
|
Loading…
x
Reference in New Issue
Block a user