# sync-basalam/1.8.8/includes/Services/VendorInfoService.php

ووسلام – همگام سازی ووکامرس و باسلام, version 1.8.8. 51 lines.

- Page: https://pluginprobe.com/plugins/sync-basalam/1.8.8/code/includes/Services/VendorInfoService.php
- Raw: https://pluginprobe.com/plugins/sync-basalam/1.8.8/raw/includes/Services/VendorInfoService.php
- Modified: 2026-05-18T12:06:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sync-basalam/1.8.8/code/includes/Services/VendorInfoService.php#L10-L20`.

```php
<?php

namespace SyncBasalam\Services;

use SyncBasalam\Admin\Settings\SettingsConfig;
use SyncBasalam\Admin\Settings;
use SyncBasalam\Config\Endpoints;
use SyncBasalam\Logger\Logger;

defined('ABSPATH') || exit;

class VendorInfoService
{
    private $apiService;
    private $basalamToken;
    private $basalamVendorId;

    public function __construct()
    {
        $this->apiService = syncBasalamContainer()->get(ApiServiceManager::class);
        $this->basalamToken = Settings::getSettings(SettingsConfig::TOKEN);
        $this->basalamVendorId = Settings::getSettings(SettingsConfig::VENDOR_ID);
    }

    public function FetchVendorInfo()
    {
        if (!$this->basalamToken || !$this->basalamVendorId) {
            return null;
        }

        try {
            $apiUrl = sprintf(Endpoints::VENDOR_INFO, $this->basalamVendorId);
            $FetchVendorInfo = $this->apiService->get($apiUrl, ['Authorization' => 'Bearer ' . $this->basalamToken]);

            if (!is_array($FetchVendorInfo) || !isset($FetchVendorInfo['body'])) {
                return null;
            }

            $vendorInfo = json_decode($FetchVendorInfo['body'], true);
            if (!is_array($vendorInfo)) {
                return null;
            }

            return $vendorInfo;
        } catch (\Exception $e) {
            Logger::error('خطا در دریافت اطلاعات فروشنده: ' . $e->getMessage());
            return null;
        }
    }
}

```
