wesmiler 3 kuukautta sitten
vanhempi
commit
b43210a08d

+ 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));
                 return response('success');
             } else {
                 $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));
                 return message($msg ? $msg : 2635, false);
             }

+ 1 - 1
app/Services/PaymentService.php

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