IA-973 : `feat: Invoice paid email on payment success, customer.created/updated handling`
MR Description
Summary
Three improvements to the Stripe webhook service: outbound invoice paid email notification after successful payment, parent-to-customer linking on customer.created / customer.updated events, and a dev-mode fallback when Stripe signature verification fails.
Changes
Invoice Paid Email Notification
-
processInvoicePaymentSucceeded()now callsNotificationServiceClient.sendInvoicePaidNotification()at the end of successful processing - Builds
InvoicePaidNotificationRequestDTOwith period dates, plan name, and card last 4 digits from the charge object - Zero-amount (trial) invoices early-return to avoid duplicate/unnecessary processing
- Added
NotificationServiceClient— posts toPOST /api/user-management/notifications/invoice-paidviaRestTemplate - Added
InvoicePaidNotificationRequestDTOrecord Customer Linking - Added
processCustomerCreated()andprocessCustomerUpdated()handlers — both readparentUuidfrom Stripe customer metadata and callParentServiceClient.updateGatewayCustomerId() -
processCheckoutSessionCompleted()also links parent to Stripe customer via session metadata - Added
customer.createdandcustomer.updatedto the webhook event router switch - Added both methods to
StripeWebhookServiceinterface - Added
ParentServiceClientwith:updateGatewayCustomerId(parentUuid, stripeCustomerId)getParentEmailByGatewayCustomerId(gatewayCustomerId)