Browse Source

fix: 回调服务处理

super-yimizi 1 month ago
parent
commit
3a3525d273

+ 5 - 4
application/api/controller/Pay.php

@@ -35,15 +35,16 @@ class Pay extends Base
             $pay = \addons\epay\library\Service::checkNotify($paytype);
             if (!$pay) {
                 echo '签名错误';
+                \think\Log::write('签名错误', 'epay',);
                 return;
             }
             $data = $pay->verify();
-            try {
+            // try {
                 $payamount = $paytype == 'alipay' ? $data['total_amount'] : $data['total_fee'] / 100;
                 PayOperService::settle($data['out_trade_no'], $payamount, $paytype == 'alipay' ? $data['trade_no'] : $data['transaction_id']);
-            } catch (\Exception $e) {
-                \think\Log::write($e->getMessage(), 'epay');
-            }
+            // } catch (\Exception $e) {
+            //     \think\Log::write($e->getMessage(), 'epay');
+            // }
             echo $pay->success();
         }//  pc 支付
          elseif ($type == 'return') {

+ 2 - 2
application/common/Service/InspectionService.php

@@ -22,12 +22,12 @@ class InspectionService
     {
         // 检查用户是否可以申请
         if (!InspectionApplication::canApply($userId)) {
-            throw new Exception('您已有申请记录,请勿重复申请');
+            throw new BusinessException('您已有申请记录,请勿重复申请');
         }
 
         // 检查手机号是否已被使用
         if (InspectionApplication::isPhoneApplied($data['phone'])) {
-            throw new Exception('该手机号已被其他用户申请');
+            throw new BusinessException('该手机号已被其他用户申请');
         }
 
         // 补充数据