Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test Subscription Feature of In-app Billing

Is it possible to test subscription feature of In-app Billing? I tried using reserved product IDs for testing(android.test.purchased), But it gave error like 'item not found'.I am using In-app Billing Version 3.I could not find a conclusive answer from the web. Any help is appreciated.

like image 667
androidGuy Avatar asked Apr 24 '13 10:04

androidGuy


People also ask

What is in-app purchase testing?

Most Android apps offer one of two purchase models: In-app products: The app enables the purchase of one-time physical products and services. For example, a book or a cleaning service. Once the product has been consumed, the consumer has to manually make another purchase if they want to use it again.

How do I test app subscriptions on Android?

Open the Google Play app. Choose Account -> Subscriptions & Payments -> Subscriptions. Click your test subscription and change the payment method to “Test card, always declines.”

How do I add a test card to Google Play?

Open Play Console. Click Setup > License testing. In “Add license testers” box, enter your testers' Gmail addresses. In the bottom right corner of the screen, select Save changes.


2 Answers

As of February/March 2015, in-app subscriptions can also be tested on Android. Now, Google accounts with testing access (configured in the Settings Menu of the Developer Console) will receive the message

This is a test subscription. It will recur daily. You will not be charged when trying to buy in-app subscriptions.

This also means that all subscriptions seem to be "billed" daily. You will still receive a normal Google Play Order Receipt Email but it will be prefixed by the word Test:

Test: Your Google Play Order Receipt from Mar 12, 2015

Also, if you look inside this email, you will notice that the order number is a random string of letters, instead of a regular order number as described at http://developer.android.com/google/play/billing/billing_subscriptions.html#payment.

Order number: lhjelkffelbnmmcmklbkhkbd

like image 180
Stefan Anca Avatar answered Oct 14 '22 17:10

Stefan Anca


Some points that may help.

  1. If your published application does not have in-app, you dont need to publish your next inapp version to test it.
  2. You need to upload the apk with in app feature to your developer console (dont hit publish), install the same app on your phone
  3. Create in app products (unmanaged) and ensure that the code refers to these unmanaged product id's
  4. Make the product cheap for testing purpose
  5. Purchase your product from your application
  6. From your merchant account refund yourself (you wont be charged if you refund before 24 hours, and you get a full refund. (i think, just confirm this, it keeps changing).
  7. After you are happy, hit publish.
  8. You can add email id's of friends as test accounts, to help them purchase the product and not get charged. Infact you can also mock them for "failure" :)

I hope this helps.

like image 40
Siddharth Avatar answered Oct 14 '22 15:10

Siddharth