service = $service; } public function render(): void { $this->enqueueAssets(); $this->renderMessage(); $userProfile = $this->service->getUserProfile(); if ( ! $userProfile ) { $this->renderUserNotConfigured(); return; } $response = $this->service->getBilling(); if ( ! $response->isSuccess() ) { $this->renderError( ContaiNoticeHelper::buildErrorNotice( 'Load billing', $response, __( 'Failed to load billing information.', '1platform-content-ai' ) ) ); return; } $data = $response->getData(); $subscriptionId = $data['subscription']['id'] ?? '—'; $balance = $data['billing']['balance'] ?? 0; $currency = $data['billing']['currency'] ?? 'USD'; $this->renderBalanceCard( (float) $balance, $currency ); $this->renderDetailsPanel( (string) $subscriptionId, $currency ); $this->renderTopUpModal( $currency ); } private function renderBalanceCard( float $balance, string $currency ): void { $history_url = admin_url( 'admin.php?page=contai-billing§ion=billing-history' ); ?>

[: ]

array( 'href' => array(), 'class' => array() ) ) ); ?>