From 15b1555d74f4139103069ef2b4320617b74cc783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sat, 6 May 2023 13:40:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20Qrc=20=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WePayV3/Order.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/WePayV3/Order.php b/WePayV3/Order.php index 489f386..0ad4284 100644 --- a/WePayV3/Order.php +++ b/WePayV3/Order.php @@ -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; }