The event.transaction passed to the transactionCallback function contains invalid data. When I print it to the console I get something like “userdata: 0x2c8b38”
Here is my setup and let me know if you can see anything I’m doing wrong:
--initialize in-app purchase handling
if store.availableStores.apple then
store.init("apple", inAppPurchaseCallback)
elseif store.availableStores.google then
store.init("google", inAppPurchaseCallback)
end
Then to purchase the item (using a real id in my code):
store.purchase( { "com.mycompany.myapp.myitem" } )
The transaction listener:
local function inAppPurchaseCallback(event)
print("inAppPurchaseCallback event data:")
for key,value in pairs(event) do
print(" ", key, value )
end
print("inAppPurchaseCallback transaction data:")
for key,value in pairs(event.transaction) do
print(" ", key, value )
end
end
Here’s the relevent logcat output from my android device:
[blockcode]
I/Corona ( 2062): inAppPurchaseCallback event data:
I/Corona ( 2062): name storeTransaction
I/Corona ( 2062): transaction userdata: 0x2c8b38
I/Corona ( 2062): inAppPurchaseCallback transaction data:
I/Corona ( 2062): Lua Runtime Error: lua_pcall failed with status: 2, error message is: bad argument #1 to ‘pairs’ (table expected, got userdata)
I/Corona ( 2062): inAppPurchaseCallback event data:
I/Corona ( 2062): name storeTransaction
I/Corona ( 2062): transaction userdata: 0x5398f8
I/Corona ( 2062): inAppPurchaseCallback transaction data:
I/Corona ( 2062): Lua Runtime Error: lua_pcall failed with status: 2, error message is: bad argument #1 to ‘pairs’ (table expected, got userdata)
[/blockcode]
Help!!! I’m running very close to a deadline and I could use any help or tips. Thanks in advance!
[import]uid: 192260 topic_id: 33472 reply_id: 333472[/import]