mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-11-07 04:02:14 +08:00
fix: 支付类型判定使用常量
This commit is contained in:
parent
7b291e343c
commit
c617666343
@ -763,10 +763,10 @@ class Ecommerce extends BasicWePay
|
||||
$time = strval(time());
|
||||
$appid = $this->config['appid'];
|
||||
$nonceStr = Tools::createNoncestr();
|
||||
if ($type === 'app') {
|
||||
if ($type === Order::WXPAY_APP) {
|
||||
$sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, $prepay_id, '']));
|
||||
return ['partnerId' => $this->config['mch_id'], 'prepayId' => $prepay_id, 'package' => 'Sign=WXPay', 'nonceStr' => $nonceStr, 'timeStamp' => $time, 'sign' => $sign];
|
||||
} elseif ($type === 'jsapi') {
|
||||
} elseif ($type === Order::WXPAY_JSAPI) {
|
||||
$sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, "prepay_id={$prepay_id}", '']));
|
||||
return ['appId' => $appid, 'timestamp' => $time, 'timeStamp' => $time, 'nonceStr' => $nonceStr, 'package' => "prepay_id={$prepay_id}", 'signType' => 'RSA', 'paySign' => $sign];
|
||||
} else {
|
||||
|
||||
@ -64,10 +64,10 @@ class Order extends BasicWePay
|
||||
$time = strval(time());
|
||||
$appid = $this->config['appid'];
|
||||
$nonceStr = Tools::createNoncestr();
|
||||
if ($type === 'app') {
|
||||
if ($type === self::WXPAY_APP) {
|
||||
$sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, $result['prepay_id'], '']));
|
||||
return ['partnerId' => $this->config['mch_id'], 'prepayId' => $result['prepay_id'], 'package' => 'Sign=WXPay', 'nonceStr' => $nonceStr, 'timeStamp' => $time, 'sign' => $sign];
|
||||
} elseif ($type === 'jsapi') {
|
||||
} elseif ($type === self::WXPAY_JSAPI) {
|
||||
$sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, "prepay_id={$result['prepay_id']}", '']));
|
||||
return ['appId' => $appid, 'timestamp' => $time, 'timeStamp' => $time, 'nonceStr' => $nonceStr, 'package' => "prepay_id={$result['prepay_id']}", 'signType' => 'RSA', 'paySign' => $sign];
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user