diff --git a/web-next/app/api/store/send/route.ts b/web-next/app/api/store/send/route.ts index b43e54b..fa94b11 100644 --- a/web-next/app/api/store/send/route.ts +++ b/web-next/app/api/store/send/route.ts @@ -62,6 +62,7 @@ export async function POST(request: Request) { bnetEmail: session.bnetEmail, account: session.username, character, + ip, }) const metadata = { service: 'store', order_ref: ref } diff --git a/web-next/lib/store.ts b/web-next/lib/store.ts index 4d7a0be..9b97707 100644 --- a/web-next/lib/store.ts +++ b/web-next/lib/store.ts @@ -208,7 +208,12 @@ export interface PricedCart { * su panel, así que es lo único que tendrán Stripe/SumUp para identificar un * pago si hay que reclamar o devolver algo a mano. * - * Formato: `Tienda · BNet · Cuenta · · Nombre (id) x2, …` + * Formato: `Tienda · BNet · Cuenta · · IP · Nombre (id) x2, …` + * + * OJO: la IP va aquí a propósito (identificar al pagador si hay fraude o una + * devolución a mano), pero esto se la manda a la pasarela; hasta ahora solo se + * guardaba en `home_stripelog.acore_ip`. Se omite si no se conoce, y también el + * 0.0.0.0 de relleno, que no dice nada. * * Se recorta a `MAX_CONCEPT`: Stripe y SumUp limitan el campo (~250-255), y un * carrito de 100 líneas se pasaría de largo. Se recortan solo los ÍTEMS, nunca @@ -219,13 +224,15 @@ const MAX_CONCEPT = 200 export function storeConcept( cart: PricedCart, - opts: { bnetEmail?: string; account?: string; character: string }, + opts: { bnetEmail?: string; account?: string; character: string; ip?: string }, ): string { + const ip = opts.ip && opts.ip !== '0.0.0.0' ? opts.ip : '' const head = [ 'Tienda', opts.bnetEmail ? `BNet ${opts.bnetEmail}` : null, opts.account ? `Cuenta ${opts.account}` : null, opts.character, + ip ? `IP ${ip}` : null, ] .filter(Boolean) .join(' · ')