* on due date
 * Recurrent Invoices which are paid monthly online are porcessed via this script
 * Will check the user stripe details and will process the invoice payment if its the due date.
 * @see class/RecurrentInvoice.class.php
 * @see class/Stripe.class.php
 */
include_once 'config.php';
include_once 'class/Stripe.class.php';
include_once 'class/stripe-lib/Stripe.php';
set_time_limit(3600);
//echo '<pre>';print_r($_SESSION);echo '</pre>';
$do_recurrent = new RecurrentInvoice();
$do_invoice = new Invoice();
$do_inv_line = new InvoiceLine();
$do_contact = new Contact();
$do_recurrent->getRecInvoiceForStripeProcess();
if ($do_recurrent->getNumRows()) {
    while ($do_recurrent->next()) {
        $do_user_detail = new User();
        $do_invoice = new Invoice();
        $do_invoice->getId($do_recurrent->idinvoice);
        $do_invoice->sessionPersistent("do_invoice", "index.php", OFUZ_TTL);
        $do_user_detail->getId($_SESSION['do_invoice']->iduser);
        $user_settings = $do_user_detail->getChildUserSettings();
        if ($user_settings->getNumRows()) {
            // Get the setting data for the user who has created the invoice
            while ($user_settings->next()) {
                $payment_mode = false;
                $payment_selection = '';
                if ($user_settings->setting_name == 'invoice_logo' && $user_settings->setting_value != '') {
                    $_SESSION['do_invoice']->inv_logo = $user_settings->setting_value;