perleager has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I'm opening up a online flower shop and would like to start with installing a shopping cart.

Now, I'm stuck between wanting to install a already made shopping cart or programming one using Perl. If I decide to program a fresh on in Perl, are there a lot of security holes you must program your shopping cart. The thing is that I'm not sure if I"m advanced enough to make a shopping cart very safe and secure, yet at the same time very useful and simple.

Are there any suggestions on what I should do? Would going with an already made one be that bad? If yes, any suggestions on whats a good Perl shopping cart?

Thank you,
Anthony

Replies are listed 'Best First'.
Re: A Secure Shopping Cart option
by Zaxo (Archbishop) on Aug 05, 2004 at 09:28 UTC

    If you're starting up a business, you probably don't have time to learn all you need to know to do this for yourself. The ideal solution would be to hire someone who's done it well before. Several times. That would be expensive, so next best is a properly built commodity script.

    A canned script would not be bad for being written by someone else, but there are lots of bad scripts out there. I can't make a recommendation among those now available, but I can suggest some things to look for.

    1. Runs under strict and warnings. That guards against a swarm of elementary errors.
    2. Runs in taint mode. A simple precaution against some unsafe practices.
    3. Uses perl core and CPAN modules instead of rolling its own routines for common needs. CGI, DBI, File::Basename, LWP and more are often displaced but rarely replaced. Hand-rolling is the mark of an amateur coder. He'll make other mistakes you may not see in time.
    4. Checks for errors and reacts correctly after each trip to the system - open, close, DBI calls, all of it. That is another mark of careful attention to quality.
    5. Make sure that all modifiable files are correctly locked in use. That prevents expensive errors and loss of data.
    6. Similarly, look out for race conditions in creating temporary files names.
    7. Look with caution at all email usage. Beware open relays and other weaknesses. Designers love open relays and never really believe in the damage they do.
    8. See that logins, credit card transactions, and so on are always conducted over the https protocol.
    9. Check that good advantage is taken of server facilities for authentication and other access control. suExec is valuable for allowing best use of unix file permissions.
    10. Doesn't store passwords, stores cryptographic digests of them.

    That list is not complete by any means, but it will give you a basis for judging the quality of a script. Sorry I couldn't make a recommendation, but I'm sure you'll get plenty of advice from the other monks.

    After Compline,
    Zaxo

Re: A Secure Shopping Cart option
by dba (Monk) on Aug 05, 2004 at 10:05 UTC
    You might want to consider setting up secure online store provided by many portals like yahoo. It is meant to be for small businesses. They are relatively safe compared to setting up /maintaining /patching your servers.
    Good Luck with your flower shop.
Re: A Secure Shopping Cart option
by Jaap (Curate) on Aug 05, 2004 at 12:07 UTC
    Take a look at Maypole too, it enables you to make a web-frontend to a database real quick. Some tutorial (on perl.com?) makes a shopping cart in it too.
      I wouldn't recommend that. There is currently no one using Maypole for actual commerce, and the examples in the article are highly over-simplified. You'd be better off using an actual commerce package like Interchange, even though it has a lot of questionable design issues.
Re: A Secure Shopping Cart option
by danielcid (Scribe) on Aug 05, 2004 at 12:09 UTC

    Just completing what Zaxo said:

    -If you are going to use your own server to host the website:
    -- Keep it safe and updated. To have a secure application you must have a secure OS.
    - If you are hosting it somewhere else:
    -- Choose a good company. Check to see if they have the right security practices.

    Btw, avoid storing credit cards in your database.

    -DBC
Re: A Secure Shopping Cart option
by inman (Curate) on Aug 05, 2004 at 13:03 UTC
    You really need business advice in addition to any technical advice that we can offer. Try talking to your bank about their merchant services and find out what they can offer in terms of online payment processing. There are a couple of reasons for this. Firstly, they are responsible for the security of the transaction and as such will have built and tested a reasonably secure system. Secondly, as a new business, you may not be able to get a credit card merchant account until you can show that you are a legit business with a number of years credit history.

    good luck.

Re: A Secure Shopping Cart option
by shotgunefx (Parson) on Aug 05, 2004 at 13:05 UTC
      True, on the surface, Yahoo has a good solution. However, they do not allow for much flexibility and the system can be difficult to work with if you have a complicated product line with lots of sizes, colors, options, etc. We tried like crazy to make it work, but had to abandon Yahoo for other solutions that allowed us more control (Perl, MySQL, etc.) Again, if your product line is kept simple, Yahoo solves lots of expensive problems with a minimum of hassle. My 2 cents.

      —Brad
      "Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton
        True it can be difficult in some aspects (though you can get around almost everything with enough know-how and effort) but there are a couple of counter points. You could just link to the cart and host it elsewhere and also, they have a new system (StoreTags) that is just tagged based so you can design your site with any tool you want.


        -Lee

        "To be civilized is to deny one's nature."
Re: A Secure Shopping Cart option
by markjugg (Curate) on Aug 05, 2004 at 19:03 UTC
    I have built several custom e-commerce systems in Perl myself, as well as worked some with pre-made options, including Interchange, Web+Shop and OScommerce (which I'm still evaluating). If you have generic needs and expect things to stay that way for the short term, I recommend looking at pre-made options.

    Right now I'm impressed with OScommerce, although it is written in PHP and MySQL. I would recommend that you take a look at it as well.

    If you really want to jump into rolling your own, you may want to contact this fellow from the CGI::Application list, who is also working on a new Perl-based. e-commerce system now.

    I would be prepared to spend at least 30-50 hours of development time if you go this route.