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

@ -304,6 +304,29 @@ HTTPResponse RenderPage(std::string_view target) {
view.colorLabel = order->color;
}
// Self-hosted rails have no provider page to resume at — the order
// page IS the payment page, so ask the rail what to render. Hosted
// rails return nullopt and keep their button. Only while awaiting: a
// paid page repeating "send money here" would read as a second ask.
if (order->status == "awaiting_payment") {
if (const PaymentRail* rail = gRails.For(order->payChoice)) {
if (auto instr = rail->Instructions(order->payId, order->totalMinor)) {
OrderCryptoPay pay;
pay.address = instr->address;
pay.amount = instr->amount;
const std::int64_t now =
std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::system_clock::now().time_since_epoch()).count();
pay.minutesLeft = (instr->deadlineUnix - now) / 60;
for (auto& c : instr->chains) {
pay.chains.push_back({ std::move(c.name), std::move(c.contract),
std::move(c.link), std::move(c.note) });
}
view.cryptoPay = std::move(pay);
}
}
}
// The indicative national-currency line: ECB reference rates baked in
// at build time, converted to whole units, labelled with the rate
// date. Purely informative — the euro amount is the charge.
@ -893,7 +916,7 @@ namespace {
// configured rail's cadence, because that rail's orders deserve it, so
// "poll on every pass" would silently poll the slower provider at the faster
// one's rate — with two rails that is no longer a rounding error but double
// the request volume CoinGate was promised. `first` drives the age backoff,
// the request volume the slower one was promised. `first` drives the age backoff,
// `last` enforces the interval; keeping them apart also retires the modulo
// pacing that used to approximate this with one.
void ReconcilerLoop(const std::stop_token& stop) {