Surokkha IT — Support Ticket Integration
=========================================

Open support tickets with us right from your own admin panel, read our
replies and answer them — no need to log in to our website.

Full guide: {{SUPPORT_DOCS_URL}}

FILES
-----
  SurokkhaSupport.php   PHP SDK (one class, needs the curl extension)
  support-desk.php      Ready-made support page (list / new ticket / conversation)

QUICK START (any PHP script)
----------------------------
1. Upload this folder into your project, e.g.  /admin/support/
2. Open support-desk.php and set:
     SUPPORT_LICENSE_KEY    = the license key we gave you for this domain
     SUPPORT_DESK_AUTH_FILE = your admin login check file   (recommended)
       or SUPPORT_DESK_PASSWORD = a password for this page
3. Add a menu link in your admin panel to  /admin/support/support-desk.php

LARAVEL
-------
  require_once base_path('support/SurokkhaSupport.php');

  $support = new SurokkhaSupport(config('services.surokkha.license_key'));
  $tickets = $support->tickets();
  $ticket  = $support->create($request->subject, $request->message, 'medium', auth()->user()->name, auth()->user()->email);
  $thread  = $support->ticket($id);          // ['ticket' => ..., 'messages' => [...]]
  $support->reply($id, $request->message, auth()->user()->name);

  Wrap calls in try { ... } catch (SurokkhaSupportException $e) { ... }

NOTES
-----
* The license key must belong to the domain the script runs on. Tickets from
  other domains are flagged to our support team.
* Each site only sees the tickets it opened itself.
* API base: {{SUPPORT_API_BASE}}
