From 52bde0bc23b539694c51a753191e9e0c11b9c278 Mon Sep 17 00:00:00 2001 From: Jonas Lochmann Date: Mon, 13 Jul 2026 02:00:00 +0200 Subject: [PATCH] only check for google play purchase support of this method is requested --- src/api/purchase.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/purchase.ts b/src/api/purchase.ts index 93332d1..fdc5a60 100644 --- a/src/api/purchase.ts +++ b/src/api/purchase.ts @@ -37,16 +37,16 @@ export const createPurchaseRouter = ({ database, websocket }: { const router = Router() router.post('/can-do-purchase', json(), async (req, res, next) => { - if (!areGooglePlayPaymentsPossible) { - res.json({ canDoPurchase: 'no because not supported by the server' }) - return - } - try { if (!isCanDoPurchaseRequest(req.body)) { throw new BadRequest() } + if (req.body.type === 'googleplay' && !areGooglePlayPaymentsPossible) { + res.json({ canDoPurchase: 'no because not supported by the server' }) + return + } + const result: boolean = await database.transaction(async (transaction) => { const familyEntry = await requireFamilyEntry({ database,