<%~ include('./partials/head', { title: 'Upgrade' }) %> <%~ include('./partials/nav', { nav: 'settings' }) %> <% const plan = it.account.plan; const coins = it.coins || []; const invoice = it.invoice; const payApi = it.payApi || ''; const totalSpent = it.totalSpent || 0; const lifetimeBase = 140; const lifetimeDiscount = Math.min(totalSpent, lifetimeBase * 0.5); const lifetimePrice = lifetimeBase - lifetimeDiscount; %>
← Back to settings

Upgrade Plan

<% if (!invoice) { %>
<% coins.forEach(function(c, i) { %> > <% }) %>
<% } else { %> <% const inv = invoice; const isPending = inv.status === 'pending' || inv.status === 'underpaid' || inv.status === 'confirming'; const received = parseFloat(inv.amount_received || '0'); const total = parseFloat(inv.amount_crypto); const remaining = Math.max(0, total - received); const expiresAt = new Date(inv.expires_at); const now = new Date(); const remainingSec = Math.max(0, Math.floor((expiresAt.getTime() - now.getTime()) / 1000)); const mins = Math.floor(remainingSec / 60); const secs = remainingSec % 60; %> <% if (isPending) { %> <% } %>
<% if (inv.status === 'confirming') { %> <% } else if (inv.status !== 'paid') { %>
QR Code
<% } %> <% if (inv.status === 'pending' || inv.status === 'underpaid') { %>
<%= received > 0 && remaining > 0 ? remaining.toFixed(8) : inv.amount_crypto %>
<%= inv.coin_label %> (<%= inv.coin_ticker %>)
$<%= Number(inv.amount_usd).toFixed(2) %> USD
<% if (received > 0 && remaining > 0) { %>
Received: <%= received.toFixed(8) %>
Remaining: <%= remaining.toFixed(8) %>
<% } %>
<%= inv.address %>
<% } %> <% if (inv.status === 'pending') { %>
Waiting for payment...
Expires in <%= mins %>:<%= String(secs).padStart(2, '0') %>
<% } else if (inv.status === 'underpaid') { %>
Underpaid - please send the remaining amount
Expires in <%= mins %>:<%= String(secs).padStart(2, '0') %>
<% } else if (inv.status === 'confirming') { %>

Payment received

Waiting for 1 network confirmation...

<% if (inv.address) { %> View on block explorer → <% } %> <% } else if (inv.status === 'paid') { %>

Payment confirmed

Your plan has been activated.

<% if (inv.address) { %> View on block explorer → <% } %> <% } else if (inv.status === 'expired') { %>
Payment expired
Try again <% } %>

You can leave this page. Payments are detected and confirmed automatically.

<% } %>
<%~ include('./partials/foot') %>