Fixes for subscriptions

This commit is contained in:
David Bomba 2021-06-04 08:16:18 +10:00
parent c800457a72
commit c77660495c
4 changed files with 13 additions and 7 deletions

View File

@ -36,6 +36,7 @@ use Symfony\Component\Console\Exception\CommandNotFoundException;
use Symfony\Component\Debug\Exception\FatalThrowableError; use Symfony\Component\Debug\Exception\FatalThrowableError;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Validation\ValidationException;
use Throwable; use Throwable;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
@ -50,6 +51,7 @@ class Handler extends ExceptionHandler
//Swift_TransportException::class, //Swift_TransportException::class,
MaxAttemptsExceededException::class, MaxAttemptsExceededException::class,
CommandNotFoundException::class, CommandNotFoundException::class,
ValidationException::class,
]; ];
/** /**

View File

@ -667,7 +667,10 @@ class SubscriptionService
$client->company, $client->company,
); );
return $response; if(is_array($body))
return $response;
else
return ['message' => 'There was a problem encountered with the webhook', 'status_code' => 500];
} }

View File

@ -40,14 +40,13 @@ trait SubscriptionHooker
RequestOptions::JSON => ['body' => $body], RequestOptions::ALLOW_REDIRECTS => false RequestOptions::JSON => ['body' => $body], RequestOptions::ALLOW_REDIRECTS => false
]); ]);
return array_merge($body, ['exception' => json_decode($response->getBody(),true), 'status_code' => $response->getStatusCode()]); return json_decode($response->getBody(),true));
} }
catch(\Exception $e) catch(\Exception $e)
{ {
//;
// dd($e); return ['message' => $e->getMessage(), 'status_code' => 500];
$body = array_merge($body, ['exception' => ['message' => $e->getMessage(), 'status_code' => 500]]);
return $body;
} }
} }

View File

@ -70,9 +70,11 @@
<p><b>{{ ctrans('texts.documents') }}:</b> {{ count($company->documents) }} </p> <p><b>{{ ctrans('texts.documents') }}:</b> {{ count($company->documents) }} </p>
@endif @endif
@if($check_data)
<p><b>Data Quality:</b></p> <p><b>Data Quality:</b></p>
<p> {!! $check_data !!} </p> <p> {!! $check_data !!} </p>
@endif
@if(!empty($errors) ) @if(!empty($errors) )
<p>{{ ctrans('texts.errors') }}:</p> <p>{{ ctrans('texts.errors') }}:</p>
<table> <table>