Пример #1
0
            $_SESSION['do_invoice']->authnet_merchant_id = $user_settings->setting_value;
        }
        if ($user_settings->setting_name == 'paypal_business_email' && $user_settings->setting_value != '') {
            $_SESSION['do_invoice']->paypal_business_email = $user_settings->setting_value;
        }
        if ($user_settings->setting_name == 'currency' && $user_settings->setting_value != '') {
            $currency = explode("-", $user_settings->setting_value);
            $_SESSION['do_invoice']->currency_iso_code = $currency[0];
            $_SESSION['do_invoice']->currency_sign = $currency[1];
            $_SESSION['do_invoice']->setCurrencyDisplay();
            $_SESSION['do_invoice']->getCurrencyPostion();
        }
    }
}
$_SESSION['do_invoice']->user_edit_amount = false;
$reg_user = new RegistrationInvoiceLog();
$reg_user_id = $reg_user->getUserIdRegistered($idinvoice, $do_user_detail->iduser);
if ($reg_user_id !== False) {
    $_SESSION['autologin_userid'] = $reg_user_id;
}
if ($invoice_access) {
    if (isset($_SESSION["upgrade"])) {
        header("Location: /invoice_pay_stripe.php");
    } else {
        header("Location: /invoice_pay_auth.php");
    }
} else {
    echo "Oups";
}
exit;
// will delete everything bellow once sure I do not need anything.
 function get_reg_user_invoice()
 {
     $do_api_reg_inv_log = new RegistrationInvoiceLog();
     $iduser_returned = $do_api_reg_inv_log->getUserIdRegistered($this->idinvoice, $this->iduser);
     if ($iduser_returned) {
         $this->setValues(array("msg" => "Reg User Id Found", "stat" => "ok", "code" => "810", "iduser" => $iduser_returned));
         return true;
     } else {
         $this->setValues(array("msg" => "Reg User Id Not Found", "stat" => "fail", "code" => "811"));
         return true;
     }
 }
     $do_inv_line->addNew();
     $do_inv_line->idinvoice = $idinvoice;
     $do_inv_line->description = $inv_line->description;
     $do_inv_line->price = $inv_line->price;
     $do_inv_line->qty = $inv_line->qty;
     $do_inv_line->total = $inv_line->total;
     $do_inv_line->item = $inv_line->item;
     $do_inv_line->add();
 }
 $do_invoice->setInvoiceCalculations($idinvoice);
 // Call this method for other calculations
 //update callback
 $do_inv_callbak = new InvoiceCallback();
 $do_inv_callbak->updateCallBack($do_recurrent->idcontact, $idinvoice);
 // Process RegistrationInvoiceLog will update only if the invoice is from registration Part of Ofuz.com
 $do_RegistrationInvoiceLog = new RegistrationInvoiceLog();
 // @params old invoiceid,new invoice id and the iduser
 $do_RegistrationInvoiceLog->process_reg_invoice_log($do_recurrent->idinvoice, $idinvoice, $do_recurrent->iduser);
 // Update Recurrent
 $do_recurrent_update = new RecurrentInvoice();
 $next_date = $do_recurrent_update->getNextDate($do_recurrent->recurrence, $do_recurrent->recurrencetype, $do_recurrent->nextdate);
 $do_recurrent_update->getId($do_recurrent->idrecurrentinvoice);
 $do_recurrent_update->nextdate = $next_date;
 $do_recurrent_update->idinvoice = $idinvoice;
 $do_recurrent_update->update();
 $do_recurrent_update->free();
 //Sending Email to the customer
 //echo 'Calling method sendInvoiceByEmail()..........<br />';
 $do_inv_add->sendInvoiceByEmail($idinvoice, $do_inv_add->idcontact, $do_inv_add->iduser, true);
 $do_inv_add->free();
 //}