Compare commits

...

5 Commits

Author SHA1 Message Date
Dillon 4b0b88b5d8 Reduce flooding of logs from Perfex CRM 2023-04-15 21:46:26 +08:00
edmondlang 1960cff426 create a cron job to fix all billplz failed callback for all the success payments. 2023-04-14 11:39:24 +08:00
edmondlang 0402fc67e2 update package loading animation 2023-04-13 22:57:46 +08:00
edmondlang 4089683ab7 remove all css comments 2023-04-13 22:53:12 +08:00
edmondlang 3fdd2a2b56 update package loading animation 2023-04-13 22:46:41 +08:00
8 changed files with 83 additions and 42 deletions
+19 -2
View File
@@ -2,8 +2,8 @@
namespace App\Classes\General;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Log;
class Helper
{
@@ -24,4 +24,21 @@ class Helper
return array_slice(get_class_methods($className), 1);
}
}
/**
* @param $log
* @return none
*/
static function debugLoggerForPerfexCRM($log){
if($log){
$message = $log['message'];
$substring = 'No data were found';
if (isset($message)) {
if (strpos($message, $substring) !== false) {
// Log::info('Message exist');
} else {
Log::info($log['message']);
}
}
}
}
}
+7 -2
View File
@@ -19,7 +19,7 @@ use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use App\Classes\General\Helper;
class UpdatePerfexCRMInvoice implements ShouldQueue
{
@@ -51,7 +51,12 @@ class UpdatePerfexCRMInvoice implements ShouldQueue
if(is_null($invoice)){
$result = (App()->make(CreatePerfexCRMInvoiceProcessor::class))->execute($transaction->owner, $this->updatePerfexCRMInvoiceObject->getIsPaid());
$invoiceId = $result->payload['id'];
if ($result) {
$invoiceId = $result->payload['id'];
} else {
// Log::error(json_encode('UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed'));
Helper::debugLoggerForPerfexCRM('UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed');
}
}
else{
$invoiceId = $invoice->id;
@@ -5,6 +5,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
use Illuminate\Support\Facades\Http;
use App\Classes\Exceptions\MalformedRequestException;
use Illuminate\Support\Facades\Log;
use App\Classes\General\Helper;
class FetchesPerfexCRMTask
{
@@ -38,7 +39,7 @@ class FetchesPerfexCRMTask
return (object) $data;
}else{
Log::error($response);
Helper::debugLoggerForPerfexCRM($response);
return null;
}
}catch(\Exception $exception){
@@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Http;
use App\Classes\Exceptions\MalformedRequestException;
use Illuminate\Support\Facades\Log;
use App\Classes\ValueObjects\Constants\PerfexCRMCustomFields;
use App\Classes\General\Helper;
class UpdatesPerfexCRMCustomer
{
@@ -37,7 +38,7 @@ class UpdatesPerfexCRMCustomer
$data = $response->json();
return (object) $data;
}else{
Log::error($response);
Helper::debugLoggerForPerfexCRM($response);
return null;
}
}catch(\Exception $exception){
@@ -32,7 +32,7 @@ class FixBillplzFailedCallbackPayment extends Command
*
* @var string
*/
protected $description = 'Check all failled callback from billplz';
protected $description = 'Fix all failled callback from billplz';
protected $output = null;
@@ -77,7 +77,7 @@ class FixBillplzFailedCallbackPayment extends Command
{
ini_set('memory_limit', '-1');
$this->info(Carbon::now() . ' : Billplz Failled Callback cron started.');
$this->info(Carbon::now() . ' : Fix failled callback from billplz cron started.');
$this->outputArray = [];
$start = new Carbon();
+5
View File
@@ -47,6 +47,11 @@ class Kernel extends ConsoleKernel
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/auto_generate_invoice.log');
$schedule->command('billplz-failed-callback:fix')
->dailyAt('00:00')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/dix_failed_callback_from_billplz.log');
}
/**
@@ -1,16 +1,55 @@
<template>
<div class="row align-items-center justify-content-center w-100">
<div class="row" style="margin-top: 100px; margin-bottom: 100px;">
<div class="col">
<div class='tetrominos'>
<div class='tetromino box1'></div>
<div class='tetromino box2'></div>
<div class='tetromino box3'></div>
<div class='tetromino box4'></div>
<div class="row align-items-center justify-content-center w-100" style="height: 200px; top: 0;">
<div class="col">
<div class='tetrominos'>
<div class='tetromino box1'></div>
<div class='tetromino box2'></div>
<div class='tetromino box3'></div>
<div class='tetromino box4'></div>
</div>
</div>
</div>
<div class="row align-items-center justify-content-center">
<div class="col">
<p class="text-center fs-15 muted all-caps font-lato" style="letter-spacing: 2px">
Loading Packages Data
<span class="loading-text"></span>
</p>
</div>
</div>
</div>
</div>
</template>
<style>
.loading-text::after {
content: ".";
animation: loading 2s infinite;
}
@keyframes loading {
0% {
content: ". ";
}
25% {
content: ". . ";
}
50% {
content: ". . . ";
}
75% {
content: ". . . . ";
}
100% {
content: ". . . . . ";
}
}
.tetrominos {
position: absolute;
top: 50%;
@@ -45,31 +84,23 @@
@keyframes tetromino1 {
/* compose logo */
/* 1 on 3 */
/* L-shape */
0%,
40% {
transform: translate(0, 0);
}
50% {
/* pre-box */
transform: translate(48px, -27px);
}
60%,
100% {
/* box */
/* compose logo */
transform: translate(96px, 0);
}
}
@keyframes tetromino2 {
/* compose logo */
/* 1 on 3 */
0%,
20% {
transform: translate(96px, 0px);
@@ -77,41 +108,29 @@
40%,
100% {
/* L-shape */
/* box */
/* compose logo */
transform: translate(144px, 27px);
}
}
@keyframes tetromino3 {
/* compose logo */
0% {
transform: translate(144px, 27px);
}
20%,
60% {
/* 1 on 3 */
/* L-shape */
/* box */
transform: translate(96px, 54px);
}
90%,
100% {
/* compose logo */
transform: translate(48px, 27px);
}
}
@keyframes tetromino4 {
/* compose logo */
/* 1 on 3 */
/* L-shape */
/* box */
0%,
60% {
transform: translate(48px, 27px);
@@ -119,7 +138,6 @@
90%,
100% {
/* compose logo */
transform: translate(0, 0);
}
}
@@ -1,13 +1,7 @@
<template>
<div class="row">
<div class="col">
<!-- <loading-component style="height: 200px; top: 0;" v-if="isLoading"></loading-component> -->
<box-loading-component style="height: 200px; top: 0; margin-top: 50px;" v-if="isLoading"></box-loading-component>
<div class="row align-items-center justify-content-center" v-if="isLoading">
<div class="col">
<p class="text-center fs-15 muted all-caps font-lato" style="letter-spacing: 2px">Loading Packages Data</p>
</div>
</div>
<box-loading-component v-if="isLoading"></box-loading-component>
<div class="row" v-if="!dataLoaded">
<div class="col">
<div v-if="!isLoading" class="btn btn-sm btn-block p-t-10 p-b-10 p-r-35 p-l-35 btn-primary b-rad-none p-r-30" @click="fetchCompany">Click here to load Package Data</div>