$properties['invoice_pages'] = (int) ($invoiceno / $pagesize); $properties['invoice_page'] = $page; $invoices = array(); foreach ($invoiceList as $invoiceid) { $invoices[$invoiceid] = array(); $invoice = new Invoice(); $invoice->load($invoiceid); $rowstyle = ''; $actionsarray = array(); if (!in_array($invoice->method, $excludedprocs)) { $actionsarray[] = array('task' => 'invoicePrint', 'add' => 'invoice=' . $invoice->invoice_number . '&tmpl=component', 'text' => JText::_('HISTORY_ACTION_PRINT'), 'insert' => ' target="_blank" ', 'class' => 'btn'); $actionsarray[] = array('task' => 'invoicePDF', 'add' => 'invoice=' . $invoice->invoice_number, 'text' => 'PDF', 'insert' => '', 'class' => 'btn'); } if ($invoice->transaction_date == '0000-00-00 00:00:00' || $invoice->subscr_id) { if ($invoice->transaction_date == '0000-00-00 00:00:00') { $actionsarray[] = array('task' => 'repeatPayment', 'add' => 'invoice=' . $invoice->invoice_number . '&' . xJ::token() . '=1', 'text' => JText::_('HISTORY_ACTION_REPEAT'), 'class' => 'btn btn-success'); if (is_null($invoice->fixed) || !$invoice->fixed) { $actionsarray[] = array('task' => 'cancelPayment', 'add' => 'invoice=' . $invoice->invoice_number, 'text' => JText::_('HISTORY_ACTION_CANCEL'), 'class' => 'btn btn-danger'); } } $rowstyle = 'invoice-unpaid'; } if (!in_array($invoice->method, $pplist)) { $pplist[] = $invoice->method; } $invoice->formatInvoiceNumber(); $invoices[$invoiceid]['object'] = $invoice; $invoices[$invoiceid]['invoice_number'] = $invoice->invoice_number; $invoices[$invoiceid]['amount'] = $invoice->amount; $invoices[$invoiceid]['currency_code'] = $invoice->currency; $invoices[$invoiceid]['actions'] = $actionsarray;
public function checkout($repeat = 0, $error = null, $coupon = null) { global $aecConfig; if (!$this->checkAuth()) { return false; } $this->puffer(); $this->touchInvoice(false, true); if ($this->invoice->method != $this->processor) { $this->invoice->method = $this->processor; $this->invoice->storeload(); } // Delete TempToken - the data is now safe with the invoice $temptoken = new aecTempToken(); $temptoken->getComposite(); if ($temptoken->id) { $temptoken->delete(); } if (!empty($coupon)) { $this->InvoiceAddCoupon($coupon); } $user_ident = aecGetParam('user_ident', 0, true, array('string', 'clear_nonemail')); if (!empty($user_ident) && !empty($this->invoice->id)) { if ($this->invoice->addTargetUser(strtolower($user_ident))) { $this->invoice->storeload(); } } $repeat = empty($repeat) ? 0 : $repeat; $exceptproc = array('none', 'free'); $recurring = false; if (!in_array(strtolower($this->processor), $exceptproc)) { if (is_object($this->pp)) { if (isset($this->invoice->params['userselect_recurring'])) { $recurring_choice = $this->invoice->params['userselect_recurring']; } else { $recurring_choice = null; } $recurring = $this->pp->is_recurring($recurring_choice); } } // If this is marked as supposedly free if (in_array(strtolower($this->processor), $exceptproc) && !empty($this->plan)) { // Double Check Amount for made_free $this->invoice->computeAmount($this); if (!empty($this->invoice->made_free) || $this->plan->params['full_free'] && empty($this->invoice->counter) && empty($this->plan->params['trial_period']) || $this->plan->params['full_free'] && $this->invoice->counter || $this->plan->params['trial_free'] && empty($this->invoice->counter)) { // Only allow clearing while recurring if everything is free if (!($recurring && (empty($this->plan->params['full_free']) || empty($this->plan->params['trial_free'])))) { // mark paid if ($this->invoice->pay() !== false) { return $this->thanks(false, true); } } } return getView('access_denied'); } elseif (in_array(strtolower($this->processor), $exceptproc)) { if (!empty($this->invoice->made_free)) { // mark paid if ($this->invoice->pay() !== false) { return $this->thanks(false, true); } } return getView('access_denied'); } elseif (strcmp(strtolower($this->processor), 'error') === 0) { // Nope, won't work buddy return getView('access_denied'); } if (!empty($this->pp)) { if ($this->pp->requireSSLcheckout() && empty($_SERVER['HTTPS']) && !$aecConfig->cfg['override_reqssl']) { aecRedirect(AECToolbox::deadsureURL("index.php?option=com_acctexp&task=repeatPayment&invoice=" . $this->invoice->invoice_number . "&first=" . ($repeat ? 0 : 1) . '&' . xJ::token() . '=1', true, true)); exit; } } $this->loadItems(); $this->loadItemTotal(); $exchange = $silent = null; $this->triggerMIs('invoice_items_checkout', $exchange, $this->items, $silent); // Either this is fully free, or the next term is free and this is non recurring if (!empty($this->items->grand_total) && !$recurring) { if ($this->items->grand_total->isFree() && !$recurring) { $this->invoice->pay(); return $this->thanks(false, true); } } return $this->InvoiceToCheckout($repeat, $error); }
public function url($params, $profile = false) { if (empty($params['option'])) { $params = array_merge(array('option' => 'com_acctexp'), $params); } $params[xJ::token()] = '1'; $p = array(); foreach ($params as $k => $v) { $p[] = $k . '=' . $v; } if ($profile) { $secure = $this->cfg['ssl_profile']; } else { $secure = $this->cfg['ssl_signup']; } return AECToolbox::deadsureURL('index.php?' . implode("&", $p), $secure); }
*/ // Dont allow direct linking defined('_JEXEC') or die('Direct Access to this location is not allowed.'); if (!empty($metaUser->objSubscription->signup_date)) { echo '<p>' . JText::_('MEMBER_SINCE') . ' ' . $tmpl->date($metaUser->objSubscription->signup_date) . '</p>'; } if (!empty($properties['showcheckout'])) { ?> <div class="details-openinvoice"> <p> <?php echo JText::_('PENDING_OPENINVOICE'); ?> <a href="<?php echo AECToolbox::deadsureURL('index.php?option=' . $option . '&task=repeatPayment&invoice=' . $properties['showcheckout'] . '&userid=' . $metaUser->userid . '&' . xJ::token() . '=1'); ?> " title="<?php echo JText::_('GOTO_CHECKOUT'); ?> "><?php echo JText::_('GOTO_CHECKOUT'); ?> </a> </p> </div> <?php } if ($metaUser->hasSubscription) { if ($properties['alert']['level'] > 2) { $al = ' alert-success';