feat(api-gateway): add fx-engine HTTP client for payment quotes#196
Open
DANTE-1903 wants to merge 1 commit into
Open
feat(api-gateway): add fx-engine HTTP client for payment quotes#196DANTE-1903 wants to merge 1 commit into
DANTE-1903 wants to merge 1 commit into
Conversation
Payment creation can now fetch FX quotes from the fx-engine when a convertTo currency is specified, enabling multi-currency payments.
|
@DANTE-1903 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Kindly resolve conflict |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #114
Implements an HTTP client within
api-gatewayto integrate seamlessly withfx-engine. Payment creation flows now support fetching automated currency conversion quotes when the optionalconvertToparameter is supplied.What Changed
services/api-gateway/src/clients/fx-client.tsimplementinggetQuotewith a strict 5-second timeout,x-service-tokenauthentication propagation, and structured metric/error logging.services/api-gateway/src/clients/fx-client.test.tsproviding 18 robust test variations covering happy paths, timeout scenarios, network drops, and fallback behaviors.prisma/schema.prismato include core FX fields (convertTo,convertedAmount,fxRate,fxQuoteId,fxQuoteExpiresAt) directly on thePaymentmodel.shared/validation/schemas.tsto cleanly validate the incoming optionalconvertTopayload attribute.services/api-gateway/src/index.tsto orchestrate client execution gracefully (ensuring payments proceed unhindered if thefx-engineundergoes an outage).Checklist
tsc --noEmit) and all tests pass cleanlySecurity & Resilience Note
Inter-service calls explicitly enforce a strict 5-second fallback ceiling. If the downstream
fx-engineis unavailable, timeouts or errors are caught safely, falling back gracefully to log metrics and allow local payment transactions to process normally without cascading failures.