00e62bb010
Free tier: - checkout-stripe.el bails out immediately for plan=free (no Stripe init) - checkout-auth.el skips payment section reveal and initStripe for free plan - checkout-free.el shows #free-success panel after auth (no card ever shown) - /api/payment-intent returns early for free plan — no Stripe call Stripe dedup (all paid plans): - Stripe init now deferred to window.initStripe(email, name), called by checkout-auth.el after sign-in — email is known before intent is created - /api/payment-intent finds-or-creates Stripe Customer by email before creating the PaymentIntent/SetupIntent and attaches customer upfront - Eliminates the window between intent creation and /api/link-customer that was producing duplicate guest customers
21 lines
751 B
EmacsLisp
21 lines
751 B
EmacsLisp
// checkout-free.el -- Free plan: show success panel after auth completes.
|
|
// Watches the auth-badge element; when it becomes visible, hides the auth
|
|
// section and shows the free-success panel. No card required for free tier.
|
|
// Compiled with: elc --target=js --bundle --minify --obfuscate
|
|
|
|
fn main() -> Void {
|
|
native_js("(function() {
|
|
var success = document.getElementById('free-success');
|
|
var auth = document.getElementById('auth-section');
|
|
if (!success) return;
|
|
var timer = setInterval(function() {
|
|
var badge = document.getElementById('auth-badge');
|
|
if (badge && badge.offsetParent !== null) {
|
|
if (auth) auth.style.display = 'none';
|
|
success.style.display = '';
|
|
clearInterval(timer);
|
|
}
|
|
}, 150);
|
|
})()")
|
|
}
|