Move logging to nlog

This commit is contained in:
= 2020-12-30 08:10:03 +11:00
parent b47f9941c0
commit 7a058c9ae6
42 changed files with 145 additions and 145 deletions

View File

@ -339,7 +339,7 @@ class CheckData extends Command
$total_invoice_payments += $credit_total_applied; $total_invoice_payments += $credit_total_applied;
} //todo this is contentious } //todo this is contentious
info("total invoice payments = {$total_invoice_payments} with client paid to date of of {$client->paid_to_date}"); nlog("total invoice payments = {$total_invoice_payments} with client paid to date of of {$client->paid_to_date}");
if (round($total_invoice_payments, 2) != round($client->paid_to_date, 2)) { if (round($total_invoice_payments, 2) != round($client->paid_to_date, 2)) {
$wrong_paid_to_dates++; $wrong_paid_to_dates++;

View File

@ -42,42 +42,42 @@ class PostUpdate extends Command
{ {
set_time_limit(0); set_time_limit(0);
info('running post update'); nlog('running post update');
try { try {
Artisan::call('migrate', ['--force' => true]); Artisan::call('migrate', ['--force' => true]);
} catch (\Exception $e) { } catch (\Exception $e) {
info("I wasn't able to migrate the data."); nlog("I wasn't able to migrate the data.");
} }
info("finished migrating"); nlog("finished migrating");
exec('vendor/bin/composer install --no-dev:'); exec('vendor/bin/composer install --no-dev:');
info("finished running composer install "); nlog("finished running composer install ");
try { try {
Artisan::call('optimize'); Artisan::call('optimize');
} catch (\Exception $e) { } catch (\Exception $e) {
info("I wasn't able to optimize."); nlog("I wasn't able to optimize.");
} }
info("optimized"); nlog("optimized");
try { try {
Artisan::call('view:clear'); Artisan::call('view:clear');
} catch (\Exception $e) { } catch (\Exception $e) {
info("I wasn't able to clear the views."); nlog("I wasn't able to clear the views.");
} }
info("view cleared"); nlog("view cleared");
/* For the following to work, the web user (www-data) must own all the directories */ /* For the following to work, the web user (www-data) must own all the directories */
VersionCheck::dispatch(); VersionCheck::dispatch();
info("sent for version check"); nlog("sent for version check");
// echo "Done."; // echo "Done.";
} }

View File

@ -60,7 +60,7 @@ class GmailTransport extends Transport
$this->gmail->cc($message->getCc()); $this->gmail->cc($message->getCc());
$this->gmail->bcc($message->getBcc()); $this->gmail->bcc($message->getBcc());
info(print_r($message->getChildren(), 1)); nlog(print_r($message->getChildren(), 1));
foreach ($message->getChildren() as $child) { foreach ($message->getChildren() as $child) {
$this->gmail->attach($child); $this->gmail->attach($child);

View File

@ -221,7 +221,7 @@ class MigrationController extends BaseController
$companies = json_decode($request->companies); $companies = json_decode($request->companies);
if (app()->environment() === 'local') { if (app()->environment() === 'local') {
info($request->all()); nlog($request->all());
} }
foreach ($companies as $company) { foreach ($companies as $company) {
@ -244,7 +244,7 @@ class MigrationController extends BaseController
// If there's existing company and ** no ** force is provided - skip migration. // If there's existing company and ** no ** force is provided - skip migration.
if ($checks['existing_company'] == true && $checks['force'] == false) { if ($checks['existing_company'] == true && $checks['force'] == false) {
info('Migrating: Existing company without force. (CASE_01)'); nlog('Migrating: Existing company without force. (CASE_01)');
MailRouter::dispatch(new ExistingMigration(), $existing_company, $user); MailRouter::dispatch(new ExistingMigration(), $existing_company, $user);
@ -257,7 +257,7 @@ class MigrationController extends BaseController
// If there's existing company and force ** is provided ** - purge the company and migrate again. // If there's existing company and force ** is provided ** - purge the company and migrate again.
if ($checks['existing_company'] == true && $checks['force'] == true) { if ($checks['existing_company'] == true && $checks['force'] == true) {
info("purging the existing company here"); nlog("purging the existing company here");
$this->purgeCompanyWithForceFlag($existing_company); $this->purgeCompanyWithForceFlag($existing_company);
$account = auth()->user()->account; $account = auth()->user()->account;
@ -330,10 +330,10 @@ class MigrationController extends BaseController
try { try {
// StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5)); // StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5));
info($migration_file); nlog($migration_file);
StartMigration::dispatch($migration_file, $user, $fresh_company); StartMigration::dispatch($migration_file, $user, $fresh_company);
} catch (\Exception $e) { } catch (\Exception $e) {
info($e->getMessage()); nlog($e->getMessage());
} }
} }

View File

@ -181,7 +181,7 @@ class PreviewController extends BaseController
$invoice->setRelation('company', auth()->user()->company()); $invoice->setRelation('company', auth()->user()->company());
$invoice->load('client'); $invoice->load('client');
// info(print_r($invoice->toArray(),1)); // nlog(print_r($invoice->toArray(),1));
$design_object = json_decode(json_encode(request()->input('design'))); $design_object = json_decode(json_encode(request()->input('design')));

View File

@ -65,12 +65,12 @@ class SelfUpdateController extends BaseController
/* .git MUST be owned/writable by the webserver user */ /* .git MUST be owned/writable by the webserver user */
$repo = new GitRepository(base_path()); $repo = new GitRepository(base_path());
info('Are there changes to pull? '.$repo->hasChanges()); nlog('Are there changes to pull? '.$repo->hasChanges());
try { try {
$res = $repo->pull(); $res = $repo->pull();
} catch (GitException $e) { } catch (GitException $e) {
info($e->getMessage()); nlog($e->getMessage());
return response()->json(['message'=>$e->getMessage()], 500); return response()->json(['message'=>$e->getMessage()], 500);
} }

View File

@ -56,13 +56,13 @@ class SetupController extends Controller
try { try {
$check = SystemHealth::check(false); $check = SystemHealth::check(false);
} catch (\Exception $e) { } catch (\Exception $e) {
info(['message' => $e->getMessage(), 'action' => 'SetupController::doSetup()']); nlog(['message' => $e->getMessage(), 'action' => 'SetupController::doSetup()']);
return response()->json(['message' => $e->getMessage()], 400); return response()->json(['message' => $e->getMessage()], 400);
} }
if ($check['system_health'] === false) { if ($check['system_health'] === false) {
info($check); nlog($check);
return response('Oops, something went wrong. Check your logs.'); /* We should never reach this block, but just in case. */ return response('Oops, something went wrong. Check your logs.'); /* We should never reach this block, but just in case. */
} }
@ -149,7 +149,7 @@ class SetupController extends Controller
return redirect('/'); return redirect('/');
} catch (Exception $e) { } catch (Exception $e) {
info($e->getMessage()); nlog($e->getMessage());
return redirect() return redirect()
->back() ->back()
@ -174,7 +174,7 @@ class SetupController extends Controller
return response($status, 400); return response($status, 400);
} catch (\Exception $e) { } catch (\Exception $e) {
info(['message' => $e->getMessage(), 'action' => 'SetupController::checkDB()']); nlog(['message' => $e->getMessage(), 'action' => 'SetupController::checkDB()']);
return response()->json(['message' => $e->getMessage()], 400); return response()->json(['message' => $e->getMessage()], 400);
} }
@ -197,7 +197,7 @@ class SetupController extends Controller
return response()->json(['message' => $response['message']], 400); return response()->json(['message' => $response['message']], 400);
} }
} catch (Exception $e) { } catch (Exception $e) {
info(['message' => $e->getMessage(), 'action' => 'SetupController::checkMail()']); nlog(['message' => $e->getMessage(), 'action' => 'SetupController::checkMail()']);
return response()->json(['message' => $e->getMessage()], 400); return response()->json(['message' => $e->getMessage()], 400);
} }
@ -235,7 +235,7 @@ class SetupController extends Controller
return response(['url' => asset('test.pdf')], 200); return response(['url' => asset('test.pdf')], 200);
} catch (Exception $e) { } catch (Exception $e) {
info($e->getMessage()); nlog($e->getMessage());
return response([], 500); return response([], 500);
} }

