Google 应用内购买总是退款
Google In-App Purchase are always refunded
我在 google 应用内购买方面遇到了一些问题。所有收到的付款将在 72 小时后退还。我的付款代码有误吗?我自己付了钱,没有要求退款,但即使是72小时后也退款了。
play_console_screenshot
private void setupBilling() {
mBillingClient = BillingClient.newBuilder(MainActivity.this).setListener(this).enablePendingPurchases().build();
mBillingClient.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(BillingResult billingResult) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
final List<String> skuList = new ArrayList<> ();
skuList.add("remove_ads");
final SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder();
params.setSkusList(skuList).setType(BillingClient.SkuType.INAPP);
mBillingClient.querySkuDetailsAsync(params.build(), new SkuDetailsResponseListener() {
@Override
public void onSkuDetailsResponse(BillingResult billingResult, List<SkuDetails> list) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK && list != null) {
BillingFlowParams flowParams = BillingFlowParams.newBuilder()
.setSkuDetails(list.get(0))
.build();
mBillingClient.launchBillingFlow(MainActivity.this, flowParams);
}
}
});
}else{
Toast.makeText(MainActivity.this, "error", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onBillingServiceDisconnected() {
Toast.makeText(MainActivity.this, "error", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onPurchasesUpdated(BillingResult billingResult, @Nullable List<Purchase> list) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK
&& list != null) {
for (Purchase purchase : list) {
if(purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED){
Toast.makeText(MainActivity.this, purchase.getSku() + " ok", Toast.LENGTH_SHORT).show();
}
}
} else if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.USER_CANCELED) {
Toast.makeText(this, "İptal edildi", Toast.LENGTH_SHORT).show();
} else if(billingResult.getResponseCode() == BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED) {
Toast.makeText(this, "alreadry owned", Toast.LENGTH_LONG).show();
}else{
Toast.makeText(this, "error", Toast.LENGTH_SHORT).show();
}
}
您似乎没有正确确认购买。
If you use the Google Play Billing Library version 2.0 or newer, you
must acknowledge all purchases within three days. Failure to properly
acknowledge purchases results in those purchases being refunded.
您可以在文档中找到更多详细信息:https://developer.android.com/google/play/billing/billing_library_overview#acknowledge
BillingClient client = ...
AcknowledgePurchaseResponseListener acknowledgePurchaseResponseListener = ...
void handlePurchase(Purchase purchase) {
if (purchase.getPurchaseState() == PurchaseState.PURCHASED) {
// Grant entitlement to the user.
...
// Acknowledge the purchase if it hasn't already been acknowledged.
if (!purchase.isAcknowledged()) {
AcknowledgePurchaseParams acknowledgePurchaseParams =
AcknowledgePurchaseParams.newBuilder()
.setPurchaseToken(purchase.getPurchaseToken())
.build();
client.acknowledgePurchase(acknowledgePurchaseParams, acknowledgePurchaseResponseListener);
}
}
}
我在 google 应用内购买方面遇到了一些问题。所有收到的付款将在 72 小时后退还。我的付款代码有误吗?我自己付了钱,没有要求退款,但即使是72小时后也退款了。
play_console_screenshot
private void setupBilling() {
mBillingClient = BillingClient.newBuilder(MainActivity.this).setListener(this).enablePendingPurchases().build();
mBillingClient.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(BillingResult billingResult) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
final List<String> skuList = new ArrayList<> ();
skuList.add("remove_ads");
final SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder();
params.setSkusList(skuList).setType(BillingClient.SkuType.INAPP);
mBillingClient.querySkuDetailsAsync(params.build(), new SkuDetailsResponseListener() {
@Override
public void onSkuDetailsResponse(BillingResult billingResult, List<SkuDetails> list) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK && list != null) {
BillingFlowParams flowParams = BillingFlowParams.newBuilder()
.setSkuDetails(list.get(0))
.build();
mBillingClient.launchBillingFlow(MainActivity.this, flowParams);
}
}
});
}else{
Toast.makeText(MainActivity.this, "error", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onBillingServiceDisconnected() {
Toast.makeText(MainActivity.this, "error", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onPurchasesUpdated(BillingResult billingResult, @Nullable List<Purchase> list) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK
&& list != null) {
for (Purchase purchase : list) {
if(purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED){
Toast.makeText(MainActivity.this, purchase.getSku() + " ok", Toast.LENGTH_SHORT).show();
}
}
} else if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.USER_CANCELED) {
Toast.makeText(this, "İptal edildi", Toast.LENGTH_SHORT).show();
} else if(billingResult.getResponseCode() == BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED) {
Toast.makeText(this, "alreadry owned", Toast.LENGTH_LONG).show();
}else{
Toast.makeText(this, "error", Toast.LENGTH_SHORT).show();
}
}
您似乎没有正确确认购买。
If you use the Google Play Billing Library version 2.0 or newer, you must acknowledge all purchases within three days. Failure to properly acknowledge purchases results in those purchases being refunded.
您可以在文档中找到更多详细信息:https://developer.android.com/google/play/billing/billing_library_overview#acknowledge
BillingClient client = ...
AcknowledgePurchaseResponseListener acknowledgePurchaseResponseListener = ...
void handlePurchase(Purchase purchase) {
if (purchase.getPurchaseState() == PurchaseState.PURCHASED) {
// Grant entitlement to the user.
...
// Acknowledge the purchase if it hasn't already been acknowledged.
if (!purchase.isAcknowledged()) {
AcknowledgePurchaseParams acknowledgePurchaseParams =
AcknowledgePurchaseParams.newBuilder()
.setPurchaseToken(purchase.getPurchaseToken())
.build();
client.acknowledgePurchase(acknowledgePurchaseParams, acknowledgePurchaseResponseListener);
}
}
}