Files
dpl/app/Console/Commands/PaymentHealthCheck.php

17 lines
623 B
PHP

<?php
namespace App\Console\Commands;
use App\Services\PaymentHealth\Monitor;
use Illuminate\Console\Command;
class PaymentHealthCheck extends Command
{
protected $signature='payment:health-check';
protected $description='Probe configured EPay cashiers once per six-hour slot and manage only monitor-owned outages';
public function handle(Monitor $monitor): int
{
try{$this->line(json_encode($monitor->run(),JSON_UNESCAPED_UNICODE|JSON_THROW_ON_ERROR));return self::SUCCESS;}
catch(\Throwable $e){$this->error('payment_health_failed_closed: '.get_class($e));return self::FAILURE;}
}
}