Skip to content

feat(backend): cross-border payments with FX conversion (#920) - #986

Merged
Smartdevs17 merged 1 commit into
Smartdevs17:mainfrom
sandrawillow001-afk:feat/920-cross-border-payments-fx
Sep 28, 2026
Merged

Smartdevs17 merged 1 commit into
Smartdevs17:mainfrom
sandrawillow001-afk:feat/920-cross-border-payments-fx

Conversation

@sandrawillow001-afk

Copy link
Copy Markdown
Contributor

Summary

Implements cross-border payments end to end: a corridor-aware quote holds an auditable FX rate and converts the amount, and a payment consumes that quote before the settlement rail confirms or rejects it. Composes with the existing FX service (#626).

Closes #920

Changes

  • New CrossBorderPaymentService (backend/src/services/cross-border/):
    • corridor registry for USD/EUR/GBP/XLM with limits, settlement rails (SEPA, ACH, Faster Payments, Stellar), fees, and settlement estimates
    • createQuote in source or target amount mode with a transparent fee breakdown, corridor limits, and a rate-hold expiry
    • initiatePayment with idempotency keys, plus completePayment / failPayment status transitions
  • New routes under /api/v1/cross-border: corridors, quote, quotes/:id, payments, payments/:id, payments/:id/complete, payments/:id/fail.
  • Mounted the new router and the previously unwired FX router at /api/v1/fx.
  • Docs: backend/docs/CROSS_BORDER_PAYMENTS.md.

Pricing model

fxFee        = sourceAmount × corridor.fxFeePct
fees.total   = fxFee + corridor.fixedFee
convertible  = sourceAmount − fees.total
targetAmount = convertible × fxRate

Testing

  • cd backend && npx vitest run src/services/__tests__/cross-border-service.test.ts → 16 passed
  • tsc --noEmit and eslint clean for all new/changed files

)

Enable international transfers end to end: a corridor-aware quote holds an
auditable FX rate, and a payment consumes that quote and is settled by the
rail.

- Add CrossBorderPaymentService with corridor registry, source/target quoting,
  transparent fee breakdown, rate-hold expiry, and idempotent payments
- Add /api/v1/cross-border routes for corridors, quotes, and payments
- Mount the cross-border router and the previously unwired FX router
- Add unit tests and operational documentation

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

@sandrawillow001-afk is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 28, 2026

Copy link
Copy Markdown

@sandrawillow001-afk 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! 🚀

Learn more about application limits

@Smartdevs17
Smartdevs17 merged commit d89fe19 into Smartdevs17:main Sep 28, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement cross-border payments with FX conversion

2 participants