Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing Android Market in-app billing with dummy credit card credentials

Tags:

I have configured an Android application to use the in-app billing module as documented at: http://developer.android.com/guide/market/billing/index.html

It works fine when tested using the UK development team's accounts which have real credit cards associated with them. However, part of my development team is based in China, and as Google Billing does not operate in China, they are unable to test the billing functionality.

Understandably the team is uncomfortable sharing personal card details, or personal account information with others. Does anybody know a work around for this? While in testing, can dummy card numbers be associated with the account?

I know this works in the merchant sandbox (http://code.google.com/apis/checkout/developer/Google_Checkout_Basic_HTML_Sandbox.html) but I can't seem to find an equivalent for Android billing testing.

Any help/guidance/support would be appreciated here. The China team is focused on a lot of the modules related to the post-purchase experience and this will be seriously compromised if we cannot find a workaround.

Thanks!

like image 400
Kaiesh Avatar asked Jul 20 '11 14:07

Kaiesh


People also ask

How do you test in-app billing?

Test in-app billing and subscriptions Once you've set up application licensing, authorized users can also purchase in-app products and subscriptions without charging the users' accounts. When making a purchase from a license test user, you will see two choices for payment method: “Test card, always approves”

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 test IAP on Google Play?

On selecting the device, the uploaded/selected app will automatically open in the device in question. Alternatively, you can sign in to Google Play Store, download and install a published app and test its in-app purchase feature. Just pick the Install via Google Play Store option.

What is Inapp billing?

In-app Billing is a Google Play service that provides checkout processing for in-app purchases. To use the service, your application sends a billing request for a specific in-app product.


1 Answers


Update:
Inappbilling library 1.0 just released to make this easier.


Kumar Bibek has already answerd above: Still I am giving an explanation:

Hardcode the following debug options in the launch purchase flow to get the desired output.

  • android.test.purchased
  • android.test.canceled
  • android.test.refunded
  • android.test.item_unavailable*

    mHelper.launchPurchaseFlow(Activity.this, "android.test.purchased", 1000, mPurchaseFinishedListener, payload);

The above will give these screens:

enter image description here

On clicking Buy.

enter image description here

like image 169
amalBit Avatar answered Oct 22 '22 08:10

amalBit