Decode a bank's callback without credentials, in a module of its own #2
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Catcrafts/Nostro#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When bunq pushes a callback, something has to turn the body it POSTs into a payment: the bank's id, an amount, a description, how it arrived, and the account it is about. Nostro has that knowledge for the payment list (
GetNewTransactionsinimplementations/Nostro-Bunq.cpp) but not for a callback, and what it has cannot be used where a callback arrives.Why it cannot be used there
A callback goes to a public HTTPS endpoint, and that host is the one that should hold no bank credential. So the receiver has no connector, and it cannot ask nostrod either, which runs on another machine. It needs the decoding alone.
It also cannot link the library as it is built today.
--libbrings Crafter.Network at a pinned commit with--no-quic, Crafter.DB and OpenSSL. A server that already builds Crafter.Network another way (the catcrafts.net server follows its branch, with QUIC) has its build stopped by crafter-build, for two loads of one dependency that disagree.Nostro.Checkoutsolved the same problem by being a module of its own with no bank code in it.Who needs it
The catcrafts.net shop server. bunq pushes each incoming payment to it, the server decodes the payment and records a credit, and the order settles from that. The decoding is bunq code that lives in the shop today:
ParseBunqCallbackandParseSignedAmountToMinorinCatcrafts.Server-Bunq.cpp, with their cases inShouldParseBunqPayments. It is the last bunq code that would remain there once the shop reads through nostrod and registers its callback through Nostro (#1).What arrives
A
MUTATIONcallback, reduced to the fields the shop reads, with made-up values. bunq's production callbacks have decoded with this shape since 2026-08:Outgoing payments come with a negative
value. ThePaymentlooks like the object the payment list returns, so the rest of it (created,sub_type,counterparty_alias, the account's ownalias) should be there too, but the shop has only ever read the four fields above: check it against a real callback. Other categories carry other objects, or none.What it would take
--product=as the checkout is, that needs no connector, no network, no OpenSSL and no Crafter.DB.lib/json.hppis enough to read the body.To decide
TransactionandCurrencyare partitions of the moduleNostro, which a credential-free module cannot import without the rest of it. Either the new module has types of its own, as the checkout does, or those two move somewhere both can import.