Okay I just tried a bunch of orders using real products and real credit cards. I’m still seeing the same issue. My canceled transaction fires the listener but my successful one does not. Maybe it’s just my code? Can someone take a look at it?
storeinit.lua
local store = require("store") function transactionCallback( event ) local infoString -- Log transaction info. print("transactionCallback: Received event " .. tostring(event.name)) print("state: " .. tostring(event.transaction.state)) print("errorType: " .. tostring(event.transaction.errorType)) print("errorString: " .. tostring(event.transaction.errorString)) if event.transaction.state == "purchased" then infoString = "Transaction successful!" elseif event.transaction.state == "restored" then infoString = "Restoring transaction:" .. "\n Original ID: " .. tostring(event.transaction.originalTransactionIdentifier) .. "\n Original date: " .. tostring(event.transaction.originalDate) elseif event.transaction.state == "refunded" then infoString = "A previously purchased product was refunded by the store." elseif event.transaction.state == "cancelled" then infoString = "Transaction cancelled by user." elseif event.transaction.state == "failed" then infoString = "Transaction failed, type: " .. tostring(event.transaction.errorType) .. " " .. tostring(event.transaction.errorString) else infoString = "Unknown event" end toast.new(infoString,10000) store.finishTransaction(event.transaction) end --Load in the right store for the right phone if store.availableStores.apple then store.init("apple", transactionCallback) elseif store.availableStores.google then store.init("google", transactionCallback) else toast.new("No app store found on your device", 1000) end
store.lua
function checkStoreIsAvailable(purchaseItem) if(store.isActive == false) then showStoreNotAvailableWarning() elseif(store.canMakePurchases == false) then native.showAlert("Store purchases are not available, please try again later", {"OK"}) elseif purchaseItem then store.purchase({purchaseItem}) end end function doublePayouts() checkStoreIsAvailable("testprod") end function showStoreNotAvailableWarning() if isSimulator then native.showAlert("Notice", "In-app purchases is not supported by the Corona Simulator.", { "OK" } ) else native.showAlert("Notice", "In-app purchases is not supported on this device.", { "OK" } ) end end
It’s pretty basic code though I don’t see where the issue could be in the code.