diff --git a/veza-backend-api/internal/core/marketplace/service.go b/veza-backend-api/internal/core/marketplace/service.go index b9b582d8b..34a649b81 100644 --- a/veza-backend-api/internal/core/marketplace/service.go +++ b/veza-backend-api/internal/core/marketplace/service.go @@ -579,6 +579,14 @@ func (s *Service) ProcessPaymentWebhook(ctx context.Context, payload []byte) err } s.logger.Info("Order failed via Hyperswitch webhook", zap.String("order_id", order.ID.String()), zap.String("payment_id", paymentID)) return nil + case "cancelled", "canceled": + order.Status = "cancelled" + order.PaymentStatus = status + if err := s.db.WithContext(ctx).Save(&order).Error; err != nil { + return err + } + s.logger.Info("Order cancelled via Hyperswitch webhook", zap.String("order_id", order.ID.String()), zap.String("payment_id", paymentID)) + return nil default: s.logger.Debug("Hyperswitch webhook: ignoring status", zap.String("status", status), zap.String("payment_id", paymentID)) return nil