This page exercises digipay.js. It's not a merchant-facing page — just a harness.
Any element with data-digipay-checkout + data-session-id opens the hosted checkout as an in-page modal on click.
<script src="/embed/digipay.js"></script> <button data-digipay-checkout data-session-id="ses_...">Pay with DigiByte</button>
DigiPay.checkout({ sessionId: 'ses_...' });
DigiPay.close();
Pass theme: 'light' or 'dark', or add data-theme to an auto-bound element. Without it, the checkout follows the shopper's own choice or device. Any other value is ignored.
DigiPay.checkout({ sessionId: 'ses_...', theme: 'light' });
<button data-digipay-checkout data-session-id="ses_..." data-theme="dark">Pay</button>
Tip buttons too:
Tip 1 DGB (light)onStatus gets { sessionId, status } on every status change; onSuccess gets the same once, when the payment is confirmed. The modal closes closeDelay ms later (2500 by default). Fulfil orders from your webhook: a browser callback is a hint, not proof.
DigiPay.checkout({
sessionId: 'ses_...',
onStatus: function (e) { console.log(e.sessionId, e.status); },
onSuccess: function (e) { showThankYou(e.sessionId); },
closeDelay: 1500,
});
Callbacks appear here. Uses the session above, or creates a demo session.
DigiPay.button({ address: 'dgb1...', amount: 5, name: 'Creator' });
<span data-digipay-button data-address="dgb1..." data-amount="2.5">Tip</span>Tip 2.5 DGB
With DigiDollar too: add your store id. The tip page offers DGB and DD while your store accepts DigiDollar.
<span data-digipay-button data-address="dgb1..." data-store="sto_..." data-currency="DD" data-dd-amount="5">Tip in DGB or DD</span>
Walks a fresh sandbox session through all its state transitions without needing a chain tx. Renders the checkout inline (not as a modal) so the Advance buttons stay reachable.
Each Advance click walks the session pending → detected → paid → confirmed. The status pill flips, QR / countdown stay live throughout.