diff --git a/WePayV3/Order.php b/WePayV3/Order.php index e22cb59..460c995 100644 --- a/WePayV3/Order.php +++ b/WePayV3/Order.php @@ -60,10 +60,10 @@ class Order extends BasicWePay $prepayId = $result['prepay_id']; $nonceStr = Tools::createNoncestr(); if ($type === 'app') { - $sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, $prepayId])); + $sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, $prepayId])."\n"); return ['partnerId' => $this->config['mch_id'], 'prepayId' => $prepayId, 'package' => 'Sign=WXPay', 'nonceStr' => $nonceStr, 'timeStamp' => $time, 'sign' => $sign]; } elseif ($type === 'jsapi') { - $sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, "prepay_id={$prepayId}"])); + $sign = $this->signBuild(join("\n", [$appid, $time, $nonceStr, "prepay_id={$prepayId}"])."\n"); return ['appId' => $appid, 'timeStamp' => $time, 'nonceStr' => $nonceStr, 'package' => "prepay_id={$prepayId}", 'signType' => 'RSA', 'paySign' => $sign]; } else { return $result; @@ -103,4 +103,4 @@ class Order extends BasicWePay return $data; } -} \ No newline at end of file +}