lib/freemium/manual_billing.rb
# the process you should run periodically
the process you should run periodically
the process you should run periodically
def run_billing
        Freemium.with_activity_logging do
          find_billable.each(&:charge!)
          expire
          Freemium.mailer.deliver_admin_report(
            Freemium.admin_report_recipients,
            Freemium.activity_log
          ) if Freemium.admin_report_recipients
        end
      end
def run_billing Freemium . with_activity_logging do find_billable . each ( & :charge! ) expire Freemium . mailer . deliver_admin_report ( Freemium . admin_report_recipients , Freemium . activity_log ) if Freemium . admin_report_recipients end end
the process you should run periodically
the process you should run periodically
# charge all billable subscriptions # actually expire any subscriptions whose time has come # send the activity report