# sync-basalam/1.10.7/includes/Services/Ticket/CreateTicket.php

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

- Page: https://pluginprobe.com/plugins/sync-basalam/1.10.7/code/includes/Services/Ticket/CreateTicket.php
- Raw: https://pluginprobe.com/plugins/sync-basalam/1.10.7/raw/includes/Services/Ticket/CreateTicket.php
- Modified: 2026-08-11T19:30:02+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.7/code/includes/Services/Ticket/CreateTicket.php#L10-L20`.

```php
<?php

namespace SyncBasalam\Services\Ticket;

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

class CreateTicket
{
    private $url;

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

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

```
