Skip to content

IA-973 : `feat: Invoice paid email on payment success, customer.created/updated handling`

khadija.elbachouri a demandé de fusionner feature/IA-973 vers develop

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 calls NotificationServiceClient.sendInvoicePaidNotification() at the end of successful processing
  • Builds InvoicePaidNotificationRequestDTO with 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 to POST /api/user-management/notifications/invoice-paid via RestTemplate
  • Added InvoicePaidNotificationRequestDTO record Customer Linking
  • Added processCustomerCreated() and processCustomerUpdated() handlers — both read parentUuid from Stripe customer metadata and call ParentServiceClient.updateGatewayCustomerId()
  • processCheckoutSessionCompleted() also links parent to Stripe customer via session metadata
  • Added customer.created and customer.updated to the webhook event router switch
  • Added both methods to StripeWebhookService interface
  • Added ParentServiceClient with:
    • updateGatewayCustomerId(parentUuid, stripeCustomerId)
    • getParentEmailByGatewayCustomerId(gatewayCustomerId)

Rapports de requête de fusion