feat(billing): Google Play build shows "not implemented" for coin buys
CI/CD / CI - API (dotnet build + engine sim) (push) Successful in 6m7s
CI/CD / CI - Web (tsc + next build) (push) Successful in 1m12s
CI/CD / Deploy - local stack (db + server + web) (push) Successful in 1m4s

Add a gated `googleplay` store flavor (NEXT_PUBLIC_STORE=googleplay) so the
appeal/Play build ships a payment-free coin shop. isPurchaseDisabled() makes
BuyCoinsScreen short-circuit to a "not implemented" notice instead of starting
ZarinPal or Iranian IAB (both rejected on Play). Default web/Bazaar/Myket
builds are unaffected. New i18n key buy.notImplemented (fa+en).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-21 05:00:15 +03:30
parent b12a7c7813
commit 5f43392de2
3 changed files with 24 additions and 3 deletions
+9 -1
View File
@@ -6,7 +6,7 @@ import { ScreenHeader, ScreenShell } from "@/components/online/ScreenHeader";
import { useSessionStore } from "@/lib/session-store";
import { useI18n } from "@/lib/i18n";
import { getService } from "@/lib/online/service";
import { consumeStorePurchase, isStoreBilling, purchaseViaStore } from "@/lib/storeBilling";
import { consumeStorePurchase, isPurchaseDisabled, isStoreBilling, purchaseViaStore } from "@/lib/storeBilling";
import { sound } from "@/lib/sound";
import { CoinPack } from "@/lib/online/types";
import { cn } from "@/lib/cn";
@@ -39,6 +39,14 @@ export function BuyCoinsScreen() {
setBusy(p.id);
setMsg("");
// Google Play build: coin purchases are intentionally not wired (no Iranian
// IAB on Play). Show a notice instead of starting any payment flow.
if (isPurchaseDisabled()) {
setMsg(t("buy.notImplemented"));
setBusy(null);
return;
}
// Inside a store build (Cafe Bazaar / Myket), route through store billing.
if (isStoreBilling()) {
try {