diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php index 0deccd9..5273333 100644 --- a/app/Helpers/helpers.php +++ b/app/Helpers/helpers.php @@ -472,8 +472,7 @@ function syncWithBankSystem( return (string) $res->getBody(); } catch (Exception $e) { - Log::error($e); - + info([$e->getMessage(), $e->getTraceAsString()]); return null; } } diff --git a/app/Nova/Actions/Sber/SyncWithSystem.php b/app/Nova/Actions/Sber/SyncWithSystem.php index 6e0c009..ba6174c 100644 --- a/app/Nova/Actions/Sber/SyncWithSystem.php +++ b/app/Nova/Actions/Sber/SyncWithSystem.php @@ -65,6 +65,13 @@ class SyncWithSystem extends Action pay_purpose: $orderItem->created_at->translatedFormat('F').' '.$orderItem->created_at->format('Y') ); + if ($systemRawResponse == null) { + return Action::modal('modal-response', [ + 'title' => 'SYSTEM API', + 'body' => 'Connection issue to SYSTEM', + ]); + } + $systemResponse = json_decode($systemRawResponse); $success = false; @@ -75,8 +82,6 @@ class SyncWithSystem extends Action $success = $systemResponse['errCode'] == 0; } - info(['s' => $systemResponse]); - $orderItem->update([ 'synced_with_system' => $success, ]);