Hi everyone, I'm new to just about everything in the web2py stack, so I'm struggling with the best way to approach a problem I'm having.
I have a game written in Flash. A user clicks a purchase button, which directs Flash to run a Javascript method. The Javascript calls a 3rd party purchase API to buy the product. The API posts back to web2py, but it doesn't include any identifying information about the user. Web2Py then fires a Javascript method telling the Flash game the product is purchased. This all works fine. The problem I have is that the user might not be logged in to web2py when they make a purchase. When the purchase postback comes through, I'd like some way to figure out who the user is. Some restrictions - I don't want to force users to log in to play the game. I also don't want to force them to log in before purchasing, but maybe after the purchase? I've tried a lot of Javascript wrangling and I just can't get it to work with the Python code getting evaluated before the page is rendered. Do you have any opinion on these possibilities: 1.) Set a sessions variable when the postback comes in and store the order number (would that session be the postback's and not the user's?). Ask the user to log in after the purchase and associate the order number with their web2py account. 2.) Ask the user to log in before purchase, but do it with a model window. I don't want to pull the user away from the game's window. Drawbacks - I have absolutely no idea how to do this using Janrain. 3.) Javascript redirect after a successful purchase. Somehow get information passed in the redirect? Maybe the order number so the purchase and user can be connected. Can you do this in a url? Still have the issue of communicating with the postback and the current session. 4.) Only associate the purchase if the user was logged in before purchasing. This would be a support problem though. Players play on a separate computer wouldn't have their purchases. How does anyone do web development? There are so many technologies to learn! :) Thanks! -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.