"User's purchase success, but OnPurchaseFailed() is called" (726479)

Not at this time. You can view the previous release cadence here for a general idea https://discussions.unity.com/t/632966

Hi, we’ve been eagerly following this topic for a few weeks since this is a very critical bug for us.
Since the IAP team already has a fix, would it be possible to know when the bug was introduced or to which version we could rollback ?

I suspect the issue has always been there, but you are welcome to try with a previous version.

@JeffDUnity3D hi, we just noticed that a new release 1.22 is out for Unity IAP, it doesn’t seem like the issue mentioned here is in the list of fixed issues, can you please help confirm? Unity IAP package 4.12.2 is now available page-2#post-4336852

Please test with the new release

We are using the latest version 1.22 and still get about 1 in 25 refund requests due to “error number 4”. The player is surprised he was charged but did not get the items :frowning:
This did not happen with earlier versions… Are you still investigating this? It’s extremely hurtful for our business…

1 Like

We would need steps to reproduce. I might suggest trying to disconnect WiFi during a transaction, this is the area we are looking into.

@JeffDUnity3D , we are a three person team and have more tasks than we can handle for our own game, we can’t really spend time debugging this but we always try and investigate with our players what happened (when it happens to them).
One thing we heard was that they took some more time to complete the transaction (chose a different credit card). It might have something to do with network connection but we it’s a tricky one to reproduce using our current tools.

In any case, every player that experiences such an issue is a huge loss for our game since these are obviously the most loyal players and they are getting the worst purchase experience…

1 Like

So all purchases work OK in your direct tests, in general, using a credit card?

Hello, we are having similar/same problem we are unable to resolve. We have Unity 2018.3.14, UnityPurchasing 1.22.0, Android Version 9, Galaxy S10 (but it happens on various devices and Android version).

We are unfortunately unable to find any solid pattern or a way how to reproduce it. We have reports from few of our users and we were able to reproduce it on our test devices few times but no solid pattern found.

What happens is that purchase is successful (non-consumable product) on GooglePlay, user is charged but ProcessPurchase is not called. It is not called even if app is restarted. If the user tries to purchase it again, the google play will display an error that the user already owns the product but Unity calls back OnPurchaseFailed.

It seems to be happening on both debug and live environment so with both GooglePlay test card and real card for real users.

On the chance that you are able to reproduce, can you provide the device logs? https://discussions.unity.com/t/699654

Yes, in our tests we weren’t able to reproduce it, it seems to be happening to players and it’s not consistent for the players as well (thank god!)

We had encountered yet another purchase failure, with the player stating he was using his home WiFi connected via fiber,
selected the “1-tap buy”, provided fingerprint for verification, then it confirmed. However, when the player got back to the game it said failed."

It doesn’t sound like it’s a network issue…
Could that be something with a different unity component in the process? Maybe a report to a Unity Analytics backend which returns an error?
Or a transaction verification failure which isn’t supposed to fail?

Have you tested using fingerprint verification? The stores may return User Cancelled in the purchase flow if anything interrupts or puts up a separate dialog (even during the native purchase flow)

Hello

faced the same problem: users gives us purchase receipts, BUT in our analytics and in logs we see that unity purchasing returns :

iOS

Android
[ message: GOOGLEPLAY_1:User Canceled (response: 1:User Canceled) : BILLING_RESPONSE_RESULT_USER_CANCELED ],[ reason: UserCancelled ],[ productId: boardkings_bundle_20 ]

where
message => failureDescription.message
reason => failureDescription.reason
productId => failureDescription.productId

and failureDescription received from ITransactionHistoryExtensions.

Do you have any progress in investigation of this issue?

No updates yet, we haven’t been able to reproduce. Can you confirm if these users are using fingerprint, faceID or other secure login? Our theory is that perhaps such a login dialog that pops up can cause the store API’s to return UserCancelled, and we pass along the status.

Hello,

On iOS I recently hit similar(?) bug: if user account has no payments method selected the OS asks him to provide one. After completing all necessary steps a message box appear that purchase is successfull but returning to game I’ve got error message that purchase is failed and right away another message that purchase is successfull. Unfortunately this was an unlogged session so no logs are available. Tested on real device with real account.

Thanks for the tip! This is good information.

Hi, I have same issue:

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-02 16:33:10.950 23842-23882/? I/Unity: IAP _ start initializing

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-02 16:33:10.968 23842-23882/? I/Unity: UnityIAP Version: 1.17.0

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-02 16:33:11.121 23842-23882/? I/UnityIAP: IAB helper created.
2020-03-02 16:33:11.277 23842-23882/? I/UnityIAP: Starting in-app billing setup.
2020-03-02 16:33:11.278 23842-23882/? I/Unity: IAP _ end initializing

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-02 16:33:11.288 23842-23842/? I/UnityIAP: Billing service connected.
2020-03-02 16:33:11.289 23842-24079/? I/UnityIAP: invoking callback
2020-03-02 16:33:11.290 23842-24079/? I/UnityIAP: Checking for in-app billing 3 support.
2020-03-02 16:33:11.295 23842-24079/? I/UnityIAP: In-app billing version 3 supported for com.matveev_nv.SuperBlasterBall
2020-03-02 16:33:11.297 23842-24079/? I/UnityIAP: Subscriptions AVAILABLE.
2020-03-02 16:33:11.299 23842-24079/? I/UnityIAP: VR supported.
2020-03-02 16:33:11.300 23842-24079/? I/UnityIAP: onIabSetupFinished: 0
2020-03-02 16:33:11.300 23842-24079/? I/UnityIAP: Requesting 1 products
2020-03-02 16:33:11.300 23842-24079/? I/UnityIAP: QueryInventory: 1
2020-03-02 16:33:11.301 23842-24079/? I/UnityIAP: invoking callback
2020-03-02 16:33:11.301 23842-24079/? I/UnityIAP: Querying owned items, item type: inapp
2020-03-02 16:33:11.301 23842-24079/? I/UnityIAP: Package name: com.matveev_nv.SuperBlasterBall
2020-03-02 16:33:11.301 23842-24079/? I/UnityIAP: Calling getPurchases with continuation token: null
2020-03-02 16:33:11.306 23842-24079/? I/UnityIAP: Owned items response: 0
2020-03-02 16:33:11.306 23842-24079/? I/UnityIAP: Continuation token: null
2020-03-02 16:33:11.307 23842-24079/? I/UnityIAP: Querying SKU details.
2020-03-02 16:33:11.321 23842-24079/? I/UnityIAP: Querying owned items, item type: subs
2020-03-02 16:33:11.321 23842-24079/? I/UnityIAP: Package name: com.matveev_nv.SuperBlasterBall
2020-03-02 16:33:11.321 23842-24079/? I/UnityIAP: Calling getPurchases with continuation token: null
2020-03-02 16:33:11.325 23842-24079/? I/UnityIAP: Owned items response: 0
2020-03-02 16:33:11.325 23842-24079/? I/UnityIAP: Continuation token: null
2020-03-02 16:33:11.325 23842-24079/? I/UnityIAP: Querying SKU details.
2020-03-02 16:33:11.337 23842-24079/? I/UnityIAP: onQueryInventoryFinished: true
2020-03-02 16:33:11.337 23842-24079/? I/UnityIAP: Inventory refresh successful. (response: 0:OK)
2020-03-02 16:33:11.393 23842-23882/? I/Unity: IAP OnInitialized: PASS

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-02 16:33:11.394 23842-23882/? I/Unity: IAP OnInitialized: PASS m_StoreController

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-02 16:33:11.411 23842-23882/? I/Unity: UnityIAP: Promo is ready

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-02 16:33:17.315 23842-23882/? I/Unity: IAP Purchasing product asychronously: ‘1000’

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-02 16:33:17.321 23842-23882/? I/UnityIAP: onPurchaseProduct: 1000
2020-03-02 16:33:17.322 23842-23882/? I/UnityIAP: ITEM TYPE:inapp
2020-03-02 16:33:17.337 23842-23882/? I/Unity: IAP _ BuyConsumable

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-02 16:33:17.342 23842-23882/? I/UnityIAP: isUnityVrEnabled = false
2020-03-02 16:33:17.423 23842-23842/? I/UnityIAP: Creating purchase activity
2020-03-02 16:33:17.424 23842-24079/? I/UnityIAP: invoking callback
2020-03-02 16:33:17.424 23842-24079/? I/UnityIAP: Constructing buy intent for 1000, item type: inapp
2020-03-02 16:33:17.435 23842-24079/? I/UnityIAP: Launching buy intent for 1000. Request code: 999
2020-03-02 16:33:23.184 23842-23842/? I/UnityIAP: onActivityResult
2020-03-02 16:33:23.184 23842-23842/? I/UnityIAP: Successful resultcode from purchase activity.
2020-03-02 16:33:23.184 23842-23842/? I/UnityIAP: Purchase data: {“orderId”:“GPA.3347-1427-3750-05461”,“packageName”:“com.matveev_nv.SuperBlasterBall”,“productId”:“1000”,“purchaseTime”:1583155993157,“purchaseState”:0,“purchaseToken”:“pdoajbemndcbjphplnbgnamh.AO-J1OxMvEVm0Umc09WJjhgKCTMdocbfVkQhR_JnU_0bnHVHhJVlEAsgLj8tNb0v3CFuhs7Qpk69LD8G7wBnxivqqFPuqhdxi7ii6s0CMywD43wGUOtz9VzHGzB6AAH_L8k7V0GuF_xD”}
2020-03-02 16:33:23.184 23842-23842/? I/UnityIAP: Data signature: ZnlxNk2aVbM8TPHabCe0e3keI1MzCcApY/1PqZjk9SkPVJhtPXnYXA+ooLrmaeI56roK2L6s9H4U/oh+GzW+fYtrMaMF1+zvo9aawidBs8aFwsfxQw1ZeX+rO9m0UA9hhyHBtje3Y4MwA8i2POjjudlJ5vR/bbbkz9qrFIM54gpj1sHD8Ajys8GDUc64hNoKfwsCdxG8vR0UPJ3QExkzRqBDntdSaVZtdZZvP8ibq//jT24MS3julFgFz5Q9FgWe/sRp7CxEw7/Dg/S5r+c/loRWIb9JReo7uaceKoAFDja9ioPXKOXUlNBmpEyudVZpin/Sa1fyGANDAhlXEKW6cQ==
2020-03-02 16:33:23.184 23842-23842/? I/UnityIAP: Extras: Bundle[{INAPP_PURCHASE_DATA={“orderId”:“GPA.3347-1427-3750-05461”,“packageName”:“com.matveev_nv.SuperBlasterBall”,“productId”:“1000”,“purchaseTime”:1583155993157,“purchaseState”:0,“purchaseToken”:“pdoajbemndcbjphplnbgnamh.AO-J1OxMvEVm0Umc09WJjhgKCTMdocbfVkQhR_JnU_0bnHVHhJVlEAsgLj8tNb0v3CFuhs7Qpk69LD8G7wBnxivqqFPuqhdxi7ii6s0CMywD43wGUOtz9VzHGzB6AAH_L8k7V0GuF_xD”}, INAPP_DATA_SIGNATURE=ZnlxNk2aVbM8TPHabCe0e3keI1MzCcApY/1PqZjk9SkPVJhtPXnYXA+ooLrmaeI56roK2L6s9H4U/oh+GzW+fYtrMaMF1+zvo9aawidBs8aFwsfxQw1ZeX+rO9m0UA9hhyHBtje3Y4MwA8i2POjjudlJ5vR/bbbkz9qrFIM54gpj1sHD8Ajys8GDUc64hNoKfwsCdxG8vR0UPJ3QExkzRqBDntdSaVZtdZZvP8ibq//jT24MS3julFgFz5Q9FgWe/sRp7CxEw7/Dg/S5r+c/loRWIb9JReo7uaceKoAFDja9ioPXKOXUlNBmpEyudVZpin/Sa1fyGANDAhlXEKW6cQ==, RESPONSE_CODE=0}]
2020-03-02 16:33:23.185 23842-23842/? I/UnityIAP: Expected item type: inapp
2020-03-02 16:33:23.185 23842-23842/? I/UnityIAP: onIabPurchaseFinished: true
2020-03-02 16:33:23.185 23842-23842/? I/UnityIAP: Success (response: 0:OK)
2020-03-02 16:33:23.185 23842-23842/? I/UnityIAP: Product purchased successfully!
2020-03-02 16:33:23.185 23842-23842/? I/UnityIAP: NotifyUnityOfPurchase
2020-03-02 16:33:23.292 17436-17483/? I/GameTools: DreamToolsEventMgr : onGameResume AppInfo loading completed. {com.matveev_nv.SuperBlasterBall:testIAP:23842:10738:0}
2020-03-02 16:33:23.752 23842-23882/? I/Unity: IAP ProcessPurchase: FAIL. Unrecognized product: ‘1000’

That looks like code in your ProcessPurchase, not onPurchaseFailed. Can you share your code? Product is named “1000”, could you compare to an alpha-only product name, as a test? And it shows your app resuming (onGameResume), not sure if relevant. And please test with IAP 1.23.1