Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #11 from g12-4soat/feature/fake-checkout
Browse files Browse the repository at this point in the history
criação de fake checkout para interface de pagamento
  • Loading branch information
gabriellima09 authored Oct 17, 2023
2 parents a74927a + 6d3a02e commit 4e4dfb1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/TechLanches/TechLanches.API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
config.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));

// mover para extensão
builder.Services.AddScoped<IPagamentoService, FakeCheckoutService>();
builder.Services.AddScoped<IClienteService, ClienteService>();
builder.Services.AddScoped<IClienteRepository, ClienteRepository>();

Expand Down
20 changes: 20 additions & 0 deletions src/TechLanches/TechLanches.Application/IPagamentoService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace TechLanches.Application;

public interface IPagamentoService
{
Task<bool> RealizarPagamento(int pedidoId, FormaPagamento formaPagamento, decimal valor);
}

public class FakeCheckoutService : IPagamentoService
{
public Task<bool> RealizarPagamento(int pedidoId, FormaPagamento formaPagamento, decimal valor)
{
//salvar informação de pagamento
return Task.FromResult(true);
}
}

public enum FormaPagamento
{
QrCodeMercadoPago
}

0 comments on commit 4e4dfb1

Please sign in to comment.