Add integrated checkout, child safety section, and content polish
- checkout.el: Custom Stripe Payment Element page at /checkout?plan=... - safety.el: Hard Bell and emergency routing architecture section - main.el: Wire checkout + safety, /api/payment-intent, STRIPE_PUBLISHABLE_KEY - enterprise_terms.el: Add nav bar (was missing, page had no navigation) - styles.el: Checkout buttons now link to integrated page, not hosted Stripe - El runtime: Auto-detect HTML responses, serve text/html vs application/json - footer.el: Wordmark image centered above "Built Different." tagline - environmental.el: Replace SQLite with custom on-device storage - enterprise.el: Replace SQLite with custom on-device storage - pricing.el: Local models degraded performance note near Ollama feature - about.el: "left home at fifteen", remove programming language mention
This commit is contained in:
+2
-22
@@ -1401,32 +1401,12 @@ fn page_close() -> String {
|
||||
pollFoundingCount();
|
||||
setInterval(pollFoundingCount, 90000);
|
||||
|
||||
// Stripe checkout
|
||||
// Checkout buttons — navigate to integrated payment page
|
||||
var checkoutBtns = document.querySelectorAll('[data-checkout]');
|
||||
checkoutBtns.forEach(function(btn) {
|
||||
btn.addEventListener('click', function() {
|
||||
var plan = btn.getAttribute('data-checkout');
|
||||
var origText = btn.textContent;
|
||||
btn.textContent = 'Loading...';
|
||||
btn.disabled = true;
|
||||
fetch('/api/checkout', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ plan: plan })
|
||||
})
|
||||
.then(function(r) { return r.json(); })
|
||||
.then(function(data) {
|
||||
if (data.url) {
|
||||
window.location.href = data.url;
|
||||
} else {
|
||||
btn.textContent = 'Error — try again';
|
||||
btn.disabled = false;
|
||||
}
|
||||
})
|
||||
.catch(function() {
|
||||
btn.textContent = 'Error — try again';
|
||||
btn.disabled = false;
|
||||
});
|
||||
window.location.href = '/checkout?plan=' + plan;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user