google v2 plugin finishTransaction not working

The in-app billing order for my app is automatically canceled.

I have “google.iap.billing.v2”
Even if you execute “store.finishTransaction( event.transaction )”, the order is not approved.
Anyone know a solution?

Google play will automatically process the refund in 3 days.
I don’t know how to authorize a purchase.

here is my code

local function transactionCallback( event )
	if ( == "init" ) and ( == "google") then 
		if ( event.isError ) then
			-- alert
	elseif ( == "storeTransaction" ) then
		if event.transaction.state == "purchased" or 
			event.transaction.state == "restored" or 
			event.transaction.state == "restoreCompleted" then

		elseif event.transaction.state == "refunded" then
			-- refunded

		elseif event.transaction.state == "cancelled" then
				print( "Transaction cancelled by user." )

		elseif event.transaction.state == "failed" then
			print( "Transaction failed." )
			print( "Unknown event" )
		store.finishTransaction( event.transaction )
	print("=== finish transactionCallback ===")

Have you read through this thread?

I’m running the v2 billing and my transactions are finishing just fine. The only difference between your code and mine is this line:

elseif ( == "storeTransaction" ) then

Mine looks more like this:

if == "init" then
       -- do init stuff
	   if event.transaction then
			local transaction = event.transaction									
			if transaction.state == "purchased" or transaction.state == "restored" then	

            elseif transaction.state == "cancelled" then	

            elseif transaction.state == "failed" then

            store.finishTransaction( transaction )

So I’m not looking for an, just if there is a transaction. And I always call finishTransaction on it, no matter that state.

Thank you.
i didn’t see that. i will see

Thank you.
I followed your advice and the problem was solved. I appreciate.