File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
backend/app/Services/Domain/Payment/Stripe/EventHandlers Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 2323use HiEvents \Services \Domain \Payment \Stripe \StripeRefundExpiredOrderService ;
2424use HiEvents \Services \Domain \Product \ProductQuantityUpdateService ;
2525use Illuminate \Database \DatabaseManager ;
26+ use Psr \Log \LoggerInterface ;
2627use Stripe \Exception \ApiErrorException ;
2728use Stripe \PaymentIntent ;
2829use Throwable ;
@@ -36,6 +37,7 @@ public function __construct(
3637 private readonly StripeRefundExpiredOrderService $ refundExpiredOrderService ,
3738 private readonly AttendeeRepositoryInterface $ attendeeRepository ,
3839 private readonly DatabaseManager $ databaseManager ,
40+ private readonly LoggerInterface $ logger ,
3941 )
4042 {
4143 }
@@ -53,6 +55,14 @@ public function handleEvent(PaymentIntent $paymentIntent): void
5355 StripePaymentDomainObjectAbstract::PAYMENT_INTENT_ID => $ paymentIntent ->id ,
5456 ]);
5557
58+ if (!$ stripePayment ) {
59+ $ this ->logger ->error ('Payment intent not found when handling payment intent succeeded event ' , [
60+ 'paymentIntent ' => $ paymentIntent ->toArray (),
61+ ]);
62+
63+ return ;
64+ }
65+
5666 $ this ->validatePaymentAndOrderStatus ($ stripePayment , $ paymentIntent );
5767
5868 $ this ->updateStripePaymentInfo ($ paymentIntent , $ stripePayment );
You can’t perform that action at this time.
0 commit comments