Replaces the throw-stub with full server-side verification: - Apple: POST verifyReceipt with prod->sandbox (21007) fallback, grants from the newest verified in_app product. - Google Play: purchases.products.get via the Play Developer API, with a service-account OAuth token minted from GOOGLE_SERVICE_ACCOUNT_JSON using jose (JWT-bearer grant) in economy/googleAuth.ts. - IAP_MODE=dev provider accepts dev:<productId> so the full purchase->grant flow runs locally with no store credentials. Gems come from a server-authoritative catalog (economy/products.ts) keyed by the verified productId, never a client field. New GET /economy/products exposes it. Wallet grant switched update->upsert so a first-purchase player still gets gems. 19 new tests (catalog, verification for all three paths, economy route e2e in dev mode). 98 backend tests green.
23 lines
964 B
Plaintext
23 lines
964 B
Plaintext
DATABASE_URL=postgresql://user:pass@ep-xxxx.neon.tech/siegebreak
|
|
REDIS_URL=redis://localhost:6379
|
|
JWT_SECRET=replace-me
|
|
MATCH_SERVER_SECRET=replace-me-server-to-server-only
|
|
# Comma-separated allowed browser origins; unset reflects any origin (dev only).
|
|
CORS_ORIGINS=http://localhost:5173
|
|
APPLE_TEAM_ID=
|
|
APPLE_CLIENT_ID=
|
|
GOOGLE_CLIENT_ID=
|
|
# In-app purchase verification. Set IAP_MODE=dev to accept "dev:<productId>"
|
|
# receipts locally (no store creds needed). Leave unset in prod to use the real
|
|
# Apple/Google verification paths below.
|
|
IAP_MODE=dev
|
|
# Apple: shared secret from App Store Connect (required for auto-renewables).
|
|
APPLE_SHARED_SECRET=
|
|
# Google: full service-account key JSON (single line) with androidpublisher access.
|
|
GOOGLE_SERVICE_ACCOUNT_JSON=
|
|
PHOTON_APP_ID=
|
|
# Realtime session provider for allocated matches: "local" (default) or "photon".
|
|
SESSION_PROVIDER=local
|
|
# Region stamped onto allocated sessions (informational for now).
|
|
MATCH_REGION=eu
|