跳到正文
DEV Community· Samya·· 2 小時前AI 評分44

Android 應用程式解鎖了購買內容,Google Play 收到處理確認了嗎?

Your app unlocked the purchase. Did Google Play get the confirmation?

AI 導讀

Android 應用程式完成購買後,須驗證交易、授予相應存取權,並通知 Google Play 已處理;符合退款條件但未確認的購買可能會被自動退款並撤銷權限。可用授權測試員和 Play 測試付款方式檢查內容是否解鎖,以及 Google Play 是否已確認交易。測試購買的退款時限較短,不應用作正式環境的期限。

正文

Kordelis profile image Samya

Someone buys a chapter in your Android app. It opens, and they start reading. From the app screen, the purchase looks finished.

There is one more result to check: did Google Play receive confirmation that your app processed it?

The 30-second illustration shows those two outcomes side by side. It is an example flow, not a recording of a customer purchase.

What can go wrong

For a completed purchase, your app needs to verify the purchase, grant the right access, and tell Play it was processed. If an eligible purchase is left unacknowledged, Play can automatically refund it and revoke the entitlement. A consumable follows a different final step: consuming it also fulfills the acknowledgment requirement. A pending purchase is different again; it should not unlock new access until it becomes PURCHASED.

A test worth running

Use a license tester and a Play test payment method for a non-consumable item. After the purchase completes, check both outcomes:

  1. Can the person open exactly what they bought?
  2. Is the purchase acknowledged in Play, rather than only marked accessible in the app?

Then close and reopen the app. The correct access should still be there, without a second grant or a new purchase prompt. Repeat the exercise for any consumable or pending flow you support; their expected outcomes differ. Play's test-purchase timing is accelerated, so do not use the test refund window as the production deadline.

This small test catches a gap that is easy to miss when you watch only the app screen. It also gives you two concrete places to investigate when a purchase is later refunded: the app's entitlement record and Play's processing state.

References: Google Play purchase processing · Testing Play Billing

Prepared with AI assistance and checked against the linked Google documentation.

來源:DEV Community · dev.to