# sync-basalam/1.10.5/includes/Services/Ticket/FetchAllTickets.php

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

- Page: https://pluginprobe.com/plugins/sync-basalam/1.10.5/code/includes/Services/Ticket/FetchAllTickets.php
- Raw: https://pluginprobe.com/plugins/sync-basalam/1.10.5/raw/includes/Services/Ticket/FetchAllTickets.php
- Modified: 2026-08-05T14:13:10+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.10.5/code/includes/Services/Ticket/FetchAllTickets.php#L10-L20`.

```php
<?php

namespace SyncBasalam\Services\Ticket;

use SyncBasalam\Config\Endpoints;
use SyncBasalam\Services\ApiServiceManager;

class FetchAllTickets
{
    private $url;

    public function __construct()
    {
        $this->url  = Endpoints::TICKET_LIST;
    }
    public function execute($hamsalamToken, $page = 1)
    {
        $apiService = syncBasalamContainer()->get(ApiServiceManager::class);
        $url = $this->url . "?page=$page";
        $header = ['Authorization' => 'Bearer ' . $hamsalamToken];

        try {
            return $apiService->get($url, $header);
        } catch (\Exception $e) {
            return [
                'status_code' => $e->getCode() ?? 500,
                'body' => null,
                'error' => 'خطا در دریافت لیست تیکت‌ها: ' . $e->getMessage(),
            ];
        }
    }
}

```
