Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I would like to know what best practices should I do for testing the functionality when a user buy an item/power-ups via Google Play and purchased with real money?

For example, basically, creating a simple test of purchasing and saving an item stored in the inventory during the game using a game money. (e.g. Gil from Final Fantasy series or Zenny from Tron Bonne for the PlayStation 1) I know how to make money purchase update only via game money when I'm programming in Unity3D or Eclipse w/ LibGDX library.

Now, let say I have to create a program that checks the user if actually purchase a power-up items using real money. Next, the system needs to check for online status. If connected, it will simply go to the Google Play dialog and asks the user if he/she wanted to proceed purchasing of items. If yes and the credit card balance is sufficient, then goes back to the game app and check if the boolean returns true, then item that the user is bought will be saved.

Another example is that the amount of real money will be calculated via programming and if insufficient, the user asks to add more real money value by purchasing it via Google Play. If return true, then, the real money value will be reloaded.

This concept is basically needed for game developers. However, is there a safe way to test the real money purchase test stuff without using a credit card value or something before the actual publishing of the game app in Google Play along with this feature? Is there a tutorial, start-up guide, recommendation or something for this? Please, I would like to know how will I start. Thank you.

share|improve this question
4  
7  
You say, Ha! You silly person, buying from Google Play! –  TRiG Apr 8 at 9:37

1 Answer 1

up vote 21 down vote accepted

You'll need to setup a test account and then publish your build as a draft application in order to successfully test purchases and the workflow as a normal user would. This is what Google has to say on the matter of test accounts:

The Google Play Developer Console lets you set up one or more test accounts. A test account is a regular Google account that you register on the Developer Console as a test account. Test accounts are authorized to make in-app purchases from applications that you have uploaded to the Google Play Developer Console but have not yet published.

http://developer.android.com/google/play/billing/billing_admin.html#billing-testing-setup

It should also be noted Google provides some mock product IDs you can test again, these are:

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

These are pulled from here.

This is known as static response testing. Your code can query against product IDs that are known to give good responses, thus allowing you to write your code in a way that lets you test the workflow without actually making any purchases.

A lot more goes into this, so the above two links will tell you more.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.