chore: build
Backend - Build & Lint / build (push) Successful in 34m6s

This commit is contained in:
Xor290
2026-10-17 17:49:52 +02:00
parent 4c529b49f7
commit dba8b02de9
11 changed files with 1392 additions and 81 deletions
@@ -79,12 +79,28 @@ func IPNWebhook(c *gin.Context) {
func GetCommandPaymentStatus(c *gin.Context) {
database := c.MustGet("database").(*db.Database)
username, exists := c.Get("username")
if !exists {
c.JSON(http.StatusUnauthorized, gin.H{"error": "Authentification requise"})
return
}
commandID, err := strconv.Atoi(c.Param("id"))
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "id de commande invalide"})
return
}
command, err := database.GetCommandByID(commandID)
if err != nil {
c.JSON(http.StatusNotFound, gin.H{"error": "Commande non trouvée"})
return
}
if cmdUsername, _ := command["username"].(string); cmdUsername != username.(string) {
c.JSON(http.StatusForbidden, gin.H{"error": "Cette commande ne vous appartient pas"})
return
}
payment, err := database.GetCryptoPaymentByCommandID(commandID)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "erreur base de données"})