View File

@ -51,10 +51,10 @@ class QueryLogging
$timeEnd = microtime(true); $timeEnd = microtime(true);
$time = $timeEnd - $timeStart; $time = $timeEnd - $timeStart;
Log::info($request->method().' - '.$request->url().": $count queries - ".$time); nlog($request->method().' - '.$request->url().": $count queries - ".$time);
// if($count > 50) // if($count > 50)
// Log::info($queries); // Log::nlog($queries);
} }
} }

View File

@ -33,7 +33,7 @@ class SetEmailDb
]; ];
if ($request->input('email') && config('ninja.db.multi_db_enabled')) { if ($request->input('email') && config('ninja.db.multi_db_enabled')) {
info("trying to find db"); nlog("trying to find db");
if (! MultiDB::userFindAndSetDb($request->input('email'))) { if (! MultiDB::userFindAndSetDb($request->input('email'))) {
return response()->json($error, 400); return response()->json($error, 400);
} }

View File

@ -39,7 +39,7 @@ class StorePaymentRequest extends Request
{ {
$input = $this->all(); $input = $this->all();
// info(print_r($input,1)); // nlog(print_r($input,1));
$invoices_total = 0; $invoices_total = 0;
$credits_total = 0; $credits_total = 0;

View File

@ -33,7 +33,7 @@ class CheckMailRequest extends Request
*/ */
public function rules() public function rules()
{ {
info($this->driver); nlog($this->driver);
return [ return [
'mail_driver' => 'required', 'mail_driver' => 'required',

View File

@ -85,10 +85,10 @@ class ValidCreditsRules implements Rule
// $total_payments = $this->input['amount'] + array_sum(array_column($this->input['credits'], 'amount')); // $total_payments = $this->input['amount'] + array_sum(array_column($this->input['credits'], 'amount'));
// info(print_r($this->input,1)); // nlog(print_r($this->input,1));
// info("total payments = {$total_payments}"); // nlog("total payments = {$total_payments}");
// info("total credits available = " . array_sum(array_column($this->input['credits'], 'amount'))); // nlog("total credits available = " . array_sum(array_column($this->input['credits'], 'amount')));
// info("total invoices payable = " . array_sum(array_column($this->input['invoices'], 'amount'))); // nlog("total invoices payable = " . array_sum(array_column($this->input['invoices'], 'amount')));
// if($total_payments > array_sum(array_column($this->input['invoices'], 'amount'))){ // if($total_payments > array_sum(array_column($this->input['invoices'], 'amount'))){

View File

@ -71,8 +71,8 @@ class PaymentAmountsBalanceRule implements Rule
return true; return true;
} // if no invoices are present, then this is an unapplied payment, let this pass validation! } // if no invoices are present, then this is an unapplied payment, let this pass validation!
// info("payment amounts = {$payment_amounts}"); // nlog("payment amounts = {$payment_amounts}");
// info("invoice amounts = {$invoice_amounts}"); // nlog("invoice amounts = {$invoice_amounts}");
return $payment_amounts >= $invoice_amounts; return $payment_amounts >= $invoice_amounts;
} }

View File

@ -39,7 +39,7 @@ class RecurringInvoicesCron
public function handle() : void public function handle() : void
{ {
/* Get all invoices where the send date is less than NOW + 30 minutes() */ /* Get all invoices where the send date is less than NOW + 30 minutes() */
info("Sending recurring invoices ".Carbon::now()->format('Y-m-d h:i:s')); nlog("Sending recurring invoices ".Carbon::now()->format('Y-m-d h:i:s'));
if (! config('ninja.db.multi_db_enabled')) { if (! config('ninja.db.multi_db_enabled')) {
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now()) $recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now())
@ -47,10 +47,10 @@ class RecurringInvoicesCron
->with('company') ->with('company')
->cursor(); ->cursor();
Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count()); nlog(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count());
$recurring_invoices->each(function ($recurring_invoice, $key) { $recurring_invoices->each(function ($recurring_invoice, $key) {
info("Current date = " . now()->format("Y-m-d") . " Recurring date = " .$recurring_invoice->next_send_date); nlog("Current date = " . now()->format("Y-m-d") . " Recurring date = " .$recurring_invoice->next_send_date);
if (!$recurring_invoice->company->is_disabled) { if (!$recurring_invoice->company->is_disabled) {
SendRecurring::dispatchNow($recurring_invoice, $recurring_invoice->company->db); SendRecurring::dispatchNow($recurring_invoice, $recurring_invoice->company->db);
@ -66,10 +66,10 @@ class RecurringInvoicesCron
->with('company') ->with('company')
->cursor(); ->cursor();
Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db); nlog(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db);
$recurring_invoices->each(function ($recurring_invoice, $key) { $recurring_invoices->each(function ($recurring_invoice, $key) {
info("Current date = " . now()->format("Y-m-d") . " Recurring date = " .$recurring_invoice->next_send_date); nlog("Current date = " . now()->format("Y-m-d") . " Recurring date = " .$recurring_invoice->next_send_date);
if (!$recurring_invoice->company->is_disabled) { if (!$recurring_invoice->company->is_disabled) {
SendRecurring::dispatchNow($recurring_invoice, $recurring_invoice->company->db); SendRecurring::dispatchNow($recurring_invoice, $recurring_invoice->company->db);

View File

@ -146,7 +146,7 @@ class CreateEntityPdf implements ShouldQueue
->build(); ->build();
//todo - move this to the client creation stage so we don't keep hitting this unnecessarily //todo - move this to the client creation stage so we don't keep hitting this unnecessarily
//info("make dir => {$path}"); //nlog("make dir => {$path}");
//Storage::makeDirectory($path, 0775); //Storage::makeDirectory($path, 0775);
$pdf = null; $pdf = null;
@ -154,11 +154,11 @@ class CreateEntityPdf implements ShouldQueue
try { try {
$pdf = $this->makePdf(null, null, $maker->getCompiledHTML(true)); $pdf = $this->makePdf(null, null, $maker->getCompiledHTML(true));
} catch (\Exception $e) { } catch (\Exception $e) {
info(print_r($e->getMessage(), 1)); nlog(print_r($e->getMessage(), 1));
} }
if (config('ninja.log_pdf_html')) { if (config('ninja.log_pdf_html')) {
info($maker->getCompiledHTML()); nlog($maker->getCompiledHTML());
} }
if ($pdf) { if ($pdf) {
@ -170,6 +170,6 @@ class CreateEntityPdf implements ShouldQueue
public function failed(\Exception $exception) public function failed(\Exception $exception)
{ {
info("help!"); nlog("help!");
} }
} }

View File

@ -110,7 +110,7 @@ class CSVImport implements ShouldQueue
'settings' => $this->company->settings 'settings' => $this->company->settings
]; ];
//info(print_r($data, 1)); //nlog(print_r($data, 1));
MailRouter::dispatch(new ImportCompleted($data), $this->company, auth()->user()); MailRouter::dispatch(new ImportCompleted($data), $this->company, auth()->user());
} }
@ -136,7 +136,7 @@ class CSVImport implements ShouldQueue
} }
if (!$invoice_number_key) { if (!$invoice_number_key) {
info("no invoice number to use as key - returning"); nlog("no invoice number to use as key - returning");
return; return;
} }

View File

@ -96,8 +96,8 @@ class BaseMailerJob implements ShouldQueue
public function failed($exception = null) public function failed($exception = null)
{ {
info('the job failed'); nlog('the job failed');
info($exception->getMessage()); nlog($exception->getMessage());
$job_failure = new EmailFailure(); $job_failure = new EmailFailure();
$job_failure->string_metric5 = get_parent_class($this); $job_failure->string_metric5 = get_parent_class($this);

View File

@ -49,7 +49,7 @@ class SendReminders implements ShouldQueue
*/ */
public function handle() public function handle()
{ {
info("Sending reminders ".Carbon::now()->format('Y-m-d h:i:s')); nlog("Sending reminders ".Carbon::now()->format('Y-m-d h:i:s'));
if (! config('ninja.db.multi_db_enabled')) { if (! config('ninja.db.multi_db_enabled')) {
$this->sendReminderEmails(); $this->sendReminderEmails();
@ -79,7 +79,7 @@ class SendReminders implements ShouldQueue
})->each(function ($invoice) { })->each(function ($invoice) {
$reminder_template = $invoice->calculateTemplate('invoice'); $reminder_template = $invoice->calculateTemplate('invoice');
info("hitting a reminder for {$invoice->number} with template {$reminder_template}"); nlog("hitting a reminder for {$invoice->number} with template {$reminder_template}");
if (in_array($reminder_template, ['reminder1', 'reminder2', 'reminder3', 'endless_reminder'])) { if (in_array($reminder_template, ['reminder1', 'reminder2', 'reminder3', 'endless_reminder'])) {
$this->sendReminder($invoice, $reminder_template); $this->sendReminder($invoice, $reminder_template);
@ -208,7 +208,7 @@ class SendReminders implements ShouldQueue
//only send if enable_reminder setting is toggled to yes //only send if enable_reminder setting is toggled to yes
if ($this->checkSendSetting($invoice, $template)) { if ($this->checkSendSetting($invoice, $template)) {
info("firing email"); nlog("firing email");
EmailEntity::dispatchNow($invitation, $invitation->company, $template); EmailEntity::dispatchNow($invitation, $invitation->company, $template);
} }

View File

@ -82,7 +82,7 @@ class EmailPayment extends BaseMailerJob implements ShouldQueue
$mail = Mail::to($this->contact->email, $this->contact->present()->name()); $mail = Mail::to($this->contact->email, $this->contact->present()->name());
$mail->send(new TemplateEmail($email_builder, $this->contact->user, $this->contact->client)); $mail->send(new TemplateEmail($email_builder, $this->contact->user, $this->contact->client));
} catch (\Exception $e) { } catch (\Exception $e) {
info("mailing failed with message " . $e->getMessage()); nlog("mailing failed with message " . $e->getMessage());
event(new PaymentWasEmailedAndFailed($this->payment, $this->company, Mail::failures(), Ninja::eventVars())); event(new PaymentWasEmailedAndFailed($this->payment, $this->company, Mail::failures(), Ninja::eventVars()));
$this->failed($e); $this->failed($e);
return $this->logMailError($e->getMessage(), $this->payment->client); return $this->logMailError($e->getMessage(), $this->payment->client);

View File

@ -65,12 +65,12 @@ class SendRecurring implements ShouldQueue
->createInvitations() ->createInvitations()
->save(); ->save();
info("Invoice {$invoice->number} created"); nlog("Invoice {$invoice->number} created");
$invoice->invitations->each(function ($invitation) use ($invoice) { $invoice->invitations->each(function ($invitation) use ($invoice) {
if ($invitation->contact && strlen($invitation->contact->email) >=1) { if ($invitation->contact && strlen($invitation->contact->email) >=1) {
EmailEntity::dispatch($invitation, $invoice->company); EmailEntity::dispatch($invitation, $invoice->company);
info("Firing email for invoice {$invoice->number}"); nlog("Firing email for invoice {$invoice->number}");
} }
}); });
@ -78,7 +78,7 @@ class SendRecurring implements ShouldQueue
$invoice->service()->autoBill()->save(); $invoice->service()->autoBill()->save();
} }
info("updating recurring invoice dates"); nlog("updating recurring invoice dates");
/* Set next date here to prevent a recurring loop forming */ /* Set next date here to prevent a recurring loop forming */
$this->recurring_invoice->next_send_date = $this->recurring_invoice->nextSendDate()->format('Y-m-d'); $this->recurring_invoice->next_send_date = $this->recurring_invoice->nextSendDate()->format('Y-m-d');
$this->recurring_invoice->remaining_cycles = $this->recurring_invoice->remainingCycles(); $this->recurring_invoice->remaining_cycles = $this->recurring_invoice->remainingCycles();
@ -89,9 +89,9 @@ class SendRecurring implements ShouldQueue
$this->recurring_invoice->setCompleted(); $this->recurring_invoice->setCompleted();
} }
info("next send date = " . $this->recurring_invoice->next_send_date); nlog("next send date = " . $this->recurring_invoice->next_send_date);
info("remaining cycles = " . $this->recurring_invoice->remaining_cycles); nlog("remaining cycles = " . $this->recurring_invoice->remaining_cycles);
info("last send date = " . $this->recurring_invoice->last_sent_date); nlog("last send date = " . $this->recurring_invoice->last_sent_date);
$this->recurring_invoice->save(); $this->recurring_invoice->save();
@ -102,7 +102,7 @@ class SendRecurring implements ShouldQueue
public function failed($exception = null) public function failed($exception = null)
{ {
info('the job failed'); nlog('the job failed');
$job_failure = new SendRecurringFailure(); $job_failure = new SendRecurringFailure();
$job_failure->string_metric5 = get_class($this); $job_failure->string_metric5 = get_class($this);
@ -111,6 +111,6 @@ class SendRecurring implements ShouldQueue
LightLogs::create($job_failure) LightLogs::create($job_failure)
->batch(); ->batch();
info(print_r($exception->getMessage(), 1)); nlog(print_r($exception->getMessage(), 1));
} }
} }

View File

@ -62,7 +62,7 @@ class ReminderJob implements ShouldQueue
$invoice->invitations->each(function ($invitation) use ($invoice, $reminder_template) { $invoice->invitations->each(function ($invitation) use ($invoice, $reminder_template) {
EmailEntity::dispatch($invitation, $invitation->company, $reminder_template); EmailEntity::dispatch($invitation, $invitation->company, $reminder_template);
info("Firing email for invoice {$invoice->number}"); nlog("Firing email for invoice {$invoice->number}");
}); });
if ($invoice->invitations->count() > 0) { if ($invoice->invitations->count() > 0) {

View File

@ -117,6 +117,6 @@ class WebhookHandler implements ShouldQueue
public function failed($exception) public function failed($exception)
{ {
info(print_r($exception->getMessage(), 1)); nlog(print_r($exception->getMessage(), 1));
} }
} }

View File

@ -53,7 +53,7 @@ class InvoicePaidActivity implements ShouldQueue
try { try {
$event->invoice->service()->touchPdf(); $event->invoice->service()->touchPdf();
} catch (\Exception $e) { } catch (\Exception $e) {
info(print_r($e->getMessage(), 1)); nlog(print_r($e->getMessage(), 1));
} }
} }
} }

View File

@ -40,7 +40,7 @@ class PaymentEmailFailureActivity implements ShouldQueue
$payment = $event->payment; $payment = $event->payment;
info("i failed emailing {$payment->number}"); nlog("i failed emailing {$payment->number}");
// info(print_r($event->errors,1)); // nlog(print_r($event->errors,1));
} }
} }

View File

@ -40,6 +40,6 @@ class PaymentEmailedActivity implements ShouldQueue
$payment = $event->payment; $payment = $event->payment;
info("i succeeded in emailing payment {$payment->number}"); nlog("i succeeded in emailing payment {$payment->number}");
} }
} }

View File

@ -49,7 +49,7 @@ class SendVerificationNotification implements ShouldQueue
Ninja::registerNinjaUser($event->user); Ninja::registerNinjaUser($event->user);
} catch (Exception $e) { } catch (Exception $e) {
info("I couldn't send the email " . $e->getMessage()); nlog("I couldn't send the email " . $e->getMessage());
} }
} }
} }

