5 Commits

Author SHA1 Message Date
myron 62dd05780a Add payment_status guard to payment_intent.succeeded handler
Mirrors the checkout.session.completed case which checks
payment_status === paid before acting. Now checks data.status
=== succeeded on the PaymentIntent object, consistent with how
Stripe structures the event and defensive against any future
edge case where the event fires in a non-final state.
2026-06-03 06:13:22 +00:00
myron f8e9746340 Route webhook order emails through Email class for email_log visibility
Replaced local sendOrderConfirmationEmail() with emailService()->sendOrderConfirmation().
Order confirmations now log to email_log table and use the branded template
(orange header, full subtotal/tax/discount breakdown) instead of the minimal
brown-header version that was invisible to the admin Email Log.
2026-06-03 03:42:50 +00:00
myron 2550ec5695 Fix duplicate order confirmation email on Stripe Checkout
When using Stripe Checkout, both checkout.session.completed and
payment_intent.succeeded fire for the same payment. After the stripe.php
change propagated order_id into PI metadata, the PI handler also found
an order_id and sent a second confirmation email.

Fix: fetch the order first in payment_intent.succeeded and skip if
already confirmed. Also records stripe_payment_intent in this path
for direct PI flows that bypass checkout.session.completed.
2026-06-03 03:41:30 +00:00
myron e39df89a95 Fix webhook: add checkout.session.completed; propagate metadata to payment intent 2026-05-29 16:32:37 +00:00
myron 996ca0d621 Initial commit 2026-05-22 12:52:44 +00:00