[android] Added specific handling of 'User_cancelled' error while ads payment

This commit is contained in:
Alexander Zatsepin 2018-09-18 21:31:30 +03:00 committed by yoksnod
parent f56772a18c
commit 1602699a5a

View file

@ -127,6 +127,12 @@ public class PlayStoreBillingManager implements BillingManager<PlayStoreBillingC
@Override
public void onPurchasesUpdated(int responseCode, @Nullable List<Purchase> purchases)
{
if (responseCode == BillingResponse.USER_CANCELED)
{
LOGGER.i(TAG, "Billing cancelled by user");
return;
}
if (responseCode != BillingResponse.OK || purchases == null || purchases.isEmpty())
{
LOGGER.e(TAG, "Billing failed. Response code: " + responseCode);