Created
September 12, 2025 23:21
-
-
Save rcarubbi/9220cca467814fff328daf05361070e3 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
| // Gateway concreto (borda): detalhe periférico; usa o Translator | |
| public sealed class PartnerPaymentGateway : IPaymentGateway | |
| { | |
| private readonly HttpClient _http; | |
| private readonly PaymentAclTranslator _t; | |
| public PartnerPaymentGateway(HttpClient http, PaymentAclTranslator t) | |
| { | |
| _http = http; | |
| _t = t; | |
| } | |
| public PaymentAuthorization Authorize(PaymentRequest request) | |
| { | |
| var outbound = _t.ToPartner(request); | |
| // Chamada externa (omitida). Suponha que resposta possa ser APPROVED/DECLINED/PENDING. | |
| var inbound = new PartnerAuthResponse("PENDING", "AUTH-999"); | |
| return _t.FromPartner(inbound); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment