using Microsoft.AspNetCore.Mvc;
using MTWorkHR.Application.Services.Interfaces;
using System.Threading.Tasks;

[ApiController]
[Route("api/[controller]")]
public class PaymentController : ControllerBase
{
    private readonly IAmazonPayService _amazonPayService;

    public PaymentController(AmazonPayService amazonPayService)
    {
        _amazonPayService = amazonPayService;
    }

    [HttpPost("checkout")]
    public async Task<IActionResult> CreateCheckoutSession([FromBody] CheckoutRequest request)
    {
        var response = await _amazonPayService.CreateCheckoutSessionAsync(request.Amount, request.CurrencyCode);
        return Ok(response);
    }
}

public class CheckoutRequest
{
    public decimal Amount { get; set; }
    public string CurrencyCode { get; set; }
}
