diff --git a/apps/commerce/src/commerce.app.ts b/apps/commerce/src/commerce.app.ts index a4abc23..abca9d3 100644 --- a/apps/commerce/src/commerce.app.ts +++ b/apps/commerce/src/commerce.app.ts @@ -72,6 +72,18 @@ const app = new Hono() (c) => c.json(false) ) + .get( + '/purchaseRestriction/isplayerrestricted', + describeRoute({ + tags: ['Purchase'], + summary: 'Player purchase restriction status', + description: + 'No external payment restrictions are configured. The 2026 client expects a bare boolean.', + responses: { 200: json(BareBoolean, 'No purchase restriction') }, + }), + (c) => c.json(false) + ) + // Begin a purchase. The client asks for a transaction handle before it takes the // player to the platform store; nothing is charged or recorded here, so the id is a // fixed placeholder and the posted body is ignored. diff --git a/apps/commerce/src/test/integration/api.test.ts b/apps/commerce/src/test/integration/api.test.ts index a25cc1d..b3fa388 100644 --- a/apps/commerce/src/test/integration/api.test.ts +++ b/apps/commerce/src/test/integration/api.test.ts @@ -18,6 +18,12 @@ describe('commerce endpoints', () => { expect(await res.json()).toBe(false) }) + it('2026 purchase restriction response is a bare boolean', async () => { + const res = await SELF.fetch(`${ORIGIN}/purchaseRestriction/isplayerrestricted`) + expect(res.status).toBe(200) + expect(await res.json()).toBe(false) + }) + it('POST /purchase/v1/initiatepurchase returns a transaction id', async () => { const res = await SELF.fetch(`${ORIGIN}/purchase/v1/initiatepurchase`, { method: 'POST', @@ -88,6 +94,7 @@ describe('commerce endpoints', () => { 'GET /api/catalog/v1/all', 'GET /purchase/v1/cleanuppending', 'GET /purchase/v1/hasspentmoney', + 'GET /purchaseRestriction/isplayerrestricted', 'GET /purchasecampaign/allcurrent/v2', 'GET /reminder/currentTokenBundles/v2', 'POST /purchase/v1/cleanuppending',