Skip to content

Conversation

@benrobson
Copy link
Member

Motivation

  • Replace the external redirect with a built-in webstore so players can buy items (subscriptions and one-time) while ensuring purchases are tied to a verified Minecraft username.
  • Use Stripe Checkout for safe payments and accept only server-confirmed events via webhooks before applying in-game commands.
  • Enqueue commands into the existing Bridge processor and record all actions so fulfillment is auditable and retryable.
  • Notify staff via Discord and add database schema to persist purchases, webhook events and command-run tracking.

Description

  • Added a storefront and checkout flow with new web routes: GET /webstore, POST /webstore/checkout and a thank-you page, plus views and webstoreItems.json catalog.
  • Implemented webhook processing at POST /api/webstore/stripe/webhook with Stripe signature verification, idempotent event recording, purchase payment update, and enqueueing of Bridge tasks via the internal /api/bridge/processor/command/add.
  • Added controllers/webstoreController.js, DB migrations and dbinit.sql changes to create webstorePurchases, webstoreCommandRuns and webstoreWebhookEvents, and a cron cron/webstoreCommandSyncCron.js to sync task status, retry failed commands and mark purchases fulfilled.
  • Wired the webhook route into the app boot, removed the external webstore redirect, and send staff notifications to the configured Discord webhook when purchases complete.

Testing

  • Attempted to install dependencies with npm install, but the run failed due to a 403 from the npm registry, so dependency installation did not complete.
  • No automated unit or integration tests were executed in this environment.
  • Manual runtime start/HTTP verification was not performed because config.json and environment Stripe/webhook secrets were not present.
  • Database migrations were added (migration/v1.8.0_v1.9.0.sql) and schema updates were applied to dbinit.sql for deployment-time verification.

Codex Task

@coderabbitai
Copy link

coderabbitai bot commented Dec 29, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants