diff options
| author | Adam Soltys <[email protected]> | 2026-10-08 22:06:49 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-08 22:06:49 -0700 |
| commit | c7a1a11d686c8986b353e356c51ccae1c7660890 (patch) | |
| tree | dade278f8dca227e78f19b059e53fe91920265e0 | |
| parent | 62429e1830e16cb4a89364888ea889cf908e06be (diff) | |
| download | coinosv3-server-c7a1a11d686c8986b353e356c51ccae1c7660890.tar.gz coinosv3-server-c7a1a11d686c8986b353e356c51ccae1c7660890.zip | |
POS terminals ring up in the owner's currency: the app sends its currency when minting a terminal token (it sent none, so every terminal priced sales in USD and a $0.03 sale paid out as $0.04 CAD), and a new token retunes the terminals already paired to that name
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| -rw-r--r-- | names/server.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/names/server.js b/names/server.js index 9b57ce7..6cd82a1 100644 --- a/names/server.js +++ b/names/server.js @@ -938,7 +938,12 @@ Bun.serve({ return json({ ok: true, revoked: n }); } const token = posMintToken(key, body.currency); - return json({ token, name, domain, currency: posTokens()[token].currency }); + // Currency is the merchant's, not the token's: a new token in CAD moves + // the terminals already paired to this name to CAD as well. + const { currency } = posTokens()[token]; + for (const v of Object.values(posTokens())) if (v.key === key) v.currency = currency; + persist(); + return json({ token, name, domain, currency }); } // Operator bootstrap: mint a terminal token for any name. if (url.pathname === '/admin/pos/token' && req.method === 'POST') { |