View File

@ -65,12 +65,12 @@ class InvoiceEmailEngine extends BaseEmailEngine
if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) { if (is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0) {
$subject_template = $this->template_data['subject']; $subject_template = $this->template_data['subject'];
info("subject = template data"); nlog("subject = template data");
} elseif (strlen($this->client->getSetting('email_subject_'.$this->reminder_template)) > 0) { } elseif (strlen($this->client->getSetting('email_subject_'.$this->reminder_template)) > 0) {
$subject_template = $this->client->getSetting('email_subject_'.$this->reminder_template); $subject_template = $this->client->getSetting('email_subject_'.$this->reminder_template);
info("subject = settings var"); nlog("subject = settings var");
} else { } else {
info("subject = default template " . 'email_subject_'.$this->reminder_template); nlog("subject = default template " . 'email_subject_'.$this->reminder_template);
$subject_template = EmailTemplateDefaults::getDefaultTemplate('email_subject_'.$this->reminder_template, $this->client->locale()); $subject_template = EmailTemplateDefaults::getDefaultTemplate('email_subject_'.$this->reminder_template, $this->client->locale());
// $subject_template = $this->client->getSetting('email_subject_'.$this->reminder_template); // $subject_template = $this->client->getSetting('email_subject_'.$this->reminder_template);
} }

