i wouldnt even thing about writting one yourself unless your a dab hand at 128bit encription.

there are plenty of 3rd party software out there that will handle credit card details for you though