Remove every MoonPay mention and link (ZeroFox/MoonPay false-positive takedown, 2026-10-26)
- server.js: /api/moonpay-url endpoint deleted (MOONPAY_PUBLIC_KEY / MOONPAY_SECRET_KEY env and siteConfig().moonpayPublicKey no longer read)
- admin.js: moonpayPublicKey settings label dropped
- credits.html + credits-screen.js: "Buy POL with a card" button and handler removed
- my.js: openMoonpay() and the card-buy button removed; the New to crypto note now points to /wallets ("Wallet help")
- wallets.html + wallets.js: card section rewritten neutrally (any major exchange or on-ramp, POL on Polygon, your own address), wlMoonpay button logic, in-wallet note and MoonPay FAQ/disclaimer replaced
- chatbot.js: wallets canned answer, tags/regex and FACTS rewritten with no brand named
- kb-seed.js: f-moonpay-declined replaced by f-card-declined (the old seed is retired from kb.json on the next boot unless it was admin-edited)
- qa/kb-retrieval.cjs: case updated to f-card-declined
- cache tags bumped: credits-screen.js, my.js, wallets.js ?v=20261026a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1445,27 +1445,6 @@ const server = http.createServer(async (req, res) => {
|
||||
emailAuth: (mailer.hasKey() || !IS_PROD) && SIGNUPS_OPEN,
|
||||
signupsOpen: SIGNUPS_OPEN }, pubSite));
|
||||
}
|
||||
if (p === '/api/moonpay-url' && req.method === 'GET') {
|
||||
// Card on-ramp deep link. With MoonPay keys set — PUBLIC key via
|
||||
// MOONPAY_PUBLIC_KEY env or site config, SECRET key via MOONPAY_SECRET_KEY
|
||||
// env ONLY (never site config, since /api/config exposes siteConfig) —
|
||||
// returns a SIGNED checkout URL prefilled with the buyer's own wallet and
|
||||
// a POL amount; otherwise a generic MoonPay buy page. Zero custody either
|
||||
// way: MoonPay is merchant of record and the crypto goes straight to the
|
||||
// buyer's wallet — this site never touches or holds anyone's money.
|
||||
const addr = (u.searchParams.get('address') || '').trim();
|
||||
let pol = Math.round(Number(u.searchParams.get('pol')) || 0);
|
||||
if (!pol || pol < 30) pol = 30;
|
||||
if (pol > 100000) pol = 100000;
|
||||
const pk = (process.env.MOONPAY_PUBLIC_KEY || siteConfig().moonpayPublicKey || '').trim();
|
||||
const sk = (process.env.MOONPAY_SECRET_KEY || '').trim();
|
||||
if (pk && sk && /^0x[0-9a-fA-F]{40}$/.test(addr)) {
|
||||
const qs = '?apiKey=' + encodeURIComponent(pk) + '¤cyCode=pol_polygon&walletAddress=' + encodeURIComponent(addr) + '"eCurrencyAmount=' + pol;
|
||||
const sig = crypto.createHmac('sha256', sk).update(qs).digest('base64');
|
||||
return json(res, 200, { url: 'https://buy.moonpay.com/' + qs + '&signature=' + encodeURIComponent(sig), signed: true, pol });
|
||||
}
|
||||
return json(res, 200, { url: 'https://www.moonpay.com/buy/matic', signed: false, pol }); // MoonPay's Polygon page still lives at the old slug; /buy/pol renders their 404 (same fix as RM Circle)
|
||||
}
|
||||
if (p === '/api/catalog' && req.method === 'GET') {
|
||||
// five live quotes per call: serve a 20-second cache so pages that load the
|
||||
// ladder (join, home, buy) are not waiting on the RPC every time
|
||||
|
||||
Reference in New Issue
Block a user