Home›Setup Play Store
DRAFT

Setup Play Store

Panduan setup Google Play service account

JSON

💡 Ide & Konsep

Setup Google Play Service Account — Backend Billing API

Tujuan

Backend zx_parenting perlu akses Google Play Developer API untuk:

  • Verify subscription/IAP purchase (/api/billing/verify)
  • Acknowledge purchase (/api/billing/acknowledge)
  • RTDN webhook subscription expiry/cancel/pause (/api/billing/rtdn)

Step-by-step

1. Google Cloud Console

1. Buka console.cloud.google.com

2. Buat project baru (atau pakai existing): zx-parenting

3. Enable Google Play Developer API:

- APIs & Services → Library → search "Google Play Developer API" → Enable

2. Buat Service Account

1. IAM & Admin → Service Accounts → Create

2. Name: zx-parenting-billing

3. Role: tidak perlu tambahan (akan di-link via Play Console)

4. Create → selesai

3. Create JSON Key

1. Klik service account zx-parenting-billing

2. Keys tab → Add Key → Create New Key → JSON → Download

3. Simpan file JSON (berisi client_email, private_key, token_uri, dll)

4. Link ke Play Console

1. Buka play.google.com/console

2. Pilih app → Setup → API access → Service accounts

3. Invite service account (zx-parenting-billing@zxparenting.iam.gserviceaccount.com)

4. Grant Finance atau Admin role

5. Set Env di Coolify

Set 2 environment variables di Coolify app zx_parenting:

| Key | Value |

|-----|-------|

| GOOGLE_PLAY_PACKAGE_NAME | com.zxparenting.ortu |

| GOOGLE_PLAY_SERVICE_ACCOUNT_JSON | (isi lengkap JSON file) |

6. Test

curl -X POST https://zxparenting.zomet.my.id/api/billing/verify -H "Content-Type: application/json" -d '{"productId":"test","purchaseToken":"test","type":"subscription"}'

curl -X POST https://zxparenting.zomet.my.id/api/billing/verify -H "Content-Type: application/json" -d '{"productId":"test","purchaseToken":"test","type":"subscription"}'

Expected: 401 (auth ortu required) atau error verify (token invalid).
Bukan: 500 "GOOGLE_PLAY_SERVICE_ACCOUNT_JSON not set".

## Package Names
- App ortu: `com.zxparenting.ortu` (billing flow dari ortu)
- App anak: `com.zomet.zxparentingkids`

## Status
- ✅ Backend code complete: `/api/billing/verify`, `/api/billing/acknowledge`, `/api/billing/rtdn`
- ✅ `GOOGLE_PLAY_PACKAGE_NAME` set: `com.zxparenting.ortu`
- ✅ `GOOGLE_PLAY_SERVICE_ACCOUNT_JSON` set (project: zxparenting, email: zx-parenting-billing@zxparenting.iam.gserviceaccount.com)
- ✅ Service account linked to Play Console (Zomet Teknologi Indonesia)
- ✅ Env verified in container: PKG + SA JSON valid
- ✅ Endpoint `/api/billing/verify` returns 401 (auth gate works, not 500)

Expected: 401 (auth ortu required) atau error verify (token invalid).

Bukan: 500 "GOOGLE_PLAY_SERVICE_ACCOUNT_JSON not set".

Package Names

  • App ortu: com.zxparenting.ortu (billing flow dari ortu)
  • App anak: com.zomet.zxparentingkids

Status

  • ✅ Backend code complete: /api/billing/verify, /api/billing/acknowledge, /api/billing/rtdn
  • ✅ GOOGLE_PLAY_PACKAGE_NAME set: com.zxparenting.ortu
  • ✅ GOOGLE_PLAY_SERVICE_ACCOUNT_JSON set (project: zxparenting, email: zx-parenting-billing@zxparenting.iam.gserviceaccount.com)
  • ✅ Service account linked to Play Console (Zomet Teknologi Indonesia)
  • ✅ Env verified in container: PKG + SA JSON valid
  • ✅ Endpoint /api/billing/verify returns 401 (auth gate works, not 500)