From 6d3a02ee99aca86982e6190bf607d32fa6cf7f40 Mon Sep 17 00:00:00 2001 From: Gabriel Lima Date: Mon, 16 Oct 2023 17:13:11 -0300 Subject: [PATCH] =?UTF-8?q?cria=C3=A7=C3=A3o=20de=20fake=20checkout=20para?= =?UTF-8?q?=20interface=20de=20pagamento?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TechLanches/TechLanches.API/Program.cs | 1 + .../IPagamentoService.cs | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/TechLanches/TechLanches.Application/IPagamentoService.cs diff --git a/src/TechLanches/TechLanches.API/Program.cs b/src/TechLanches/TechLanches.API/Program.cs index 89878bf9..97a90bce 100644 --- a/src/TechLanches/TechLanches.API/Program.cs +++ b/src/TechLanches/TechLanches.API/Program.cs @@ -18,6 +18,7 @@ config.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))); // mover para extensão +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/src/TechLanches/TechLanches.Application/IPagamentoService.cs b/src/TechLanches/TechLanches.Application/IPagamentoService.cs new file mode 100644 index 00000000..e214c9b2 --- /dev/null +++ b/src/TechLanches/TechLanches.Application/IPagamentoService.cs @@ -0,0 +1,20 @@ +namespace TechLanches.Application; + +public interface IPagamentoService +{ + Task RealizarPagamento(int pedidoId, FormaPagamento formaPagamento, decimal valor); +} + +public class FakeCheckoutService : IPagamentoService +{ + public Task RealizarPagamento(int pedidoId, FormaPagamento formaPagamento, decimal valor) + { + //salvar informação de pagamento + return Task.FromResult(true); + } +} + +public enum FormaPagamento +{ + QrCodeMercadoPago +} \ No newline at end of file