Dosiye y'umwimerere ikora
public/app.js
Kode n'impapuro z'ingero zikora bigumana amazina n'inyandiko by'umwimerere. Isomo n'amabwiriza ya dosiye birabisobanura mu rurimi rwawe.
import { PAYMENT_LINK } from "./config.js";
const a = document.querySelector("#pay"),
s = document.querySelector("[role=status]");
try {
const u = new URL(PAYMENT_LINK);
if (
u.protocol !== "https:" ||
u.hostname !== "buy.stripe.com" ||
!u.pathname.startsWith("/test_") ||
u.href.includes("REPLACE")
)
throw Error();
a.href = u.href;
a.hidden = false;
s.textContent = "Test checkout only. Use Stripe test card details, never a real card.";
} catch {
s.textContent = "Set your own sandbox/test Payment Link in config.js.";
}