View File

@ -213,7 +213,7 @@ class AuthorizeCreditCard
private function processFailedResponse($data, $request) private function processFailedResponse($data, $request)
{ {
//dd($data); //dd($data);
// info(print_r($data, 1)); // nlog(print_r($data, 1));
} }
private function formatGatewayResponse($data, $vars) private function formatGatewayResponse($data, $vars)

View File

@ -46,13 +46,13 @@ class AuthorizeTransactions
$response = $controller->executeWithApiResponse($this->authorize->mode()); $response = $controller->executeWithApiResponse($this->authorize->mode());
if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) {
info('SUCCESS: Transaction Status:'.$response->getTransaction()->getTransactionStatus()); nlog('SUCCESS: Transaction Status:'.$response->getTransaction()->getTransactionStatus());
info(' Auth Amount:'.$response->getTransaction()->getAuthAmount()); nlog(' Auth Amount:'.$response->getTransaction()->getAuthAmount());
info(' Trans ID:'.$response->getTransaction()->getTransId()); nlog(' Trans ID:'.$response->getTransaction()->getTransId());
} else { } else {
info("ERROR : Invalid response\n"); nlog("ERROR : Invalid response\n");
$errorMessages = $response->getMessages()->getMessage(); $errorMessages = $response->getMessages()->getMessage();
info('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()); nlog('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText());
} }
return $response; return $response;

View File

@ -59,36 +59,36 @@ class ChargePaymentProfile
$tresponse = $response->getTransactionResponse(); $tresponse = $response->getTransactionResponse();
if ($tresponse != null && $tresponse->getMessages() != null) { if ($tresponse != null && $tresponse->getMessages() != null) {
info(' Transaction Response code : '.$tresponse->getResponseCode()); nlog(' Transaction Response code : '.$tresponse->getResponseCode());
info('Charge Customer Profile APPROVED :'); nlog('Charge Customer Profile APPROVED :');
info(' Charge Customer Profile AUTH CODE : '.$tresponse->getAuthCode()); nlog(' Charge Customer Profile AUTH CODE : '.$tresponse->getAuthCode());
info(' Charge Customer Profile TRANS ID : '.$tresponse->getTransId()); nlog(' Charge Customer Profile TRANS ID : '.$tresponse->getTransId());
info(' Code : '.$tresponse->getMessages()[0]->getCode()); nlog(' Code : '.$tresponse->getMessages()[0]->getCode());
info(' Description : '.$tresponse->getMessages()[0]->getDescription()); nlog(' Description : '.$tresponse->getMessages()[0]->getDescription());
//info(" Charge Customer Profile TRANS STATUS : " . $tresponse->getTransactionStatus() ); //nlog(" Charge Customer Profile TRANS STATUS : " . $tresponse->getTransactionStatus() );
//info(" Charge Customer Profile Amount : " . $tresponse->getAuthAmount()); //nlog(" Charge Customer Profile Amount : " . $tresponse->getAuthAmount());
info(' Code : '.$tresponse->getMessages()[0]->getCode()); nlog(' Code : '.$tresponse->getMessages()[0]->getCode());
info(' Description : '.$tresponse->getMessages()[0]->getDescription()); nlog(' Description : '.$tresponse->getMessages()[0]->getDescription());
info(print_r($tresponse->getMessages()[0], 1)); nlog(print_r($tresponse->getMessages()[0], 1));
} else { } else {
info('Transaction Failed '); nlog('Transaction Failed ');
if ($tresponse->getErrors() != null) { if ($tresponse->getErrors() != null) {
info(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()); nlog(' Error code : '.$tresponse->getErrors()[0]->getErrorCode());
info(' Error message : '.$tresponse->getErrors()[0]->getErrorText()); nlog(' Error message : '.$tresponse->getErrors()[0]->getErrorText());
info(print_r($tresponse->getErrors()[0], 1)); nlog(print_r($tresponse->getErrors()[0], 1));
} }
} }
} else { } else {
info('Transaction Failed '); nlog('Transaction Failed ');
$tresponse = $response->getTransactionResponse(); $tresponse = $response->getTransactionResponse();
if ($tresponse != null && $tresponse->getErrors() != null) { if ($tresponse != null && $tresponse->getErrors() != null) {
info(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()); nlog(' Error code : '.$tresponse->getErrors()[0]->getErrorCode());
info(' Error message : '.$tresponse->getErrors()[0]->getErrorText()); nlog(' Error message : '.$tresponse->getErrors()[0]->getErrorText());
info(print_r($tresponse->getErrors()[0], 1)); nlog(print_r($tresponse->getErrors()[0], 1));
} else { } else {
info(' Error code : '.$response->getMessages()->getMessage()[0]->getCode()); nlog(' Error code : '.$response->getMessages()->getMessage()[0]->getCode());
info(' Error message : '.$response->getMessages()->getMessage()[0]->getText()); nlog(' Error message : '.$response->getMessages()->getMessage()[0]->getText());
} }
} }

View File

@ -168,7 +168,7 @@ class Charge
} }
$payment_method_type = $response->charges->data[0]->payment_method_details->card->brand; $payment_method_type = $response->charges->data[0]->payment_method_details->card->brand;
//info($payment_method_type); //nlog($payment_method_type);
$data = [ $data = [
'gateway_type_id' => $cgt->gateway_type_id, 'gateway_type_id' => $cgt->gateway_type_id,

View File

@ -319,7 +319,7 @@ class StripePaymentDriver extends BaseDriver
} catch (Exception $e) { } catch (Exception $e) {
SystemLogger::dispatch(['server_response' => $response, 'data' => request()->all(),], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_STRIPE, $this->client); SystemLogger::dispatch(['server_response' => $response, 'data' => request()->all(),], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_STRIPE, $this->client);
info($e->getMessage()); nlog($e->getMessage());
return [ return [
'transaction_reference' => null, 'transaction_reference' => null,

View File

@ -150,6 +150,6 @@ class CompanyGatewayResolutionTest extends TestCase
$this->assertEquals(4, count($this->cg->driver($this->client)->gatewayTypes())); $this->assertEquals(4, count($this->cg->driver($this->client)->gatewayTypes()));
// info(print_r($this->client->getPaymentMethods(10),1)); // nlog(print_r($this->client->getPaymentMethods(10),1));
} }
} }

View File

@ -101,10 +101,10 @@ class CompanyGatewayTest extends TestCase
} }
if ((property_exists($fees_and_limits, 'min_limit')) && $fees_and_limits->min_limit !== null && $amount < $fees_and_limits->min_limit) { if ((property_exists($fees_and_limits, 'min_limit')) && $fees_and_limits->min_limit !== null && $amount < $fees_and_limits->min_limit) {
info("amount {$amount} less than ".$fees_and_limits->min_limit); nlog("amount {$amount} less than ".$fees_and_limits->min_limit);
$passes = false; $passes = false;
} elseif ((property_exists($fees_and_limits, 'max_limit')) && $fees_and_limits->max_limit !== null && $amount > $fees_and_limits->max_limit) { } elseif ((property_exists($fees_and_limits, 'max_limit')) && $fees_and_limits->max_limit !== null && $amount > $fees_and_limits->max_limit) {
info("amount {$amount} greater than ".$fees_and_limits->max_limit); nlog("amount {$amount} greater than ".$fees_and_limits->max_limit);
$passes = false; $passes = false;
} else { } else {
$passes = true; $passes = true;

View File

@ -58,8 +58,8 @@ class ExportCsvTest extends TestCase
$merged_values = array_merge($header_invoice_values, (array)$header_item_values); $merged_values = array_merge($header_invoice_values, (array)$header_item_values);
$merged_keys = array_merge($header_invoice_keys, (array)$header_item_keys); $merged_keys = array_merge($header_invoice_keys, (array)$header_item_keys);
info(print_r($merged_keys, 1)); nlog(print_r($merged_keys, 1));
info(print_r($merged_values, 1)); nlog(print_r($merged_values, 1));
foreach ($merged_keys as &$key) { foreach ($merged_keys as &$key) {

View File

@ -184,8 +184,8 @@ class InvoiceTest extends TestCase
->assertStatus(302); ->assertStatus(302);
} catch (ValidationException $e) { } catch (ValidationException $e) {
$message = json_decode($e->validator->getMessageBag(), 1); $message = json_decode($e->validator->getMessageBag(), 1);
info('inside update invoice validator'); nlog('inside update invoice validator');
info($message); nlog($message);
$this->assertNotNull($message); $this->assertNotNull($message);
} }

View File

@ -190,12 +190,12 @@ class LoginTest extends TestCase
])->post('/api/v1/login', $data); ])->post('/api/v1/login', $data);
} catch (ValidationException $e) { } catch (ValidationException $e) {
$message = json_decode($e->validator->getMessageBag(), 1); $message = json_decode($e->validator->getMessageBag(), 1);
info(print_r($message, 1)); nlog(print_r($message, 1));
} }
$arr = $response->json(); $arr = $response->json();
info(print_r($arr, 1)); nlog(print_r($arr, 1));
$response->assertStatus(200); $response->assertStatus(200);
} }

View File

@ -1289,7 +1289,7 @@ class PaymentTest extends TestCase
$payment = Payment::find($this->decodePrimaryKey($payment_id))->first(); $payment = Payment::find($this->decodePrimaryKey($payment_id))->first();
// info($payment); // nlog($payment);
$this->assertNotNull($payment); $this->assertNotNull($payment);
$this->assertNotNull($payment->invoices()); $this->assertNotNull($payment->invoices());

View File

@ -58,7 +58,7 @@ class ExampleIntegrationTest extends TestCase
// exec('echo "" > storage/logs/laravel.log'); // exec('echo "" > storage/logs/laravel.log');
// info($maker->getCompiledHTML(true)); // nlog($maker->getCompiledHTML(true));
$this->assertTrue(true); $this->assertTrue(true);
} }

View File

@ -370,7 +370,7 @@ class PdfMakerTest extends TestCase
// exec('echo "" > storage/logs/laravel.log'); // exec('echo "" > storage/logs/laravel.log');
// info($maker->getCompiledHTML(true)); // nlog($maker->getCompiledHTML(true));
$this->assertTrue(true); $this->assertTrue(true);
} }

View File

@ -222,7 +222,7 @@ class CompanyLedgerTest extends TestCase
'X-API-TOKEN' => $this->token, 'X-API-TOKEN' => $this->token,
])->post('/api/v1/payments/', $data); ])->post('/api/v1/payments/', $data);
} catch (ValidationException $e) { } catch (ValidationException $e) {
info(print_r($e->validator->getMessageBag(), 1)); nlog(print_r($e->validator->getMessageBag(), 1));
} }
$acc = $response->json(); $acc = $response->json();
@ -231,7 +231,7 @@ class CompanyLedgerTest extends TestCase
$payment_ledger = $payment->company_ledger->sortByDesc('id')->first(); $payment_ledger = $payment->company_ledger->sortByDesc('id')->first();
//info($payment->client->balance); //nlog($payment->client->balance);
$this->assertEquals($payment->client->balance, $payment_ledger->balance); $this->assertEquals($payment->client->balance, $payment_ledger->balance);
$this->assertEquals($payment->client->paid_to_date, 10); $this->assertEquals($payment->client->paid_to_date, 10);

View File

@ -100,12 +100,12 @@ class AuthorizeTest extends TestCase
$controller = new GetCustomerProfileIdsController($request); $controller = new GetCustomerProfileIdsController($request);
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) {
// info("GetCustomerProfileId's SUCCESS: "."\n"); // nlog("GetCustomerProfileId's SUCCESS: "."\n");
// info(print_r($response->getIds(), 1)); // nlog(print_r($response->getIds(), 1));
} else { } else {
// info("GetCustomerProfileId's ERROR : Invalid response\n"); // nlog("GetCustomerProfileId's ERROR : Invalid response\n");
$errorMessages = $response->getMessages()->getMessage(); $errorMessages = $response->getMessages()->getMessage();
// info('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n"); // nlog('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n");
} }
$this->assertNotNull($response); $this->assertNotNull($response);
@ -171,16 +171,16 @@ class AuthorizeTest extends TestCase
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) {
info('Succesfully created customer profile : '.$response->getCustomerProfileId()."\n"); nlog('Succesfully created customer profile : '.$response->getCustomerProfileId()."\n");
$paymentProfiles = $response->getCustomerPaymentProfileIdList(); $paymentProfiles = $response->getCustomerPaymentProfileIdList();
// info(print_r($paymentProfiles, 1)); // nlog(print_r($paymentProfiles, 1));
} else { } else {
info("ERROR : Invalid response\n"); nlog("ERROR : Invalid response\n");
$errorMessages = $response->getMessages()->getMessage(); $errorMessages = $response->getMessages()->getMessage();
// info('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n"); // nlog('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n");
} }
// info('the new customer profile id = '.$response->getCustomerProfileId()); // nlog('the new customer profile id = '.$response->getCustomerProfileId());
$this->assertNotNull($response); $this->assertNotNull($response);
} }
@ -202,10 +202,10 @@ class AuthorizeTest extends TestCase
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) {
// info('got profile'); // nlog('got profile');
// info(print_r($response->getProfile(), 1)); // nlog(print_r($response->getProfile(), 1));
} else { } else {
info("ERROR : Invalid response\n"); nlog("ERROR : Invalid response\n");
} }
$this->assertNotNull($response); $this->assertNotNull($response);
@ -213,7 +213,7 @@ class AuthorizeTest extends TestCase
public function testCreateCustomerPaymentProfile() public function testCreateCustomerPaymentProfile()
{ {
info('test create customer payment profile'); nlog('test create customer payment profile');
error_reporting(E_ALL & ~E_DEPRECATED); error_reporting(E_ALL & ~E_DEPRECATED);
@ -270,11 +270,11 @@ class AuthorizeTest extends TestCase
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) { if (($response != null) && ($response->getMessages()->getResultCode() == 'Ok')) {
// info('Create Customer Payment Profile SUCCESS: '.$response->getCustomerPaymentProfileId()."\n"); // nlog('Create Customer Payment Profile SUCCESS: '.$response->getCustomerPaymentProfileId()."\n");
} else { } else {
// info("Create Customer Payment Profile: ERROR Invalid response\n"); // nlog("Create Customer Payment Profile: ERROR Invalid response\n");
$errorMessages = $response->getMessages()->getMessage(); $errorMessages = $response->getMessages()->getMessage();
// info('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n"); // nlog('Response : '.$errorMessages[0]->getCode().' '.$errorMessages[0]->getText()."\n");
} }
$this->assertNotNull($response); $this->assertNotNull($response);
@ -316,32 +316,32 @@ class AuthorizeTest extends TestCase
$tresponse = $response->getTransactionResponse(); $tresponse = $response->getTransactionResponse();
if ($tresponse != null && $tresponse->getMessages() != null) { if ($tresponse != null && $tresponse->getMessages() != null) {
info(' Transaction Response code : '.$tresponse->getResponseCode()."\n"); nlog(' Transaction Response code : '.$tresponse->getResponseCode()."\n");
info('Charge Customer Profile APPROVED :'."\n"); nlog('Charge Customer Profile APPROVED :'."\n");
info(' Charge Customer Profile AUTH CODE : '.$tresponse->getAuthCode()."\n"); nlog(' Charge Customer Profile AUTH CODE : '.$tresponse->getAuthCode()."\n");
info(' Charge Customer Profile TRANS ID : '.$tresponse->getTransId()."\n"); nlog(' Charge Customer Profile TRANS ID : '.$tresponse->getTransId()."\n");
info(' Code : '.$tresponse->getMessages()[0]->getCode()."\n"); nlog(' Code : '.$tresponse->getMessages()[0]->getCode()."\n");
info(' Description : '.$tresponse->getMessages()[0]->getDescription()."\n"); nlog(' Description : '.$tresponse->getMessages()[0]->getDescription()."\n");
} else { } else {
info("Transaction Failed \n"); nlog("Transaction Failed \n");
if ($tresponse->getErrors() != null) { if ($tresponse->getErrors() != null) {
info(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()."\n"); nlog(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()."\n");
info(' Error message : '.$tresponse->getErrors()[0]->getErrorText()."\n"); nlog(' Error message : '.$tresponse->getErrors()[0]->getErrorText()."\n");
} }
} }
} else { } else {
info("Transaction Failed \n"); nlog("Transaction Failed \n");
$tresponse = $response->getTransactionResponse(); $tresponse = $response->getTransactionResponse();
if ($tresponse != null && $tresponse->getErrors() != null) { if ($tresponse != null && $tresponse->getErrors() != null) {
info(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()."\n"); nlog(' Error code : '.$tresponse->getErrors()[0]->getErrorCode()."\n");
info(' Error message : '.$tresponse->getErrors()[0]->getErrorText()."\n"); nlog(' Error message : '.$tresponse->getErrors()[0]->getErrorText()."\n");
} else { } else {
info(' Error code : '.$response->getMessages()->getMessage()[0]->getCode()."\n"); nlog(' Error code : '.$response->getMessages()->getMessage()[0]->getCode()."\n");
info(' Error message : '.$response->getMessages()->getMessage()[0]->getText()."\n"); nlog(' Error message : '.$response->getMessages()->getMessage()[0]->getText()."\n");
} }
} }
} else { } else {
info("No response returned \n"); nlog("No response returned \n");
} }
$this->assertNotNull($response); $this->assertNotNull($response);