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,