It depends on the payment gateway you are using.
I work mostly with PayPal and worldpay. they support some kind of callback script.
This script posts back to your site with payment details so you can update your database with payment details, open and close accounts, etc.
They support repeat/recuring payments although you could simply use your own data to manage this process. So if the persons account is due to expire in say 14 days you could send them an email to prompt them for a new payment.