BixPay card integration, phase 1 (Marty approved the copy 2026-10-29; docs/BIXPAY-INTEGRATION.md): gated by site config bixpayLive (off by default). Profile > BixPay card field (partner link validated: bix.ibportal.io/auth/register, e= token, a=1; the appId=3 card-customer link is refused with a message), bixpay.js resolver own > sponsor chain (10 levels) > company link (bixCompanyLink, seeded with Marty's partner link), every surface says whose link it is. Wallet tab card, one-week Overview announcement (24 h snooze), one sentence in TierPaid payout emails and the games' wallet nudges, Promo tools > BixPay tab (3 posts, email swipe, 4 text-only banners on the Spaces CDN, tracked link + per-member clicks), public guide /bixpay with masked app screenshots, chatbot canned answers + facts gated to 'coming soon' while off (KNOWLEDGE_DATE 2026-10-29). Clicks per surface via /go/bixpay in the admin Traffic tab; admin Overview counts members with a link; member card shows it; signed /api/partner/bixpay and the lssync profile row carry it for LinkSpin/CTB. accounts.bix_partner_link column (db.js alterSafe). Tests: qa/bixpay.test.cjs (17) + walk.mjs BixPay block; my.js/promo.js/admin.js ?v=20261029bx.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -36,6 +36,7 @@ const pub = a => a ? { email: a.email, sponsorRef: a.sponsorRef || '', code: a.c
|
||||
username: a.username || null, memberId: a.memberId || 0, joinedVia: a.joinedVia || null, joinedRef: a.joinedRef || null,
|
||||
lineBannerUrl: a.lineBannerUrl || null, lineTargetUrl: a.lineTargetUrl || null, wallOffers: a.wallOffers || null,
|
||||
avatarUrl: a.avatarUrl || null, bio: a.bio || null, socials: a.socials || null,
|
||||
bixPartnerLink: a.bixPartnerLink || null, // BixPay partner link (bixpay.js, 2026-10-29): one identity, follows the member to LinkSpin/CTB
|
||||
chatAvailable: a.chatAvailable === false ? false : true, lastSeen: a.lastSeen || 0,
|
||||
address: a.address || null, created: a.created } : null;
|
||||
const USER_RE = /^[a-zA-Z0-9_]{3,20}$/;
|
||||
@@ -125,6 +126,7 @@ const J = {
|
||||
this.save();
|
||||
return { ok: true, account: pub(acct) };
|
||||
},
|
||||
async setBixLink(e, link) { const acct = this.db.byEmail[e]; if (!acct) return { error: 'No such account.' }; acct.bixPartnerLink = link || null; this.save(); return { ok: true, account: pub(acct) }; },
|
||||
async touchSeen(e) { const a = this.db.byEmail[e]; if (a) { a.lastSeen = Date.now(); this.save(); } },
|
||||
async setChatAvailable(e, v) { const a = this.db.byEmail[e]; if (!a) return { error: 'No such account.' }; a.chatAvailable = !!v; this.save(); return { ok: true, available: !!v }; },
|
||||
async getMutes(e) { const a = this.db.byEmail[e]; return (a && Array.isArray(a.chatMutes)) ? a.chatMutes : []; },
|
||||
@@ -228,7 +230,7 @@ const J = {
|
||||
const rowPub = r => r ? pub({ email: r.email, sponsorRef: r.sponsor_ref, code: r.code,
|
||||
username: r.username, memberId: r.member_id || 0, joinedVia: r.joined_via || null, joinedRef: r.joined_ref || null,
|
||||
lineBannerUrl: r.line_banner_url, lineTargetUrl: r.line_target_url, wallOffers: r.wall_offers || null,
|
||||
avatarUrl: r.avatar_url, bio: r.bio, socials: r.socials,
|
||||
avatarUrl: r.avatar_url, bio: r.bio, socials: r.socials, bixPartnerLink: r.bix_partner_link || null,
|
||||
chatAvailable: r.chat_available === 0 ? false : true, lastSeen: Number(r.last_seen || 0),
|
||||
address: r.address, created: Number(r.created) }) : null;
|
||||
const D = {
|
||||
@@ -289,6 +291,7 @@ const D = {
|
||||
if (socials !== undefined) await db.q('UPDATE accounts SET socials=? WHERE email=?', [socials || null, e]);
|
||||
return { ok: true, account: await this.byEmail(e) };
|
||||
},
|
||||
async setBixLink(e, link) { const r = await db.q('UPDATE accounts SET bix_partner_link=? WHERE email=?', [link || null, e]); if (!r || !r.affectedRows) return { error: 'No such account.' }; return { ok: true, account: await this.byEmail(e) }; },
|
||||
async touchSeen(e) { await db.q('UPDATE accounts SET last_seen=? WHERE email=?', [Date.now(), e]); },
|
||||
async setChatAvailable(e, v) { await db.q('UPDATE accounts SET chat_available=? WHERE email=?', [v ? 1 : 0, e]); return { ok: true, available: !!v }; },
|
||||
async getMutes(e) {
|
||||
@@ -504,6 +507,7 @@ module.exports = { init, signup, login, ensure, onChange, isUnclaimedShell, byEm
|
||||
setLineBanner: (e, b, t) => impl().setLineBanner(String(e || '').toLowerCase(), b, t),
|
||||
setWallOffers: (e, j) => impl().setWallOffers(String(e || '').toLowerCase(), j),
|
||||
setProfile: async (e, a, bio, socials) => { const r = await impl().setProfile(String(e || '').toLowerCase(), a, bio, socials); if (!(r && r.error)) changed(String(e || '').toLowerCase()); return r; }, // profile edits reach LinkSpin too
|
||||
setBixLink: async (e, link) => { const r = await impl().setBixLink(normEmail(e), link ? String(link).slice(0, 300) : null); if (!(r && r.error)) changed(normEmail(e)); return r; }, // the BixPay partner link rides to LinkSpin in the profile row (lssync.js)
|
||||
touchSeen: e => impl().touchSeen(String(e || '').toLowerCase()),
|
||||
adminSetAddress: (e, a) => impl().adminSetAddress(String(e || '').toLowerCase(), a ? normAddr(a) : null),
|
||||
positionByAddress: a => impl().positionByAddress(normAddr(a)),
|
||||
|
||||
Reference in New Issue
Block a user