IAP - ProcessPurchase called after OnPurchaseFailed

There has been a group of our users that have been having issues with our in-app purchases.We implemented our application based on the assumption that one purchase will return one response, however there seems to be cases where this may not be the case.

In order to confirm if our upcoming fix in our application to handle multiple responses per purchases is correct, we would like a confirmation on whether the case where a purchase failed response can be followed by a purchase success response within a single purchase exists and is as intended.

We have been working to reproduce the problem consistently and have been able to confirm the following pattern.

  • Proceed to payment via our app using unconfirmed carrier payment (Japanese provider) or with no saved payment methods.

  • A dialog that asks for mobile number confirmation or for adding a new payment method is shown. OnPurchaseFailed is called.

  • By continuing, the user is then sent to the settings application where they follow the instructions there to confirm their mobile number or add a payment method. Once confirmed a system dialog stating that the purchase has been completed is shown.

  • Upon returning to app, ProcessPurchase in our app is called. (but our app was not handling this case so users would be billed but they would not get their content)

User reports state that purchasing again right afterwards works (we assume because 2-3 is skipped).
We would appreciate it if you could confirm whether multiple responses per purchase is the intended behavior.

Can you explain why your application did not process the purchase when ProcessPurchase was called? I think if the purchase is processed after calling ProcessPurchase, there will be no such problem.

We have heard of this behavior. If you cancel a purchase, it may trigger ProcessPurchase upon next IAP initialization. Can you try with IAP 1.23.4 ?

I assume this is because upon calling Controller.InitiatePurchase(product), OnPurchaseFailed being handled first resulted in a case where ProcessPurchase was not handled correctly. We have updated the app with a solution, but would simply like to know if ProcessPurchase coming after a OnPurchaseFailed is normal and expected behavior. If not and there has been insufficient testing for cases, then we are worried whether this use case is guaranteed or not.

Appreciate the assistance but that has not been happening with us.

We have not tested any Japanese payment methods. But ProcessPurchase and PurchaseFailed are certainly not expected to both trigger. I believe the same behavior is indeed happening to you in Step 2 above, just a slightly different flow. You should test this scenario also.

Thank you for the confirmation. We are not entirely sure if this is specific to Japanese payment methods as the same flow of event exists if there are no saved payment methods available and the user proceeds to add one before proceeding with payment.

We have tried reproducing said scenario as follows but we have not observed a case where ProcessPurchase was called after the re-initialization of IAP after cancelling the purchase. We can confirm that force quitting the app during a payment will result in ProcessPurchase being called when the app starts up again which seems normal.