|
|
@@ -7,6 +7,7 @@ use app\xyz\exception\ApiException;
|
|
|
use GuzzleHttp\Promise\PromiseInterface;
|
|
|
use SixShop\WechatPay\Config;
|
|
|
use WeChatPay\BuilderChainable;
|
|
|
+use function SixShop\Core\throw_logic_exception;
|
|
|
|
|
|
trait ApiTrait
|
|
|
{
|
|
|
@@ -25,7 +26,9 @@ trait ApiTrait
|
|
|
*/
|
|
|
private function wechatPay(string $openid, string $outTradeNo, int $total, string $description, int $expireTime)
|
|
|
{
|
|
|
-
|
|
|
+ if ($total <= 0) {
|
|
|
+ throw_logic_exception('不支持的支付金额');
|
|
|
+ }
|
|
|
// https://pay.weixin.qq.com/doc/v3/merchant/4012791856
|
|
|
// 【POST】/v3/pay/transactions/jsapi
|
|
|
return $this->handleAsyncRequest(function (
|