为什么在 Google Play 中购买的应用内产品会自动退款?
Why in app product purchase in Google Play is automatically refunded?
将应用计费库更新为
实施 'com.android.billingclient:billing:2.0.1'
即使在 3 天后,我也开始看到退款。这怎么可能? Google 只提到 here 如果用户在购买后短时间内卸载应用程序,则购买退款。估计3天不短吧
用户必须在 3 天内确认购买,否则订阅将被退还:
https://developer.android.com/google/play/billing/billing_library_overview#acknowledge
在 PurchasesUpdatedListener
中执行以下操作
private val purchaseUpdateListener = PurchasesUpdatedListener { billingResult, purchases ->
for (purchase in purchases) {
if (purchase.purchaseState == Purchase.PurchaseState.PURCHASED) {
if (!purchase.isAcknowledged) {
val acknowledgePurchaseParams =
AcknowledgePurchaseParams.newBuilder()
.setPurchaseToken(purchase.purchaseToken).build()
billingClient?.acknowledgePurchase(acknowledgePurchaseParams) {
billingResult ->
val billingResponseCode = billingResult.responseCode
val billingDebugMessage = billingResult.debugMessage
Log.v("TAG_INAPP", "response code: $billingResponseCode")
Log.v("TAG_INAPP", "debugMessage : $billingDebugMessage")
}
}
}
此代码会将购买确认发送到 google 服务器。因此,通过您的应用进行的任何购买都将不再无效,也不会自动退款。
将应用计费库更新为 实施 'com.android.billingclient:billing:2.0.1' 即使在 3 天后,我也开始看到退款。这怎么可能? Google 只提到 here 如果用户在购买后短时间内卸载应用程序,则购买退款。估计3天不短吧
用户必须在 3 天内确认购买,否则订阅将被退还:
https://developer.android.com/google/play/billing/billing_library_overview#acknowledge
在 PurchasesUpdatedListener
中执行以下操作private val purchaseUpdateListener = PurchasesUpdatedListener { billingResult, purchases ->
for (purchase in purchases) {
if (purchase.purchaseState == Purchase.PurchaseState.PURCHASED) {
if (!purchase.isAcknowledged) {
val acknowledgePurchaseParams =
AcknowledgePurchaseParams.newBuilder()
.setPurchaseToken(purchase.purchaseToken).build()
billingClient?.acknowledgePurchase(acknowledgePurchaseParams) {
billingResult ->
val billingResponseCode = billingResult.responseCode
val billingDebugMessage = billingResult.debugMessage
Log.v("TAG_INAPP", "response code: $billingResponseCode")
Log.v("TAG_INAPP", "debugMessage : $billingDebugMessage")
}
}
}
此代码会将购买确认发送到 google 服务器。因此,通过您的应用进行的任何购买都将不再无效,也不会自动退款。