feat(registry): Steam: link an account to a Steam id and buy through ISteamMicroTxn #18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/registry-steam"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Premium phase 7, registry side. The Steamworks.NET client waits for phase 2 (playground Entitlements).
What it adds (registry/steam.go, README "Steam purchases"):
POST /api/v1/steam/link: checks a Web API auth ticket withISteamUserAuth/AuthenticateUserTicketand stores the Steam id inaccount_identities(providersteam). One Steam id per account, one account per Steam id.POST /api/v1/steam/purchases:InitTxnat the catalog price,usersession=client. ThenPOST .../{orderId}/finalize(FinalizeTxn, which grants with sourcesteam, receipt = order id) andGET .../{orderId}(QueryTxn). When a finalize fails,QueryTxndecides what happens.GetReportpass from a stored cursor revokesRefundedandChargedbackorders and grants anySucceededorder the client never finalized.POST /api/v1/admin/steam/reconcileruns the pass on demand.STEAM_WEB_API_KEYandSTEAM_APPSare set.STEAM_ENVIRONMENTdefaults to sandbox (ISteamMicroTxnSandbox).steam_ordersandsteam_report_cursors, plus a unique(account_id, provider)index onaccount_identities, which replaces the plain account index.gamePairsnow does theEDGEGAP_APPSandSTEAM_APPSparsing, andsellableItemholds the active, owned and free checks for both Square checkout and Steam.assumed: one
STEAM_APPSgame=appid map instead of a single app id, because the registry serves several games.assumed: prices go to Steam in USD cents and Steam converts them for the player.
assumed:
PartialRefundkeeps the item (an order holds one item). Only full refunds and chargebacks revoke.assumed: the ticket identity is
STEAM_TICKET_IDENTITY, defaultbnb-registry. The client must pass the same string.Checks:
go test ./...on the merged head: 116 tests pass, 6 of them new Steam tests running against a fake Steam Web API (off and 503, boot config, link conflicts, init/finalize/query grant and revoke, init failure, reconcile cursor and refund). This repo has no PR CI, so the local run is the gate.Not done: a real sandbox purchase. That needs the human Steamworks setup (README steps 1-5).
https://claude.ai/code/session_01BALUC1f7pXD9Fh4WLuymTG