-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckout.html
More file actions
110 lines (104 loc) · 4.89 KB
/
Copy pathcheckout.html
File metadata and controls
110 lines (104 loc) · 4.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Complete Your Order — SovereignTrust</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/main.css">
<script src="/js/auth.js"></script>
<script src="/js/trust-api.js"></script>
<script>requireAuth();</script>
</head>
<body>
<nav>
<a class="nav-logo" href="/">
<div class="nav-logo-mark">S</div>
<div class="nav-logo-text">Sovereign Trust</div>
</a>
<div class="nav-links" id="navLinks">
<a class="nav-link" href="/education.html">Education</a>
<a class="nav-link" href="/dashboard.html">Dashboard</a>
<a class="nav-link" href="/settings.html">Settings</a>
<a class="nav-link" href="/login.html">Sign in</a>
<a class="nav-cta" href="/register.html">Create Account</a>
</div>
<button class="nav-hamburger" onclick="toggleMobileMenu()" aria-label="Open menu">
<span></span><span></span><span></span>
</button>
</nav>
<div class="checkout-wrap">
<!-- PAYMENT FORM -->
<div>
<h1 class="checkout-title">Complete Your Order</h1>
<p class="checkout-sub">Your trust documents will be generated immediately upon payment confirmation.</p>
<div class="alert-error" id="checkoutError"></div>
<div class="checkout-section-label">Payment</div>
<p style="font-size:14px; color:var(--text-mid); line-height:1.7; font-weight:300;">
You'll be taken to Stripe's secure checkout to enter your card details.
SovereignTrust never sees or stores your card information.
</p>
<div class="stripe-badge">
<svg viewBox="0 0 60 25" xmlns="http://www.w3.org/2000/svg"><text y="18" font-size="16" fill="#635BFF" font-family="sans-serif" font-weight="bold">stripe</text></svg>
Payments secured and processed by Stripe
</div>
<button class="btn-navy" id="payBtn" style="width:100%; padding:16px; margin-top:24px; font-size:16px;">Pay £111.00 with Stripe →</button>
<div style="font-size:12px; color:var(--text-muted); text-align:center; margin-top:12px; font-weight:300;">🔒 256-bit SSL encryption · Your card details are never stored by SovereignTrust</div>
</div>
<!-- ORDER SUMMARY -->
<div class="checkout-summary">
<h3>Order Summary</h3>
<div class="summary-item"><span style="color:var(--text-muted);">Express Trust Deed Package</span><span>£111.00</span></div>
<div style="font-size:12px; color:var(--text-muted); margin:-4px 0 12px; font-weight:300;">For: <span id="checkoutTrustName">—</span></div>
<div class="summary-item"><span style="color:var(--text-muted);">VAT (0%)</span><span>£0.00</span></div>
<div class="summary-total"><span>Total</span><span>£111.00</span></div>
<div class="secure-note">Documents generated immediately upon successful payment confirmation.</div>
<div style="margin-top:20px; padding:14px; background:var(--cream); border-radius:var(--radius-md);">
<div style="font-size:12px; color:var(--text-muted); font-weight:300; line-height:1.6;">By completing payment you confirm you have read and agree to our Terms of Service and understand that this platform provides educational document preparation only, not legal advice.</div>
</div>
</div>
</div>
<script src="/js/app.js"></script>
<script>
const trustId = new URLSearchParams(window.location.search).get('id');
const payBtn = document.getElementById('payBtn');
const errorEl = document.getElementById('checkoutError');
let currentTrust = null;
(async function init() {
if (!trustId) {
errorEl.textContent = 'No trust selected — please start from the builder.';
payBtn.disabled = true;
return;
}
try {
const cached = sessionStorage.getItem('trustData_' + trustId);
if (cached) { try { currentTrust = JSON.parse(cached); } catch {} }
if (!currentTrust) currentTrust = await getTrustById(trustId);
if (!currentTrust) {
errorEl.textContent = 'Trust not found.';
payBtn.disabled = true;
return;
}
document.getElementById('checkoutTrustName').textContent = currentTrust.name || currentTrust.data?.overview?.name || 'Untitled Trust';
} catch (err) {
errorEl.textContent = err.message;
payBtn.disabled = true;
}
})();
payBtn.addEventListener('click', async () => {
errorEl.textContent = '';
payBtn.disabled = true;
payBtn.textContent = 'Redirecting to Stripe…';
try {
const { url } = await createCheckoutSession({ id: trustId, name: currentTrust?.name });
window.location.href = url;
} catch (err) {
errorEl.textContent = err.message;
payBtn.disabled = false;
payBtn.textContent = 'Pay £111.00 with Stripe →';
}
});
</script>
</body>
</html>