所有 Google 项 Play 订阅在试用期结束后均已退款
All Google Play subscriptions are refunded after trial period
我正在使用 com.android.billingclient:billing:2.0.1
开发 Android 应用程序。我的订阅有以下参数。
Billing period: 3 months
Free trial period: 3 days
Introductory price: -
Grace period: 3 days
但全部(>100)购买成功3天后退款。我不明白原因。
这是典型订单历史记录的屏幕截图:
用户问为什么会这样。我不认为他们所有人都选择 return 钱。
我的 BillingManager class:
public class BillingManager implements PurchasesUpdatedListener {
private BillingClient billingClient;
private final List<Purchase> purchases = new ArrayList<>();
public BillingManager(Context context) {
billingClient = BillingClient.newBuilder(context).enablePendingPurchases().setListener(this).build();
startConnection();
}
void startConnection() {
billingClient.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(BillingResult billingResult) {
final int responseCode = billingResult.getResponseCode();
if (responseCode == BillingResponseCode.OK) {
queryPurchases();
}
}
@Override
public void onBillingServiceDisconnected() {
retry();
}
});
}
void queryPurchases() {
PurchasesResult purchasesResult = billingClient.queryPurchases(SkuType.SUBS);
List<Purchase> cachedPurchaseList = purchasesResult.getPurchasesList();
onPurchasesUpdated(cachedPurchaseList);
}
@Override
public void onPurchasesUpdated(BillingResult billingResult, @Nullable List<Purchase> purchasesList) {
final int responseCode = billingResult.getResponseCode();
if (responseCode == BillingResponseCode.OK) {
onPurchasesUpdated(purchasesList);
} else if (responseCode == BillingResponseCode.USER_CANCELED) {
handleCanceledPurchase();
} else {
handleUnknownResponse();
}
}
private void onPurchasesUpdated(@Nullable List<Purchase> purchasesList) {
purchases.clear();
if (purchasesList != null) {
for (Purchase purchase : purchasesList) {
processPurchase(purchase);
}
}
notifyListener();
}
private void processPurchase(Purchase purchase) {
if (purchase.getPurchaseState() != PurchaseState.PURCHASED) {
return;
}
if (!verify(purchase)) {
return;
}
purchases.add(purchase);
}
public boolean shouldDoStuff() {
if (purchases.isEmpty()) {
return false;
} else {
for (Purchase purchase : purchases) {
if (purchase.getPurchaseState() != PurchaseState.PURCHASED) {
continue;
}
return true;
}
return false;
}
}
}
PS:应用程序在本地验证购买签名,统计显示结果是肯定的。
感谢您升级到 Play Billing Library 2.+。关于确认,您需要确认订阅和非消费性应用内产品。在确认期间,并且仅在确认期间,您可以选择设置有效负载。您设置的负载将在您查询购买时返回。
有关消耗品的重要说明。您无需确认消耗品。但是,如果您确实选择确认它们(无论出于何种原因),并且如果 - 进一步 - 您在确认时提交了有效负载:那么当您在 [=] 上调用 consumeAsync
时,您需要提交相同的有效负载17=].
您也可以通过 Android 或通过服务器 api 确认。
我正在使用 com.android.billingclient:billing:2.0.1
开发 Android 应用程序。我的订阅有以下参数。
Billing period: 3 months
Free trial period: 3 days
Introductory price: -
Grace period: 3 days
但全部(>100)购买成功3天后退款。我不明白原因。
这是典型订单历史记录的屏幕截图:
用户问为什么会这样。我不认为他们所有人都选择 return 钱。
我的 BillingManager class:
public class BillingManager implements PurchasesUpdatedListener {
private BillingClient billingClient;
private final List<Purchase> purchases = new ArrayList<>();
public BillingManager(Context context) {
billingClient = BillingClient.newBuilder(context).enablePendingPurchases().setListener(this).build();
startConnection();
}
void startConnection() {
billingClient.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(BillingResult billingResult) {
final int responseCode = billingResult.getResponseCode();
if (responseCode == BillingResponseCode.OK) {
queryPurchases();
}
}
@Override
public void onBillingServiceDisconnected() {
retry();
}
});
}
void queryPurchases() {
PurchasesResult purchasesResult = billingClient.queryPurchases(SkuType.SUBS);
List<Purchase> cachedPurchaseList = purchasesResult.getPurchasesList();
onPurchasesUpdated(cachedPurchaseList);
}
@Override
public void onPurchasesUpdated(BillingResult billingResult, @Nullable List<Purchase> purchasesList) {
final int responseCode = billingResult.getResponseCode();
if (responseCode == BillingResponseCode.OK) {
onPurchasesUpdated(purchasesList);
} else if (responseCode == BillingResponseCode.USER_CANCELED) {
handleCanceledPurchase();
} else {
handleUnknownResponse();
}
}
private void onPurchasesUpdated(@Nullable List<Purchase> purchasesList) {
purchases.clear();
if (purchasesList != null) {
for (Purchase purchase : purchasesList) {
processPurchase(purchase);
}
}
notifyListener();
}
private void processPurchase(Purchase purchase) {
if (purchase.getPurchaseState() != PurchaseState.PURCHASED) {
return;
}
if (!verify(purchase)) {
return;
}
purchases.add(purchase);
}
public boolean shouldDoStuff() {
if (purchases.isEmpty()) {
return false;
} else {
for (Purchase purchase : purchases) {
if (purchase.getPurchaseState() != PurchaseState.PURCHASED) {
continue;
}
return true;
}
return false;
}
}
}
PS:应用程序在本地验证购买签名,统计显示结果是肯定的。
感谢您升级到 Play Billing Library 2.+。关于确认,您需要确认订阅和非消费性应用内产品。在确认期间,并且仅在确认期间,您可以选择设置有效负载。您设置的负载将在您查询购买时返回。
有关消耗品的重要说明。您无需确认消耗品。但是,如果您确实选择确认它们(无论出于何种原因),并且如果 - 进一步 - 您在确认时提交了有效负载:那么当您在 [=] 上调用 consumeAsync
时,您需要提交相同的有效负载17=].
您也可以通过 Android 或通过服务器 api 确认。