tests and eurc
All checks were successful
Deploy / build-deploy (push) Successful in 4m19s

This commit is contained in:
Jorijn van der Graaf 2026-08-15 00:54:05 +02:00
commit 749f525f83
44 changed files with 5380 additions and 3532 deletions

View file

@ -344,6 +344,24 @@ export Financials LoadFinancials(std::string_view json) {
// Everything the order status page needs to render — a projection of the
// server's order record, not the record itself. The renderer stays a pure
// function in Shared; the server owns storage and fills this in.
// Self-hosted crypto payment instructions, rendered on the order page when the
// rail has no hosted checkout to send the buyer to. Everything is pre-formatted
// text: the renderer should not know what a chain id or a token decimal is, any
// more than it knows where ECB rates come from.
export struct OrderCryptoPay {
std::string address; // where the money goes, "0x…"
std::string amount; // decimal EURC amount ("570.43") — equals the
// euro total; EURC is euro-denominated at par
std::int64_t minutesLeft = 0; // until the window closes; <= 0 = closed
struct Chain {
std::string name; // "base"
std::string contract; // token contract, shown so the buyer can verify
std::string link; // EIP-681 wallet URI; empty = no link rendered
std::string note; // short hint ("lowest fees"), may be empty
};
std::vector<Chain> chains; // in display order — first is the recommended one
};
export struct OrderView {
std::string token; // the capability that IS the URL — never logged
std::string reference; // short human code, quoted in the bank transfer
@ -363,6 +381,9 @@ export struct OrderView {
std::int64_t shippingMinor = 0;
std::int64_t totalMinor = 0;
bool vatIncluded = false;
// Present only for an awaiting order on a rail without a hosted checkout;
// the page then renders instructions instead of a "resume payment" button.
std::optional<OrderCryptoPay> cryptoPay;
};
// An entry on the demos page.