This commit is contained in:
Lizandro Guarnizo
2026-05-12 19:41:17 -05:00
parent 55c68b470b
commit 25e3cd6254
9 changed files with 270 additions and 3 deletions
+3 -2
View File
@@ -152,7 +152,7 @@ func SeePlanes(c *fiber.Ctx) error {
response, err := services.SeePlanes(*dlocalConfig)
if err != nil {
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"error": fmt.Sprintf("Error al obtener los planes", err),
"error": fmt.Sprintf("Error al obtener los planes: %v", err),
})
}
@@ -324,8 +324,9 @@ func DlocalWebhook(c *fiber.Ctx) error {
log.Printf("[DLOCAL] Webhook: error marcando contrato %d como pagado: %v", contratoID, err)
} else {
log.Printf("[DLOCAL] Webhook: contrato %d marcado como pagado", contratoID)
// Notificar SaaS externos asociados al contrato (goroutine, no bloquea respuesta)
// Notificar SaaS externos + enviar correo de confirmación (goroutine, no bloquea respuesta)
go services.DispatchSaasPaymentNotification(contratoID, payerEmail, "dlocal", monto, moneda)
go services.EnviarCorreoConfirmacionPago(contratoID)
}
}
}