Profile
Update your account details.
Avatar
PNG/JPG/WEBP • up to 3 MB
Purchases
0 total
// Inside loadPurchases(...)
rows.forEach(r => {
const li = document.createElement('li');
li.className = 'py-3 flex items-center justify-between gap-3 flex-wrap';
li.innerHTML = `
${r.product_name || 'Purchase'}
${fmtDate(r.created_at)}
${fmtMoney(r.amount_cents, r.currency || 'USD')}
`;
purchasesList.appendChild(li);
});
purchasesList.addEventListener('click', async (e) => {
const btn = e.target.closest('.downloadBtn');
if (!btn) return;
const slug = btn.dataset.slug;
if (!slug) return;
const { data: { session } } = await sb.auth.getSession();
if (!session?.access_token) { alert('Please sign in again.'); return; }
btn.disabled = true; const old = btn.textContent; btn.textContent = 'Preparing…';
try {
const resp = await fetch(`get_download_url.php?slug=${encodeURIComponent(slug)}`, {
headers: { Authorization: 'Bearer ' + session.access_token }
});
const out = await resp.json();
if (!resp.ok || !out.ok || !out.url) throw new Error(out.error || 'Download failed');
window.location.href = out.url; // triggers download
} catch (err) {
console.error(err);
alert(err.message || 'Could not create download');
} finally {
btn.disabled = false; btn.textContent = old;
}
});
Your app purchases appear here.
No purchases yet.
Subscription
Current plan and renewal.
No active subscription.
Payment Method
Managed securely via Stripe.