Skip to content

hackerspace-team/iiko-transport

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IIKO Transport API Library

Requirements:

  • php >=8.1
  • Laravel 8+

Installation

  • add to repositories section of your composer.json
{
    "type": "vcs",
    "url": "https://github.com/KoTRpa/iiko-transport"
}
  • install via php composer install kma/iiko-transport
  • add to .env
IIKO_LOGIN=your_apiLogin
  • optional add to .env url to iiko api (default is https://api-ru.iiko.services/api/1/)
IIKO_URL="url_to_iiko_api"

Using

In Laravel, you can use Service Provider

use IikoTransport;
...
public function myFunction()
{
    IikoTransport::nomenclature();
}

or dependency injection

public function myFunction(IikoTransport $iiko)
{
    $iiko->nomenclature();
}

Available API methods

Iiko Transport API documentation lives here

All methods require a Request entity as param and returns Response entity

All entities can be created by different ways:

  • directly with new and after assign attributes
$entity = new EntityName;
$entity->id = 'id';
  • you can path to constructor a prepared array
$data = [
    'id' => 'id'
];

$entity = new EntityName($data);
  • or using static calls (recommended)
$entity = EntityName::fromArray($data);
$entity = EntityName::fromJson($jsonString);

Also, all entities has some convert methods to json or array

$entity->toArray();
$entity->toJson();
Organizations

Available request options

use KMA\IikoTransport\Endpoints\General\Organizations\OrganizationsRequest;
use KMA\IikoTransport\Endpoints\General\Organizations\OrganizationsResponse;
...
$response = IikoTransport::organizations(new OrganizationsRequest);
Menu / nomenclature

Available request options

use KMA\IikoTransport\Endpoints\General\Menu\NomenclatureRequest;
use KMA\IikoTransport\Endpoints\General\Menu\NomenclatureResponse;
...
$response = IikoTransport::nomenclature(new NomenclatureRequest);
Terminal Groups

Available request options

use KMA\IikoTransport\Endpoints\General\TerminalGroups\TerminalGroupsRequest;
use KMA\IikoTransport\Endpoints\General\TerminalGroups\TerminalGroupsResponse;
...
$response = IikoTransport::terminalGroups(new TerminalGroupsRequest);

continue...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%