Hi I need help I’ve been doing is In App Purchase having a separate button for when a person buy’s something. This is how I have it
[code]store = require(“store”)
local button1 = display.newRect (160, 240, 40,40)
local listOfProducts =
{
– These Product IDs must already be set up in your store
– We’ll use this list to retrieve prices etc. for each item
– Note, this simple test only has room for about 4 items, please adjust accordingly
– The iTunes store will not validate bad Product IDs
“com.quiz.minecraft”,
}
function transactionCallback( event )
local transaction = “com.quiz.minecraft”
if transaction.state == “purchased” then
print(“Transaction succuessful!”)
print(“productIdentifier”, transaction.productIdentifier)
print(“receipt”, transaction.receipt)
print(“transactionIdentifier”, transaction.identifier)
print(“date”, transaction.date)
elseif transaction.state == “restored” then
print(“Transaction restored (from previous session)”)
print(“productIdentifier”, transaction.productIdentifier)
print(“receipt”, transaction.receipt)
print(“transactionIdentifier”, transaction.identifier)
print(“date”, transaction.date)
print(“originalReceipt”, transaction.originalReceipt)
print(“originalTransactionIdentifier”, transaction.originalIdentifier)
print(“originalDate”, transaction.originalDate)
elseif transaction.state == “cancelled” then
print(“User cancelled transaction”)
elseif transaction.state == “failed” then
print(“Transaction failed, type:”, transaction.errorType, transaction.errorString)
else
print(“unknown event”)
end
– Once we are done with a transaction, call this to tell the store
– we are done with the transaction.
– If you are providing downloadable content, wait to call this until
– after the download completes.
store.finishTransaction( “com.quiz.minecraft” )
end
store.init( transactionCallback )
button1:addEventListener(“touch”, transactionCallback) [/code]
What I try to do here is when the person clicks on button1 the item is bought but when I do this I get an error. Also how would I do it for button2 for when they want to buy another item with different price. So can anyone please help me this is the last thing I need to get done for my game is very important to my game anyone help, is appreciated. [import]uid: 17058 topic_id: 22208 reply_id: 322208[/import]