resting Posted October 10, 2009 Share Posted October 10, 2009 i've decided to use $_SESSION to store the user's selection. Only after the confirmation of payment is received, will the database be updated. Next question, will the $_SESSION data still be available when the user makes payment on another site (paypal) and comes back? Or better yet, will the $_SESSION data still be available even when the user doesn't come back? Meaning upon receiving confirmation from paypal, I will update all $_SESSION into database? Quote Link to comment https://forums.phpfreaks.com/topic/177196-developing-a-shopping-cart/ Share on other sites More sharing options...
.josh Posted October 10, 2009 Share Posted October 10, 2009 As long as the browser is open, even if the user goes to another website, the session will persist. By default, if the server does not receive a request for 30 minutes, the session cookie will expire. Quote Link to comment https://forums.phpfreaks.com/topic/177196-developing-a-shopping-cart/#findComment-934286 Share on other sites More sharing options...
resting Posted October 10, 2009 Author Share Posted October 10, 2009 ic. what if the customer make payment at paypal, then go other sites and never come back again. there's no way I can determine which $_SESSION to write to database right? hmm...so would writing the orders to a temporary table first be better? Quote Link to comment https://forums.phpfreaks.com/topic/177196-developing-a-shopping-cart/#findComment-934306 Share on other sites More sharing options...
.josh Posted October 10, 2009 Share Posted October 10, 2009 are you using the paypal api? I've never used it but it was my understanding you can specify where paypal will redirect the user upon transaction. Quote Link to comment https://forums.phpfreaks.com/topic/177196-developing-a-shopping-cart/#findComment-934311 Share on other sites More sharing options...
resting Posted October 10, 2009 Author Share Posted October 10, 2009 no i plan to use the paypal button generator. yes i still can redirect user back to my home page. but they could stop this process either purposely or accidentally. and this means if they don't come back, i can't update my inventory and orders. maybe i shouldn't use $_SESSION to store the items? maybe I could store them in a pending_payment_confirmation table? then when paypal some how sends the Instant Payment Notification to me, a script will run to update the database? how does that sound? Quote Link to comment https://forums.phpfreaks.com/topic/177196-developing-a-shopping-cart/#findComment-934365 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.