For handling transaction requests, you are going to use the call back listener function you defined in .init(). You can use techniques where you have the function you want to actually handle the call be part of your scene and attach it to the storyboard object directly:
… somewhere in your storyboard scene …
storyboard.state = {} -- if you haven't already done this. function storyboard.state.handlePurchase( params ) ... end
Since you’re including storyboard in main.lua where your store.init() is, then in that transaction call back function would would call:
[lua]
storyboard.state.handlePurchase( whatever, params, need, passed )
[/lua]
Though a better way than using the storyboard object would be to use a global data table (that’s not a Lua global). See: http://coronalabs.com/blog/2013/05/28/tutorial-goodbye-globals/
That way you won’t run into namespace issues with storyboard. The reason I used the “state” table was in a previous tutorial we showed people how to use that table to pass globally visible items around, and we’ve avoided using .state as a member for our use. Now that storyboard is deprecated, you can use anything that won’t clash with an existing API call. But if you switch to Composer or some other method, we can’t guarantee that “.state” is safe. By using the globally available table in that tutorial you future proof your code and get the same benefits.
Rob
Rob