Created
September 12, 2025 23:18
-
-
Save rcarubbi/8b946d34223785828a3a0a83f648e98e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Porta de saída para iniciar o pagamento (sincronia do nosso lado; resultado pode ser PENDING) | |
| public interface IPaymentGateway | |
| { | |
| PaymentAuthorization Authorize(PaymentRequest request); | |
| } | |
| // Porta de entrada (callback/notificação) para receber a liquidação (eventual consistency) | |
| public interface IPaymentSettlementHandler | |
| { | |
| void Apply(PaymentSettlementNotification notification); | |
| } | |
| // Modelos internos (nossa linguagem) | |
| public sealed record PaymentRequest(string OrderNumber, string Currency, decimal Amount); | |
| public sealed record PaymentAuthorization(PaymentAuthStatus Status, string? Code); | |
| public enum PaymentAuthStatus { Approved, Declined, Pending } | |
| public sealed record PaymentSettlementNotification(string OrderNumber, PaymentSettlementStatus Status, string? Code); | |
| public enum PaymentSettlementStatus { Settled, Rejected } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment