Cleaning up errors from the logs

This commit is contained in:
Hillel Coren 2016-09-12 08:51:41 +03:00
parent ef81549694
commit db4dbdc87e
5 changed files with 14 additions and 8 deletions

View File

@ -6,6 +6,7 @@ use App\Ninja\Repositories\AccountRepository;
use App\Services\PaymentService; use App\Services\PaymentService;
use App\Models\Invoice; use App\Models\Invoice;
use App\Models\Account; use App\Models\Account;
use Exception;
/** /**
* Class ChargeRenewalInvoices * Class ChargeRenewalInvoices
@ -80,8 +81,12 @@ class ChargeRenewalInvoices extends Command
continue; continue;
} }
$this->info("Charging invoice {$invoice->invoice_number}"); try {
$this->paymentService->autoBillInvoice($invoice); $this->info("Charging invoice {$invoice->invoice_number}");
$this->paymentService->autoBillInvoice($invoice);
} catch (Exception $exception) {
$this->info('Error: ' . $exception->getMessage());
}
} }
$this->info('Done'); $this->info('Done');

View File

@ -46,7 +46,7 @@ class DashboardApiController extends BaseAPIController
'paidToDateCurrency' => $paidToDate[0]->currency_id ? $paidToDate[0]->currency_id : 0, 'paidToDateCurrency' => $paidToDate[0]->currency_id ? $paidToDate[0]->currency_id : 0,
'balances' => $balances[0]->value ? $balances[0]->value : 0, 'balances' => $balances[0]->value ? $balances[0]->value : 0,
'balancesCurrency' => $balances[0]->currency_id ? $balances[0]->currency_id : 0, 'balancesCurrency' => $balances[0]->currency_id ? $balances[0]->currency_id : 0,
'averageInvoice' => $averageInvoice[0]->invoice_avg ? $averageInvoice[0]->invoice_avg : 0, 'averageInvoice' => (count($averageInvoice) && $averageInvoice[0]->invoice_avg) ? $averageInvoice[0]->invoice_avg : 0,
'averageInvoiceCurrency' => $averageInvoice[0]->currency_id ? $averageInvoice[0]->currency_id : 0, 'averageInvoiceCurrency' => $averageInvoice[0]->currency_id ? $averageInvoice[0]->currency_id : 0,
'invoicesSent' => $metrics ? $metrics->invoices_sent : 0, 'invoicesSent' => $metrics ? $metrics->invoices_sent : 0,
'activeClients' => $metrics ? $metrics->active_clients : 0, 'activeClients' => $metrics ? $metrics->active_clients : 0,

View File

@ -402,7 +402,7 @@ class StripePaymentDriver extends BasePaymentDriver
$paymentMethod = PaymentMethod::scope(false, $accountId)->where('source_reference', '=', $sourceRef)->first(); $paymentMethod = PaymentMethod::scope(false, $accountId)->where('source_reference', '=', $sourceRef)->first();
if (!$paymentMethod) { if (!$paymentMethod) {
throw new Exception('Unknown payment method'); return false;
} }
if ($eventType == 'customer.source.deleted' || $eventType == 'customer.bank_account.deleted') { if ($eventType == 'customer.source.deleted' || $eventType == 'customer.bank_account.deleted') {

View File

@ -353,9 +353,9 @@
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var target = $(e.target).attr("href") // activated tab var target = $(e.target).attr("href") // activated tab
var scrollmem = $('html,body').scrollTop(); if (history.pushState) {
window.location.hash = target; history.pushState(null, null, target);
$('html,body').scrollTop(scrollmem); }
}); });
}); });

View File

@ -4,7 +4,8 @@
@parent @parent
@if (isset($accountGateway) && $accountGateway->getPlaidEnabled()) @if (isset($accountGateway) && $accountGateway->getPlaidEnabled())
<a href="https://plaid.com/products/auth/" target="_blank" style="display:none" id="secured_by_plaid"><img src="{{ URL::to('images/plaid-logowhite.svg') }}">{{ trans('texts.secured_by_plaid') }}</a> <a href="https://plaid.com/products/auth/" target="_blank" style="display:none" id="secured_by_plaid">
<img src="{{ URL::to('images/plaid-logowhite.svg') }}">{{ trans('texts.secured_by_plaid') }}</a>
<script src="https://cdn.plaid.com/link/stable/link-initialize.js"></script> <script src="https://cdn.plaid.com/link/stable/link-initialize.js"></script>
@endif @endif