Add Revolut fiat payment provider#227
Open
j0ntz wants to merge 1 commit into
Open
Conversation
j0ntz
force-pushed
the
jon/add-revolut-plugin
branch
from
July 23, 2026 01:29
0086464 to
28a7f85
Compare
j0ntz
force-pushed
the
jon/add-revolut-plugin
branch
from
July 23, 2026 01:33
28a7f85 to
cab2ad9
Compare
Recreate the Revolut partner plugin following the moonpay pattern: - src/partners/revolut.ts queries the Revolut partner transactions API, cleans results, and maps completed buy/sell txs to StandardTx. - Register the plugin in queryEngine.ts. - Add the revolut demo entry (fiat, #191C33).
j0ntz
force-pushed
the
jon/add-revolut-plugin
branch
from
July 23, 2026 01:38
cab2ad9 to
755f8e1
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 755f8e1. Configure here.
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.

CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
- added: Add Revolut fiat payment providerDependencies
none
Description
Adds a Revolut fiat payment provider to the reports server, following the
moonpay.tspartner pattern. This recreates the change from #211 under a fresh PR.Changes:
src/partners/revolut.ts(new): queries the Revolut partner transactions API (GET /partner/v1/transactions,Authorization: Bearer <apiKey>), pages vianext_cursor, cleans every response withcleaners, keeps onlycompletedtransactions, and maps each buy/sell toStandardTx. Returns an empty result (no fetch) whenapiKeyis null, so a missing key skips Revolut silently.src/queryEngine.ts: register therevolutplugin (import + plugins array).src/demo/partners.ts: add therevolutdemo entry (type: fiat, color#191C33).Mapping notes:
buy: deposit = fiat, payout = crypto;payouttxid/address from the tx.sell: inverted;deposittxid from the tx.payment_methodmaps toFiatPaymentType(card->credit,bank_transfer->banktransfer,apple_pay->applepay,google_pay->googlepay,revolut->revolut, unset->null); an unknown method throws.usdValueis left at-1for the rates engine to fill, consistent with other fiat partners.The production API key is set out-of-band in CouchDB
partnerIds.revolut.apiKeys.apiKey(a human/ops deploy step, not part of this change).Testing:
npm run build.types(tsc) clean;eslintclean on the changed files.processRevolutTxfor buy and sell inputs (validating each result through theasStandardTxcleaner), the null-apiKey guard (0 transactions,latestIsoDateechoed), and the unknown-payment-method throw.Asana: https://app.asana.com/0/1215088146871429/1216801668822236
Note
Medium Risk
New external API ingestion path writes transaction documents to CouchDB; query failures or unknown payment methods can abort a sync for that partner run, but behavior matches other fiat plugins.
Overview
Adds Revolut as a fiat partner so the reports server can ingest buy/sell transactions from Revolut’s partner API and store them as
StandardTxrecords.The new
queryRevolutplugin callsGET /partner/v1/transactionswith bearer auth, walks time windows with a 7-day lookback, pages withnext_cursor, and only keeps completed orders. Progress is advanced per window with buffered results so retries do not duplicateorderIds on bulk insert. IfapiKeyis missing, the plugin returns no transactions without calling the API.Buy/sell rows map fiat vs crypto to deposit/payout fields (including
tx_hashandwallet_addresson the crypto side), setexchangeType: 'fiat', and mappayment_methodtoFiatPaymentType(includingrevolut); unknown methods throw.revolutis registered in the query engine plugin list and added to demo partner metadata; the unreleased changelog is updated.Reviewed by Cursor Bugbot for commit 755f8e1. Bugbot is set up for automated code reviews on this repo. Configure here.