Insert the next recurring charge date in custom table when user purchase a product? My site have a subscriber role that have some special permissions. User has to purchase the role. I used ubercart module for this. 

I added a feature to assign role on purchase of subscription. Subscription can be for 1 week, 1 month or 1 year. User can cancel own recurring charge. Uc_role module manages the assign and remove role of user. It handles the next date of recurring. But uc_role not manages the past date. 

My question is that I want to show the user who purchase a subscription in past. Is there any hook or something so I can work on it?
I have done something similar although I don't think it's the best way.

I created a rule that is triggered with the event I wanted and then added an action which was custom php. Then use drupal db api to make the update or insert in the table.

https://drupal.org/project/rules
https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_query/7