The sample code with minor adjustments worked fine for me! Amazon approved the update in 4 hours.
–amazon iap code
function transactionCallback( event )
– 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))
local productID= event.transaction.productIdentifier;
if event.transaction.state == “purchased” then
print("Product Purchased: ", productID)
saveValue( level2Filename, “full” )
gameStyle = loadValue( level2Filename )
elseif event.transaction.state == “restored” then
print(“Product Restored”, productID)
saveValue( level2Filename, “full” )
gameStyle = loadValue( level2Filename )
elseif event.transaction.state == “revoked” then–“refunded”
print(“Product Refunded”)
elseif event.transaction.state == “cancelled” then
print(“Transaction cancelled”)
elseif event.transaction.state == “failed” then
print(“Transaction Failed”)
if store.availableStores.google then
restorer.isVisible=true;
end
else
print(“Some unknown event occured. This should never happen.”)
end
– Tell the store we are done with the transaction.
– If you are providing downloadable content, do not call this until
– the download has completed.
--store.finishTransaction( event.transaction )
gameStyle = loadValue( level2Filename )
end
local function purchaseItem(event)
if store.availableStores.apple then
store.init(“apple”, transactionCallback)
elseif store.availableStores.google then
--make sure you add { } around your product id as you need to send a table value… not a string!
store.init(“google”, transactionCallback)
store.purchase( {“fullgame”})
elseif system.getInfo(“targetAppStore”) == “amazon” or system.getInfo(“environment”) == “simulator” then
store = require “plugin.amazon.iap”
store.init( transactionCallback )
print("The currently logged in user is: ", store.getUserId())
store.restore()
--[[if store.canLoadProducts == true then
store.loadProducts({“my_sku”}, loadProductsListener)
end ]]–
if store.isSandboxMode() == true then
store.purchase(“my_test_sku”)
else
store.purchase(“fullGame99”)
end
end
purchase:addEventListener( “tap”,purchaseItem)