IAP Configuration and In-App Item Processing
Your app code can follow the logic flow below to support your in-app items. The scope of each IAP Helper API is straightforward and most integrations follow a similar logic flow, which is linear with a few branches. After item purchases, IAP Server APIs are typically called to verify purchases.
Purchased consumable items not reported as consumed cannot be repurchased.
Even if the user has completed payment for the item purchase, the item might not be available to the user because of a battery or network problem. Make sure you call getOwnedList() whenever launching the application to check if there are consumable items that are not reported as consumed, and if so, consume them immediately by calling consumePurchasedItems(). Then, the user can repurchase the items.