table( ['key', 'value'], [ ['enabled', $client->enabled() ? 'yes' : 'no'], ['sms_base_url', $base !== '' ? $base : '(empty)'], ['sms_domain_override', $domain !== '' ? $domain : '(empty → APP_URL host)'], ['app_url', $appUrl !== '' ? $appUrl : '(empty)'], ['shared_secret_set', $secretSet ? 'yes' : 'no'], ['remote_token_set', $tokenSet ? 'yes' : 'no'], ] ); if (!$client->enabled()) { $this->error('SuperAdmin SMS remote is disabled. Set SUPERADMIN_SMS_BASE_URL and secret/token.'); return self::FAILURE; } $balance = $client->balance(); if ($balance === null) { $this->error('balance request failed (auth/domain/network). Check SUPERADMIN_SMS_DOMAIN vs SuperAdmin tenant.'); return self::FAILURE; } $this->info('SuperAdmin SMS remote OK'); $this->line(json_encode([ 'balance' => $balance['balance'] ?? $balance['balanceRials'] ?? null, 'price_per_part' => $balance['price_per_part'] ?? $balance['pricePerPartRials'] ?? null, 'is_blocked' => $balance['is_blocked'] ?? $balance['isBlocked'] ?? null, 'source' => $balance['source'] ?? null, 'raw_keys' => array_keys($balance), ], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); return self::SUCCESS; } }