This commit is contained in:
Tizian.Breuch
2025-07-29 19:11:34 +02:00
parent 3907cba29d
commit 6fc6aaef3e
14 changed files with 375 additions and 31 deletions

View File

@@ -0,0 +1,30 @@
// src/Webshop.Api/Controllers/Public/PaymentMethodsController.cs
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.DTOs.Payments; // PaymentMethodDto
using Webshop.Application.Services.Public; // IPaymentMethodService
namespace Webshop.Api.Controllers.Public
{
[ApiController]
[Route("api/v1/public/paymentmethods")] // Saubere Route
[AllowAnonymous] // Jeder darf die verfügbaren Zahlungsmethoden sehen
public class PaymentMethodsController : ControllerBase
{
private readonly IPaymentMethodService _paymentMethodService;
public PaymentMethodsController(IPaymentMethodService paymentMethodService)
{
_paymentMethodService = paymentMethodService;
}
[HttpGet]
public async Task<ActionResult<IEnumerable<PaymentMethodDto>>> GetActivePaymentMethods()
{
var paymentMethods = await _paymentMethodService.GetAllActiveAsync();
return Ok(paymentMethods);
}
}
}