File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/PaymentGateways/Gateways/Stripe/Webhooks/Listeners Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ private function addSupportForLegacyActionHook(Event $event)
5555 }
5656
5757 /**
58+ * @unreleased add support for payment_intent_id
5859 * @since 2.21.0
5960 * @inerhitDoc
6061 */
@@ -63,6 +64,14 @@ protected function getDonation(Event $event)
6364 /* @var Charge $stripeCharge */
6465 $ stripeCharge = $ event ->data ->object ;
6566
66- return give (DonationRepository::class)->getByGatewayTransactionId ($ stripeCharge ->id );
67+ // First try to find by charge ID (legacy Stripe gateways store charge ID)
68+ $ donation = give (DonationRepository::class)->getByGatewayTransactionId ($ stripeCharge ->id );
69+
70+ // If not found, try payment_intent (StripePaymentElementGateway stores payment intent ID)
71+ if (!$ donation && !empty ($ stripeCharge ->payment_intent )) {
72+ $ donation = give (DonationRepository::class)->getByGatewayTransactionId ($ stripeCharge ->payment_intent );
73+ }
74+
75+ return $ donation ;
6776 }
6877}
You can’t perform that action at this time.
0 commit comments