This commit is contained in:
liu 2024-06-04 18:31:11 +08:00
parent 9475c815b2
commit 19cf43e8b6

View File

@ -40,6 +40,7 @@ class PaymentLogic extends BaseLogic
PayNotifyLogic::handle($from, $order['order_id']);
return ['pay_way' => PayEnum::BALANCE_PAY];
}
try {
switch ($payWay) {
case PayEnum::WECHAT_PAY:
$auth = UserAuth::where(['user_id' => $order['uid'], 'terminal' => $terminal])->findOrEmpty();
@ -56,19 +57,20 @@ class PaymentLogic extends BaseLogic
'attach' => $from
];
$wechat = new PayService(1);
try {
// 尝试执行可能会抛出异常的代码
$result = $wechat->wechat->mini($order)->toArray();
} catch (\Exception $e) {
\support\Log::info($e->getMessage());
throw new \Exception($e->getMessage());
}
break;
default:
self::$error = '订单异常';
$result = false;
}
} catch (\Exception $e) {
\support\Log::info($e->getMessage());
throw new \Exception($e->getMessage());
}
return $result;
}