mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-30 01:44:05 +00:00
45 lines
1.8 KiB
PHP
45 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Jobs\Commands\V2;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzDataPatchProcessor;
|
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
|
use App\Models\Transaction;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class OneTimeTransactionFixBillplzFailedCbV2CommandJob implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public function handle()
|
|
{
|
|
Log::info(Carbon::now() . ': Start job - One time fix failled callback from billplz for transaction with id 17310 cron ended.');
|
|
$start = new Carbon();
|
|
|
|
// ini_set('memory_limit', '-1');
|
|
|
|
//Transaction fix with this one time fix command: 15205, 16803, 17310
|
|
//This transaction, 16803 has approve payment but not its owner, shipping invoice
|
|
$transaction = Transaction::whereIn('id', [17310])->first();
|
|
Log::info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 17310 cron started.');
|
|
|
|
if($transaction && $transaction->id == 17310){
|
|
|
|
Log::info(Carbon::now() . ' : 17310.');
|
|
$status = ApprovalStatus::APPROVED;
|
|
// $this->callbackBillplzProcessor->execute($transaction, $status);
|
|
(App()->make(CallbackBillplzDataPatchProcessor::class))->execute($transaction, $status);
|
|
}
|
|
|
|
$end = new Carbon();
|
|
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
|
Log::info(Carbon::now() . ': End job - One time fix failled callback from billplz for transaction with id 17310 cron ended. ElapsedTime: ' . $elapsedTime . '.');
|
|
}
|
|
}
|