23 lines
661 B
C#
23 lines
661 B
C#
|
using Core.Entities;
|
||
|
using Core.Interfaces;
|
||
|
using Microsoft.AspNetCore.Authorization;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
||
|
namespace API.Controllers
|
||
|
{
|
||
|
public class PaymentsController : BaseApiController
|
||
|
{
|
||
|
private readonly IPaymentService _paymentService;
|
||
|
public PaymentsController(IPaymentService paymentService)
|
||
|
{
|
||
|
_paymentService = paymentService;
|
||
|
}
|
||
|
|
||
|
[Authorize]
|
||
|
[HttpPost("{basketId}")]
|
||
|
public async Task<ActionResult<CustomerBasket>> CreateOrUpdatePaymentIntent(string basketId)
|
||
|
{
|
||
|
return await _paymentService.CreateOrUpdatePaymentIntent(basketId);
|
||
|
}
|
||
|
}
|
||
|
}
|