I have some problems with google in-app purchase. All received payments are refunded after 72 hours. Is there an error in my payment codes? I paid myself and did not request any refund, but even that was refunded after 72 hours.
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();
}
}