From f7235de220bb37535b353cd7a10936c134596439 Mon Sep 17 00:00:00 2001 From: Geoffrey Wu Date: Tue, 27 Oct 2026 00:15:05 -0400 Subject: [PATCH] Record the set price for manual payments made from a free packet getCost returns 0 for free packets such as the sample, which is right for playing but wrong for the amount paid on a per-set payment. Co-Authored-By: Claude Sonnet 5.5 --- routes/api/geoword/admin/record-payment.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/api/geoword/admin/record-payment.js b/routes/api/geoword/admin/record-payment.js index dd6ca3b7a..65f2d76c8 100644 --- a/routes/api/geoword/admin/record-payment.js +++ b/routes/api/geoword/admin/record-payment.js @@ -1,4 +1,5 @@ import getCost from '../../../../database/geoword/get-cost.js'; +import getSetPayment from '../../../../database/geoword/get-set-payment.js'; import recordPayment from '../../../../database/geoword/record-payment.js'; import getUserId from '../../../../database/account-info/get-user-id.js'; import getPacketStatus from '../../../../database/geoword/get-packet-status.js'; @@ -15,7 +16,8 @@ router.put('/', async (req, res) => { const userId = await getUserId(username); if (!userId) { return res.status(400).send('User not found'); } - const amountInCents = await getCost(packetName); + const setPayment = await getSetPayment(packetName); + const amountInCents = setPayment?.costInCents ?? await getCost(packetName); const result = await recordPayment(packetName, userId, { manual: true, amountInCents, recordedBy: res.locals.userId }); console.log(userId, result);