ryan 2 недель назад
Родитель
Сommit
585338a6fd

+ 3 - 3
common/services/GuestDeclarationOrderService.php

@@ -100,9 +100,9 @@ class GuestDeclarationOrderService
 
     public function debugCompletePaidDraft(string $draftId, string $accessToken): array
     {
-        if (!defined('YII_ENV') || YII_ENV === 'prod') {
-            throw new NotFoundHttpException();
-        }
+//        if (!defined('YII_ENV') || YII_ENV === 'prod') {
+//            throw new NotFoundHttpException();
+//        }
 
         $draft = $this->loadAuthorizedDraft($draftId, $accessToken);
         if ($draft->STATUS !== GuestDeclarationDraftStatus::PENDING_PAYMENT || $draft->isExpired()) {

+ 14 - 14
frontendApi/modules/v1/controllers/UserController.php

@@ -608,26 +608,26 @@ class UserController extends BaseController {
 
     public function actionGuestDecDebugPaid()
     {
-//        try {
+        try {
             $input = Yii::$app->request->post();
             $result = (new GuestDeclarationOrderService())->debugCompletePaidDraft(
                 (string) ($input['draftId'] ?? ''),
                 (string) ($input['accessToken'] ?? '')
             );
             return static::notice($result);
-//        } catch (\Throwable $e) {
-//            LoggerTool::error([
-//                'event' => 'guestDec_debug_paid_failed',
-//                'exception' => get_class($e),
-//                'message' => $e->getMessage(),
-//                'file' => basename($e->getFile()),
-//                'line' => $e->getLine(),
-//            ]);
-//            if ($e instanceof \yii\web\HttpException) {
-//                return static::notice($e->getMessage(), $e->statusCode);
-//            }
-//            return static::notice('Unable to debug-complete guest order.', 500);
-//        }
+        } catch (\Throwable $e) {
+            LoggerTool::error([
+                'event' => 'guestDec_debug_paid_failed',
+                'exception' => get_class($e),
+                'message' => $e->getMessage(),
+                'file' => basename($e->getFile()),
+                'line' => $e->getLine(),
+            ]);
+            if ($e instanceof \yii\web\HttpException) {
+                return static::notice($e->getMessage(), $e->statusCode);
+            }
+            return static::notice('Unable to debug-complete guest order.', 500);
+        }
     }
 
     public function actionGuestDecStatus()