wesmiler преди 3 месеца
родител
ревизия
b43210a08d
променени са 2 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 3 3
      app/Http/Controllers/Api/v1/NotifyController.php
  2. 1 1
      app/Services/PaymentService.php

+ 3 - 3
app/Http/Controllers/Api/v1/NotifyController.php

@@ -106,13 +106,13 @@ class NotifyController extends webApp
             }
             }
 
 
             // 回调处理
             // 回调处理
-            if (PaymentService::make()->catchPayNotify($productId, $data)) {
-                RedisService::set("caches:payments:payNotify_{$productId}:success_" . $key, ['msg'=>PaymentService::make()->getError(),'all' => request()->all(), 'product_id' => $productId, 'result' => $result], 7200);
+            if ($result = PaymentService::make()->catchPayNotify($productId, $data)) {
+                RedisService::set("caches:payments:payNotify_{$productId}:success_" . $key, ['msg'=>PaymentService::make()->getError(),'all' => request()->all(), 'product_id' => $productId, 'data' => $data,'result'=>$result], 7200);
                 logger()->channel($channel)->info("【{$date} 支付回调】回调成功:" . json_encode(['data' => $data,'product_id' => $productId],256));
                 logger()->channel($channel)->info("【{$date} 支付回调】回调成功:" . json_encode(['data' => $data,'product_id' => $productId],256));
                 return response('success');
                 return response('success');
             } else {
             } else {
                 $msg = PaymentService::make()->getError();
                 $msg = PaymentService::make()->getError();
-                RedisService::set("caches:payments:payNotify_{$productId}:failed_" . $key, ['msg'=>$msg,'all' => request()->all(), 'product_id' => $productId, 'result' => $result], 7200);
+                RedisService::set("caches:payments:payNotify_{$productId}:failed_" . $key, ['msg'=>$msg,'all' => request()->all(), 'product_id' => $productId, 'data' => $data], 7200);
                 logger()->channel($channel)->info("【{$date} 支付回调】回调失败:" . json_encode(['data' => $data,'product_id' => $productId, 'error' => lang($msg)], 256));
                 logger()->channel($channel)->info("【{$date} 支付回调】回调失败:" . json_encode(['data' => $data,'product_id' => $productId, 'error' => lang($msg)], 256));
                 return message($msg ? $msg : 2635, false);
                 return message($msg ? $msg : 2635, false);
             }
             }

+ 1 - 1
app/Services/PaymentService.php

@@ -717,7 +717,7 @@ class PaymentService extends BaseService
 
 
         DB::commit();
         DB::commit();
         $this->error = '充值订单处理成功~';
         $this->error = '充值订单处理成功~';
-        return true;
+        return ['id'=>$orderId,'amount'=>$amount,'status'=>$status];
     }
     }
 
 
     /**
     /**