Bỏ qua để đến nội dung

Mô hình tổng quan

Ba bên: game trên điện thoại, các dịch vụ của Google, và Portal trên VPS. Portal không bao giờ tin dữ liệu game gửi lên mà tự hỏi lại Google.

Điện thoại người chơi Game Drone Strike SDK tinysoft_game_kit Play Games SDK trên máy Play Billing trên máy Google Google Play Console • App com.tst.game.drone_strike • Play Games Services (app_id) • Sản phẩm in-app (SKU), license tester • Users & permissions: mời service account Google Cloud project • OAuth client "Web application" (web client id + secret) • Service account + file JSON (Android Publisher API) • Pub/Sub topic + push subscription • OAuth client Android (SHA-1) API Google mà Portal gọi oauth2.googleapis.com/token games/v1/players/me androidpublisher v3 (purchases) admob v1 networkReport (tùy chọn) VPS — Admin Portal backend (FastAPI) /api/v2/.../client/* Lưu trong Portal web client id/secret, Android package, SKU .env + credentials/ service account JSON, GOOGLE_PUBSUB_AUDIENCE cron đối soát 02:25 voided purchases 1 4 2 5 3·6 7
1 Game xin Play Games SDK đăng nhập, nhận server auth code. 2 Game gửi mã đó cho Portal (POST /api/v2/games/{id}/client/players/link). 3 Portal đổi mã bằng OAuth web client, hỏi Play Games API để biết đúng người chơi nào. 4 Game mua hàng qua Play Billing, nhận purchase token. 5 Game gửi token cho Portal (.../purchases/verify). 6 Portal xác minh, rồi acknowledge/consume bằng service account (Android Publisher API); cron 02:25 đối soát giao dịch bị hoàn tiền. 7 Google Play đẩy thông báo giao dịch/hoàn tiền qua Pub/Sub tới /webhooks/play-store (tùy chọn, mục 05).

Áp dụng cho Portal v1.2.2