• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Loris2222 · Jul 15, 2020 at 09:42 AM · in app purchasegoogle-play-store

Unity IAP ProcessPurchase called even if purchase was not completed

I am encountering a bug, seemingly in Unity IAP system, where consumable purchases that were cancelled by the user or that failed for other reasons are still sent through and ProcessPurchase gets called anyway at the next startup of the app, allowing for fake purchases to take place.
This, however, happens only for the first purchase after deleting the app data or installing, but the bug happens again each time data is deleted.
Steps for reproducing are below.

I am mostly using the standard Unity IAP implementation (with code) on Android as per the tutorial.

I have tried checking the receipts but all cancelled/failed orders show correct receipts, also I have tried on accounts that were not on the testers list to see if it was a problem with test credit cards but still it wasn't working.
I have also noticed that when OnInitialized gets called no product appears to be on the StoreController, so no pending transactions could be found and marked for deletion, but ProcessPurchase will get called regardless.

Steps for reproducing:

  1. Delete app data from phone or reinstall app.
  2. Start a purchase and cancel it or leave it in the IAP UI.
  3. Close the app.
  4. Open the app again. ProcessPurchase is called as if the first purchase was completed.
  5. Try again steps 2-4, ProcessPurchase is not called this time.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by warfronts · Aug 29, 2020 at 06:54 PM

Same is happening to us on android. Once Google play store window is open, pause the game, kill the game. The next app startup ProcessPurchase is called.

Did you manage to figure it out? Thanks.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by heneliezer1 · Jan 14 at 04:40 PM

Happens to me too.. Any solutions? ,Happens to me too. I think it only happens after a user purchased that item. deleted the app . pressed the item in the store ( but did not buy ) restart game and the money is there ( even tho its a consumable and should not return )

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by heneliezer1 · Jan 13 at 10:35 PM

This only happens if u bought the item successfully. then delete the app. download again. click on buy button but dont buy -> restart app -> ull get the item , even tho its a consumable and u deleted the app. Anyone else had this bug? when is it going to be fixed

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

131 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Do I need a Google Merchant account in order to implement the Unity In App Purchases for Google Play Store? 1 Answer

Restore IAP in Android using Prime 31 1 Answer

Simple In App Purchase on iOS 9 Answers

ERROR: SoomlaStore failure: IabActivity is destroyed during purchase. 0 Answers

How can I integrate "In App Purchase" (IAP) with Bitcoins for Unity 3D Game? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges