Files
GoblinPay/templates/pay.html
T

89 lines
4.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% if is_open || is_paid %}<meta http-equiv="refresh" content="10">{% endif %}
<title>Pay with Goblin (GRIN)</title>
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
<main class="checkout">
<a class="brand" href="/"><img class="brandmark" src="/static/goblinpay-wordmark.svg" alt="GoblinPay"></a>
<h1>Pay with Goblin</h1>
<p class="amount">{{ info.amount_display }}</p>
{% if is_confirmed %}
<p class="status paid">Paid &#10003;</p>
<p class="hint">Confirmed on chain ({{ confirmations }} of {{ confirmations_required }} confirmations). This invoice is settled. You can close this page.</p>
{% else if is_paid %}
<p class="status confirming">Payment received &#10003;</p>
<p class="hint">Confirming on chain: {{ confirmations }} of {{ confirmations_required }} confirmations&#8230; This page updates automatically.</p>
{% else if is_expired %}
<p class="status expired">This invoice has expired.</p>
{% else %}
<p class="status open">Waiting for payment&#8230;</p>
{% let has_goblin = !info.nprofile.is_empty() %}
{% let has_grin = info.invoice_slatepack.is_some() || info.slatepack_address.is_some() %}
<div class="rails">
{% if has_goblin && has_grin %}
{# The CSS-only switcher appears only when both rails are available; the
Goblin rail is the default-selected tab. A single available rail
renders its panel directly, with no switcher chrome at all. #}
<input class="rail-radio" type="radio" name="rail" id="rail-goblin" checked>
<input class="rail-radio" type="radio" name="rail" id="rail-grin">
<div class="rail-tabs">
<label class="rail-tab" for="rail-goblin">Pay with Goblin</label>
<label class="rail-tab" for="rail-grin">Pay with any Grin wallet</label>
</div>
{% endif %}
{% if has_goblin %}
<section class="rail-panel" id="panel-goblin">
<div class="qr">{{ info.qr_svg|safe }}</div>
<p class="hint">Scan with your Goblin Wallet, or copy the address below.</p>
<label for="nprofile">Payment address (nprofile)</label>
<textarea id="nprofile" class="copybox" rows="3" readonly>{{ info.nprofile }}</textarea>
</section>
{% endif %}
{% if has_grin %}
<section class="rail-panel" id="panel-grin">
{% if let Some(pack) = info.invoice_slatepack %}
<div class="grin-sub">
<h3>Grin invoice</h3>
<p class="hint">Open your Grin wallet, import this invoice, and pay it. The response returns to us automatically over Tor, no copy-paste back needed.</p>
{% if let Some(pack_qr) = info.invoice_slatepack_qr_svg %}<div class="qr">{{ pack_qr|safe }}</div>{% endif %}
<label for="invoice-slatepack">Invoice slatepack</label>
<textarea id="invoice-slatepack" class="copybox" rows="7" readonly>{{ pack }}</textarea>
</div>
{% endif %}
{% if let Some(grin1) = info.slatepack_address %}
<div class="grin-sub">
<h3>Send to address</h3>
<p class="hint">Prefer sending yourself? Send exactly <strong>{{ info.amount_display }}</strong> to the address below, then paste the slatepack your wallet produces.</p>
{% if let Some(grin1_qr) = info.slatepack_qr_svg %}<div class="qr">{{ grin1_qr|safe }}</div>{% endif %}
<label for="grin1">Slatepack address (grin1)</label>
<textarea id="grin1" class="copybox" rows="3" readonly>{{ grin1 }}</textarea>
<form method="post" action="/pay/{{ info.token }}/slatepack">
<label for="s1">Your slatepack (S1)</label>
<textarea id="s1" name="slatepack" rows="6" required
placeholder="BEGINSLATEPACK. &#8230; ENDSLATEPACK."></textarea>
<button type="submit">Submit slatepack</button>
</form>
</div>
{% endif %}
</section>
{% endif %}
</div>
{% endif %}
{% if let Some(memo) = info.memo %}<p class="memo">{{ memo }}</p>{% endif %}
<p class="footer">Powered by GoblinPay &middot; receive-only Grin over Nostr{% if info.invoice_slatepack.is_some() || info.slatepack_address.is_some() %} and Tor{% endif %}</p>
</main>
</body>
</html>