Repository navigation
Conversation
Banxa's retry helper is about to be shared with the Simplex plugin. Banxa keeps injecting its snooze, so behavior is unchanged.
Simplex replaced its reporting API, so the plugin now reads /reporting/v1/payments with Authorization: ApiKey, walking forward in 30-day windows with a cursor inside each one. The schema comes from the published API reference and the sample response Simplex sent us. It has not run against real data, because that needs a server-side key. Progress only moves when a window completes, because results come newest first inside a window. This also stops the old rewind to timestamp 0 on a run with no transactions. A payment that cannot be processed is quarantined and reported, matching ChangeNow and Houdini. A failed request or malformed page holds progress. Refunded payments are now recorded. A refund inside the lookback replaces the complete document for that order.
j0ntz
force-pushed
the
jon/simplex-reporting-api
branch
from
November 1, 2026 09:27
b7b434b to
b5f1ee8
Compare
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?
Dependencies
none
Description
Moves the Simplex plugin to
GET /reporting/v1/paymentswithAuthorization: ApiKey <key>. It walks forward in 30-day windows and follows the cursor inside each one.This has never run against real Simplex data. That needs a server-side reporting key, which does not exist yet and which an agent must not source or set. The schema comes from the published API reference and the sample response Simplex sent us in Slack on 2024-10-14.
Tested
test/simplex.test.tsis new: mapping, host and auth, cursor paging, 30-day windows, progress, retries, quarantine, malformed pages, refunds. Full mocha suite passes.verify-repo.sh,tscInvalid API key; error reported, progress heldretryFetchAuthorization: ApiKeyheader sentrunPlugin, loopback server, throwaway CouchDBpayment_id, success status, progress movedNo live request has confirmed the production host. It comes from the Simplex message.
Behavior changes to check
cacheEnginevolume.lastTimestamponly moves when a window completes, because pages run newest first inside a window. The old plugin could rewind to 0 on an empty run; replacing the query loop fixes that here rather than in a separate commit.PluginResult.error, as in ChangeNow and Houdini. A failed request or malformed page holds progress.payment_methodlogs a warning and stores a null payment type.order_idfalls back topayment_id. A payment with neither is quarantined, because a blank id would fail the whole CouchDB insert and stop every newer payment.retryFetchnow rethrows errors with nocode. It used to readerr.codeunguarded, and a node-fetch timeout surfaced as aTypeErrorinstead of its real message. Every plugin that callsretryFetchgets this.Unverified assumption
orderIdisreferences.order_idwhen present and not blank, elsepayment_id, on the assumption thatorder_idmatches the id on older documents. The sample's value is the placeholder"string". If it does not match, reprocessed payments get new documents instead of updating the old ones. The first real run has to confirm this.Deploy (human/ops only)
apiKeys.apiKeyunderpartnerIds.simplexin the productionreports_appsdocument, replacing the old value.npm run build.lib, then restartreportsQueryandreportsCachewith pm2.skipping unprocessable paymenterrors.With the old key the new plugin reports a 401 on each run and holds its progress. No data is lost.
Known issue, left as is
fetchWithBackoffputs the full response body in its error. A Cloudflare block therefore writes a long HTML page, including the egress IP, into logs and status text. The helper moved here unchanged from Banxa, and trimming it belongs in its own change.An order id containing a colon would fail the insert, because
queryEngine.tstakes the id fromdocId.split(':')[1]. Nothing suggests Simplex sends one, and the sample and reference show none. It predates this change.docs/blocked-partner-reporting.mdcarries the evidence for the host, route and auth scheme.Asana task
Test evidence
b5f1ee8Query the Simplex reporting API
2026-11-01
1. C2 retest
2. C4 retest