Hello everybody,
I need your help because I am totally block with In app Purchase with google.
I have create a simple app with one product (id is “produit1id”) and just a button to purchase it.
In my build.settings :
plugins =
{
["plugin.google.iap.billing"]={
publisherId = "com.coronalabs",
supportedPlatforms = { android = true }
},
},
and my code
local store = require("plugin.google.iap.billing")
local function storeListener(event)
if event.name == 'init' then
elseif ( event.name == "storeTransaction" ) then
if event.transaction.state == "failed" then
else
if event.transaction.state == "purchased" then
timer.performWithDelay(2000, function() store.consumePurchase("produit1id") end)
elseif event.transaction.state == "consumed" then
elseif event.transaction.state == "restored" then
end
end
end
store.finishTransaction(event.transaction)
end
timer.performWithDelay(2000, function() store.init(storeListener) end)
local button = display.newRect(100, 100, 40, 40)
button:addEventListener("touch", function(event)
if event.phase=='ended' then
store.purchase("produit1id")
end
end)
I print the transaction.state on the screen and it print
" init " when I call store.init(storeListener)
“verificationFailed” when I call store.purchase(“produit1id”)
“consumed” when I call store.consumePurchase(“produit1id”)
The account of the app is the same of the developper (in internal test) and my app have accept all permissions on the phone.
I also try with paying real money (0,99€) but it also print “verificationFailed”.
So everything is good.
It is a simple function but nothing works.
Thank you.