up
This commit is contained in:
@@ -61,6 +61,24 @@ func PagoExitosoPage(c *fiber.Ctx) error {
|
||||
}, "layouts/landing")
|
||||
}
|
||||
|
||||
// Bold confirmó el pago directamente en la URL de retorno
|
||||
if boldTxStatus == "approved" {
|
||||
_ = models.SaveBoldCallbackLog(models.BoldCallbackLog{
|
||||
Referencia: ref, PaymentLink: paymentLink, Params: paramsJSON,
|
||||
Estado: "pagado", IP: c.IP(), UserAgent: string(c.Request().Header.UserAgent()),
|
||||
})
|
||||
// Marcar contrato si aún no está confirmado
|
||||
var contratoID uint
|
||||
if _, err := fmt.Sscanf(ref, "contrato-%d", &contratoID); err == nil && contratoID > 0 {
|
||||
_ = models.MarcarContratoPagado(contratoID)
|
||||
go services.EnviarCorreoConfirmacionPago(contratoID)
|
||||
}
|
||||
estado, fechaPago := verificarPago(ref)
|
||||
return c.Render("pago_exitoso", fiber.Map{
|
||||
"Ref": ref, "Estado": estado, "FechaPago": fechaPago,
|
||||
}, "layouts/landing")
|
||||
}
|
||||
|
||||
// Registrar el intento de pago en la tabla de callbacks
|
||||
if ref != "" || paymentLink != "" {
|
||||
entry := models.BoldCallbackLog{
|
||||
|
||||
Reference in New Issue
Block a user