b8434fdd36
Operators can now choose which payment methods the hosted /pay page offers: GP_CHECKOUT_METHODS=nostr, =slatepack, or nostr,slatepack (unset = both, current behavior). Gates the two checkout sections independently; slatepack still also requires a loaded wallet. The Nostr ingest service (GP_INGEST) and the /invoice JSON API are unchanged.
61 lines
2.7 KiB
HTML
61 lines
2.7 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 %}<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_paid %}
|
|
<p class="status paid">Paid ✓</p>
|
|
<p class="hint">This invoice has been settled. You can close this page.</p>
|
|
{% else if is_expired %}
|
|
<p class="status expired">This invoice has expired.</p>
|
|
{% else %}
|
|
<p class="status open">Waiting for payment…</p>
|
|
|
|
{% if !info.nprofile.is_empty() %}
|
|
<section class="pay-method">
|
|
<h2>Pay with Goblin Wallet</h2>
|
|
<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 let Some(grin1) = info.slatepack_address %}
|
|
<section class="pay-method">
|
|
<h2>Pay by Slatepack (grin1)</h2>
|
|
<p class="hint">Pay from any Grin wallet, no Nostr needed. Send <strong>{{ info.amount_display }}</strong> to the address below.</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>
|
|
<ol>
|
|
<li>In your Grin wallet, send {{ info.amount_display }} to this address using the Slatepack / file method, then paste the Slatepack it produces below.</li>
|
|
<li>The pasted <strong>S1</strong> Slatepack is received here and a <strong>response</strong> Slatepack is returned.</li>
|
|
<li>Paste that response back into your wallet to finalize and broadcast it, which completes the payment.</li>
|
|
</ol>
|
|
<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. … ENDSLATEPACK."></textarea>
|
|
<button type="submit">Submit slatepack</button>
|
|
</form>
|
|
</section>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if let Some(memo) = info.memo %}<p class="memo">{{ memo }}</p>{% endif %}
|
|
<p class="footer">Powered by GoblinPay · receive-only Grin over Nostr</p>
|
|
</main>
|
|
</body>
|
|
</html>
|