Download app/Console/Commands/CheckYookassaCommand.php from pnacorp/magicai: direct link, hf CLI and curl.
- Browser
- Download file 802 Bytes
-
https://huggingface.co/pnacorp/magicai/resolve/main/app/Console/Commands/CheckYookassaCommand.php
- Command line
-
hf download hf://pnacorp/magicai/app/Console/Commands/CheckYookassaCommand.php
-
curl -L -o CheckYookassaCommand.php https://huggingface.co/pnacorp/magicai/resolve/main/app/Console/Commands/CheckYookassaCommand.php
802 Bytes
| namespace App\Console\Commands; | |
| use App\Models\YokassaSubscriptions; | |
| use App\Services\GatewaySelector; | |
| use Illuminate\Console\Command; | |
| class CheckYookassaCommand extends Command | |
| { | |
| protected $signature = 'app:check-yookassa-command'; | |
| protected $description = 'Command description'; | |
| public function handle(): void | |
| { | |
| $items = YokassaSubscriptions::query() | |
| ->where('subscription_status', 'active') | |
| ->orWhere('subscription_status', 'yokassa_approved') | |
| ->get(); | |
| foreach ($items as $activeSub) { | |
| $data_end_sub = $activeSub->next_pay_at; | |
| if (now()->gt($data_end_sub)) { | |
| $result = GatewaySelector::selectGateway('yokassa')::handleSubscribePay($activeSub->id); | |
| } | |
| } | |
| } | |
| } | |