Panduan setup Google Play service account
Backend zx_parenting perlu akses Google Play Developer API untuk:
/api/billing/verify)/api/billing/acknowledge)/api/billing/rtdn)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
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
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)
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
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) |
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".
com.zxparenting.ortu (billing flow dari ortu)com.zomet.zxparentingkids/api/billing/verify, /api/billing/acknowledge, /api/billing/rtdnGOOGLE_PLAY_PACKAGE_NAME set: com.zxparenting.ortuGOOGLE_PLAY_SERVICE_ACCOUNT_JSON set (project: zxparenting, email: zx-parenting-billing@zxparenting.iam.gserviceaccount.com)/api/billing/verify returns 401 (auth gate works, not 500)