Where to give the user the product after in app purchase completed

hi im looking at this http://coronalabs.com/blog/2013/09/03/tutorial-understanding-in-app-purchases/
This code as well
local function removeAds( event )

if event.phase == “began” then
event.target:setFillColor(224)
elseif event.phase == “ended” then
event.target:setFillColor(255)
if system.getInfo(“targetAppStore”) == “amazon” or system.getInfo(“targetAppStore”) == “google” then
store.purchase( “com.acme.superrunner.upgrade” )
else
store.purchase( { “com.acme.superrunner.upgrade” } )
end
end
return true
end

local buyBtn = display.newImageRect(“images/buy_button.png”, 614, 65)
group:insert( buyBtn )
buyBtn.x = display.contentCenterX - 465
buyBtn.y = 430
buyBtn:addEventListener( “touch”, removeAds )

where would i implement acually doing something after purchase like consumable item or unlocking levels

Hey Xep,

You are going to need to handle the store transactions in a callback handler.  Here’s a link to the guide, it should give you a place to start:

http://docs.coronalabs.com/api/library/store/purchase.html

Hey Xep,

You are going to need to handle the store transactions in a callback handler.  Here’s a link to the guide, it should give you a place to start:

http://docs.coronalabs.com/api/library/store/purchase.html