Skip to content

Commit

Permalink
catch all exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
repl6669 committed Jan 18, 2024
1 parent 0b51649 commit d4535c7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Jobs/HandleWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Dystcz\LunarApi\Domain\Payments\PaymentAdapters\PaymentIntent;
use Dystcz\LunarApiStripeAdapter\Actions\AuthorizeStripePayment;
use Dystcz\LunarApiStripeAdapter\StripePaymentAdapter;
use Exception;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
Expand All @@ -17,9 +18,7 @@
use Illuminate\Support\Facades\Log;
use Lunar\Models\Cart;
use Stripe\Event;
use Stripe\Exception\SignatureVerificationException;
use Stripe\Webhook;
use UnexpectedValueException;

class HandleWebhook implements ShouldQueue
{
Expand Down Expand Up @@ -66,7 +65,7 @@ public function handle(): void
->with(['draftOrder', 'completedOrder'])
->where('meta->payment_intent', $paymentIntent->id)
->firstOrFail();
} catch (\Exception $e) {
} catch (Exception $e) {
$this->fail($e);
}

Expand Down Expand Up @@ -103,7 +102,7 @@ protected function constructEvent(): Event
$this->signature,
Config::get('services.stripe.webhooks.payment_intent'),
);
} catch (UnexpectedValueException|SignatureVerificationException $e) {
} catch (Exception $e) {
$this->fail($e);
}
}
Expand Down

0 comments on commit d4535c7

Please sign in to comment.