修正 Qrc 支付问题

This commit is contained in:
邹景立 2023-05-06 13:40:24 +08:00
parent 164c45e3a8
commit 15b1555d74

View File

@ -64,14 +64,13 @@ class Order extends BasicWePay
// 支付参数签名
$time = strval(time());
$appid = $this->config['appid'];
$prepayId = $result['prepay_id'];
$nonceStr = Tools::createNoncestr();
if ($type === 'app') {
$sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, $prepayId, '']));
return ['partnerId' => $this->config['mch_id'], 'prepayId' => $prepayId, 'package' => 'Sign=WXPay', 'nonceStr' => $nonceStr, 'timeStamp' => $time, 'sign' => $sign];
$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') {
$sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, "prepay_id={$prepayId}", '']));
return ['appId' => $appid, 'timeStamp' => $time, 'nonceStr' => $nonceStr, 'package' => "prepay_id={$prepayId}", 'signType' => 'RSA', 'paySign' => $sign];
$sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, "prepay_id={$result['prepay_id']}", '']));
return ['appId' => $appid, 'timeStamp' => $time, 'nonceStr' => $nonceStr, 'package' => "prepay_id={$result['prepay_id']}", 'signType' => 'RSA', 'paySign' => $sign];
} else {
return $result;
}