PayPal IPN and accessing custom session variables asynchronously |
[eluser]Jacob Graf[/eluser]
I am trying to integrate PayPal IPN into an application I am developing with CodeIgniter. To make a long story short, the user creates an account by registering and then they need to pay $10 to activate their account for 1 year. I am using the following IPN code... Code: function activate() Basically, I am using a shared secret in the 3rd URL segment to verify the request is authentic. I then make sure the payment went through and if it did, I check the logged-in users session variables and use those to activate the account in the database. Here is the issue, for some reason, it isn't pulling up my custom session variables. PayPal gets payment information from the customer and when it has received a successful payment, it makes a request asynchronously to the code above. I could see the session variables not being accessible from PayPal's servers, but the code resides on my server. After that, I set a success message in a flash session variable hoping that would still be accessible when the user is directed back to my site from PayPal's site. Any ideas on why I can't get to my session data would help! I appreciate it!
[eluser]InsiteFX[/eluser]
Hi, It is possible that your session variables are being destoryed when it goes to PayPal's site. If PayPal returns to your site you should know that it was ok! You can also check out the CodeIgniter's SVN Cart here http://dev.ellislab.com/svn/CodeIgniter/...s/Cart.php It uses session data for the cart. Hope this helps. Enjoy InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |