function transactionCallback( event )
print("transactionCallback: Received event ", event.transaction.state)
gotAnswered = 0
verified = 0
verify( event )
local waiter
function waiter()
if gotAnswered == 1 then
if event.transaction.state == “purchased” and verified == 1 then
print(“transactionID”, event.transaction.productIdentifier )
…do stuff here…
elseif event.transaction.state == “restored” and verified == 1 then
print( “restored” )
…do stuff here…
elseif event.transaction.state == “cancelled” then
print( “cancelled” )
…do stuff here…
elseif event.transaction.state == “failed” then
…do stuff here…
elseif ( event.transaction.state == “purchased” or event.transaction.state == “restored” ) and verified == 0 and false then
print( “Unauthorized transaction” )
…do stuff here…
else
print(“unknown state”)
…do stuff here…
end
print( “Finishing transaction.” )
store.finishTransaction( event.transaction )
print( “Finished transaction.” )
gotAnswered = 0
verified = 0
Runtime:removeEventListener( “enterFrame”, waiter )
end
end
Runtime:addEventListener( “enterFrame”, waiter )
end
Here is my code segment… waiter() function is a function which checks transaction reciept through my own server from appstore. I’m absolutely sure that it works %100. To communucate with server in an asynchronous way, I have a waiter function in enterframe. So basicaly, when I recieve a transaction, I send reciept to my server, check it, get my response as verified (1/0). Then I do what needed to be done. I dont know what is wrong. And thats makes me crazy. Since I used this transactioncallback function in other applications. I suspect that there is something wrong with sandbox mode.