This commit is contained in:
nurmuhammet committed 2026-03-12 02:28:50 +05:00
1 parent 2bd2c45ddb
commit 03c692adbb
4 files changed
+80 -15

No files matched your search

+19 -13
View File
@@ -8,6 +8,7 @@
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class SendSberToSystem implements ShouldQueue
@@ -34,23 +35,28 @@ public function __construct()
*/
public function handle(): void
{
$orderItem = SberPaymentOrderItem::query()
$ignore = DB::table('ignore_sber_payments')->pluck('payment_id');
$orderItems = SberPaymentOrderItem::query()
->where('paid', true)
->where('synced_with_system', false)
->whereDate('created_at', '>', '2025-09-05')
->first();
->whereIntegerNotInRaw('id', $ignore)
->limit(2)
->get()
->each(function ($orderItem) {
if (! $orderItem) {
return;
}
if (! $orderItem) {
return;
}
$result = syncSberWithAzatAPI($orderItem);
$result = syncSberWithAzatAPI($orderItem);
if (isset($result['error'])) {
Log::channel('sber_job')->error(json_encode([
'error' => $result['error'],
'orderItem' => $orderItem,
]));
}
if (isset($result['error'])) {
Log::channel('sber_job')->error(json_encode([
'error' => $result['error'],
'orderItem' => $orderItem,
]));
}
});
}
}