Shopping Cart Best Practice and IPN with paypal

Posted on 2006-04-24
Last Modified: 2013-11-29

Right this really is a high level question about creating shopping carts and intergrating with Paypal.

I have an online shop at the moment that has all the product in a DB with categories etc etc.  The site currently just pulls the details of the product from the DB and i put these details into a button that then uses the paypal shopping cart.  Now we are ready to integrate this fully into paypal.

I am have some ideas about how to do this so here goes....

Firstly i was planning on creating a new table called tblCart and creating some sort of unique session variable for a customer when they add the first product to a cart then use the same session variable each time after that. This would create the online cart that on the site.  From this i would then have a checkout option that transferred the entire cart details into an tblOrders and would then create a page to get the user to fill in their personal details (name, address, email, phone etc) and this would get populated into my tblCustomers and the new customer ID added into my tblOrders.

Once this customer has entered their personal detials the checkout option is displayed which will take them to the paypal payments page when they enter their credit/debit card details and make the payment, i then use IPN to send a message back to my server with the order number in say a querystring which i then upload the order record to status completed or pament ok or something along those lines.  This would then let me log into an admin panel and see all the orders which have been paid ok and pick/pack them and ship them, marking the order as dispatched along the way.  I am ok with moveing the data around and manipulating it once i get the payment confirm back.

Does this seem like a logical flow or have i totally missed a the point and am going in the wrong direction.

Once i know am thinking about this correctly then i will start to progress and will ask further questions along the way on a more technical level.

Question by:net-workx
    LVL 10

    Accepted Solution

    Yes, you are on the right track. There are many ways to do it but your method is logical and will work. Also, you have the added advantage that you don't lose the customer's order even if payment fails or is rejected.

    Author Comment

    Thanks for the help - just needed to get some confidence i was heading in the right direction...

    Its going well at the moment - almost done just trying to get Paypals IPN to work...

    Thanks Again,

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
    Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now