Hi guys:
Maybe one of you can help me.
I'm writing a recurring payment software package, but I'm encountering a problem. I want to be able to bill a customer EVERY month. The problem however, is months with 31 days and February.
I thought of using mktime and say a person registers on the 31st of january, to simply use:
$samplemonth = mktime(0, 0, 0, 1, 31, 2006);
$samplenextmonth = mktime(0, 0, 0, 2, 31, 2006);
mktime will make the next billing March 1st, 2006 by default. However, if someone registers
$samplemonth = mktime(0, 0, 0, 1, 30, 2006);
$samplenextmonth = mktime(0, 0, 0, 2, 30, 2006);
It will also give back March 1st, 2006. Meaning, the invididuals who registered on the 30th loose a day.
What is the best way to go about this?
I also thought about just charging every 30 days instead of every month, but I'm not sure that is the wisest way. How do credit cards do it?
Thanks for any help you can provide.