You can do it if you have a credit card processing account - which varies according to the place.
I'd make sure to really harden whatever box you are using though to store it if you do - you don't want to get hacked.
Personally, I'd try to find a payment solution that will do it for you
- to absolve youserlf of any responsibility in case anything goes
wrong.
I used to keep credit cards on file in paper under lock and key, but
not on disk. I still refuse to keep passwords on disk unless they are
protected with strong encryption and not programmatically available,
and not available over a network (i.e. not on a server). If I get
hacked, I prefer it to be locally
Cheers