only check for google play purchase support of this method is requested

This commit is contained in:
Jonas Lochmann
2026-07-13 02:00:00 +02:00
parent 1e5e74659e
commit 52bde0bc23
+5 -5
View File
@@ -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,