This commit is contained in:
2025-09-10 18:48:09 +05:00
parent ef7c30a235
commit 50996ddacd
8 changed files with 203 additions and 23 deletions

View File

@@ -0,0 +1,49 @@
<?php
namespace App\Jobs;
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
class SendVisaToSystem implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*/
public function __construct()
{
//
}
/**
* Execute the job.
*/
public function handle(): void
{
$orderItem = VisaMasterPaymentOrderItem::query()
->where('paid', true)
->where('synced_with_system', false)
->whereDate('created_at', '>', '2025-09-05')
->first();
if (! $orderItem) {
return;
}
$result = syncVisaWithAzatAPI($orderItem);
if (isset($result['error'])) {
Log::channel('visa_job')->error(json_encode([
'error' => $result['error'],
'orderItem' => $orderItem,
]));
}
}
}