Cost based ADs showcase

using the code in a web app with a user login option. Logged users can create ADs and view ADs created by another user. Now want to add pricing plans for users, like user can add particular amount to account and this amount reduced based on the impression and interaction on the ADs he created. The amount per impression and interaction will decide by admin. Need to remove the AD, as soon as the balance in his account becomes zero. Is there any option available for this now?

@matthieu can you help me to sort this?