UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

assets

[IAP] Resolve Missing On Purchase Pending in Codeless IAP Components

Solution

mobile developmentprofilingiapmonetizationdevelopment workflow

Unity 2021.x - Unity 6.3.x

Published 17 days ago

Issue

 Developers utilizing Codeless IAP frequently encounter a documentation mismatch where an event named On Purchase Pending is referenced but does not exist in the IAP Button or IAP Listener inspectors. This discrepancy occurs in versions 4.14.2 through 5.1.2 of the Unity IAP package, preventing the proper handling of deferred transactions like Ask to Buy or pending bank payments.

The event documented as On Purchase Pending is actually labeled as OnOrderPending within the inspector components.

Explanation

To handle deferred transactions correctly in your project, you must map your logic to the existing component event. Follow these steps to resolve the naming conflict:

  1. Open the Inspector for your IAP Button or IAP Listener component.
  2. Locate the OnOrderPending (Product) UnityEvent, which is the functional equivalent of the documented On Purchase Pending event.
  3. Assign your custom method to this event to manage UI updates or user notifications when a purchase enters a pending state.
  4. Verify your implementation using the Unity IAP 5.1.2 package or higher, as this version is confirmed production-ready for Unity 6 LTS.

Additional Tips

  • Always implement a listener for OnOrderPending to disable purchase buttons and prevent duplicate transaction attempts while a store process is active.
  • Use Product.hasReceipt to determine if a pending transaction was finalized after a restart or app resume.

Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.