There only one core function to handle purchase state. syncPurchaseState() is called after a successful purchase or an inventory query.
The function handles underlying work to make sure Google's inventory is synced with ours.