Hello everyone,
I’m working on my store at the moment, and found a pared down store in one of the threads that I’m adapting. however, I want to use one function for actually buying any item that’s sold, by passing the information from the purchase button. The button itself looks like this:
local btnPurchase= widget.newButton { shape="roundedRect", width = 200, height = 40, cornerRadius = 2, fillColor = { default={ 1, 0, 0 }, over={ 1, 0.1, 0.7 } }, strokeColor = { default={ 1, 0.4, 0 }, over={ 0.8, 0.8, 1} }, strokeWidth = 4, onRelease = purchaseItem, label = "Purchase" }
what I’d like to do, is pass the item, that is currently hardcoded into the purchase function
local function purchaseItem(event,product) --make sure you add { } around your product id as you need to send a table value... not a string! store.purchase( {"com.mybundle.myapp.myproduct"}) end
into the onRelease on line 48. Any way to do it, or is the best thing to just to write my own listeners? TIA