diff --git a/.gitignore b/.gitignore index 456c0dd7..2dbe75c5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ gen/ !.idea/codeStyleSettings.xml build local.properties -gradle.properties +#gradle.properties .gradle *.iml .DS_Store diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..6b5ba814 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,6 @@ +# Project-wide Gradle settings. + +android.useAndroidX=true +android.enableJetifier=true + + diff --git a/library/src/main/java/com/anjlab/android/iab/v3/BillingProcessor.java b/library/src/main/java/com/anjlab/android/iab/v3/BillingProcessor.java index 8b757e56..548ec517 100644 --- a/library/src/main/java/com/anjlab/android/iab/v3/BillingProcessor.java +++ b/library/src/main/java/com/anjlab/android/iab/v3/BillingProcessor.java @@ -259,6 +259,19 @@ else if (responseCode == BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED) handleItemAlreadyOwned(purchasePayload.split(":")[1]); savePurchasePayload(null); } + + reportBillingError(responseCode, new Throwable(billingResult.getDebugMessage())); + + } + else if (responseCode == BillingClient.BillingResponseCode.USER_CANCELED + || responseCode == BillingClient.BillingResponseCode.SERVICE_UNAVAILABLE + || responseCode == BillingClient.BillingResponseCode.BILLING_UNAVAILABLE + || responseCode == BillingClient.BillingResponseCode.ITEM_UNAVAILABLE + || responseCode == BillingClient.BillingResponseCode.DEVELOPER_ERROR + || responseCode == BillingClient.BillingResponseCode.ERROR + || responseCode == BillingClient.BillingResponseCode.ITEM_NOT_OWNED) + { + reportBillingError(responseCode, new Throwable(billingResult.getDebugMessage())); } } }; diff --git a/library/src/main/java/com/anjlab/android/iab/v3/PurchaseInfo.java b/library/src/main/java/com/anjlab/android/iab/v3/PurchaseInfo.java index 5464d665..14615366 100644 --- a/library/src/main/java/com/anjlab/android/iab/v3/PurchaseInfo.java +++ b/library/src/main/java/com/anjlab/android/iab/v3/PurchaseInfo.java @@ -29,10 +29,6 @@ * a purchase from the google play store on his own * server. An example implementation of how to verify * a purchase you can find here: - *
- * See  here 
- * 
*/ public class PurchaseInfo implements Parcelable { diff --git a/sample/src/com/anjlab/android/iab/v3/sample2/MainActivity.java b/sample/src/com/anjlab/android/iab/v3/sample2/MainActivity.java index 50e1a56f..4dd1948f 100644 --- a/sample/src/com/anjlab/android/iab/v3/sample2/MainActivity.java +++ b/sample/src/com/anjlab/android/iab/v3/sample2/MainActivity.java @@ -39,7 +39,7 @@ public class MainActivity extends Activity { // PRODUCT & SUBSCRIPTION IDS private static final String PRODUCT_ID = "com.anjlab.test.iab.s2.p5"; private static final String SUBSCRIPTION_ID = "com.anjlab.test.iab.subs1"; - private static final String LICENSE_KEY = BuildConfig.licenceKey; // PUT YOUR MERCHANT KEY HERE; + private static final String LICENSE_KEY = "THE_KEY"; //BuildConfig.LICENSE_KEY; // PUT YOUR MERCHANT KEY HERE; // put your Google merchant id here (as stated in public profile of your Payments Merchant Center) // if filled library will provide protection against Freedom alike Play Market simulators private static final String MERCHANT_ID=null;