I agree with jnpcl - you probably should not do this yourself if you have never done it AND have a 1 month deadline AND it is not YOUR site initially. You should have a decent amount of time to test it yourself and in real cases if you are learning.
However, if you have a reasonable client and some decent flex time, then maybe you should begin by looking into ssl certificates and the whole encryption concept. Comodo SSL is good. Never pass credit card data through cookies, never store them in your database, never pass them as hidden form field elements. By this I mean multi-part checkout where the user enters card data then gets taken to another page on your site before the real processing begins. Your card data form should be the last in the chain before sending the request to the payment gateway, which will likely be handled via cURL if you are using a payment gateway and not something like paypal.
http://www.authorize.net has reasonable rates and a fairly easy API to get you processing cards in no time. If you follow their examples, they explain the security end of the API in their documentation.
If you intend to plug in a third party cart, then something like magento might work for you. But with a 1 month deadline, I would say the learning curve for skinning magento alone is enough to consume your production time. It does have a robust option selection and most of my clients love it. I think it is slow though.
Alternatively, if the goal of this post is just to find a solution to your predicament, then I suggest using something like http://www.e-junkie.com to handle your cart needs. If I recall, they handle variations and stock - like shirt colors, and quantity, etc - and take all major payment types while also handling the security for you since the user pays via paypal or google checkout and maybe some others.
In the end, it will serve you well to know how to do it yourself, so the path I suggest, if possible, is to get a SSL, then set up an account with authorize.net and follow the code they provide you with. Look it over, figure out what the software is doing, and integrate it. It took me about 2 weeks in my spare time when I was first getting into e-commerce many years ago.