nikba/bus-system-php-sdk

v1.0.2 2022-12-08 01:47 UTC

This package is auto-updated.

Last update: 2024-09-13 10:00:20 UTC


README

BusSystem is bus transport control system

Installation

Install nikba/bus-system-php-sdk with php composer

  composer require nikba/bus-system-php-sdk

Usage/Examples

$bussystem = new \Nikba\BusSystemPhpSdk\BusSystem(
    'BASE URL', 
    'LOGIN', 
    'PASSWORD', 
    'en'
);

# Get All Countries
$params = ['viev' => 'get_country'];
$points = $bussystem->getPoints($params);

Web-service function:

  • get_points — selection of available cities, countries, as well as dynamically linked ones (united with the outdated function get_country, an optional function)

  • get_routes — Information about ALL available routes within selected interval of cities as on the specified date

  • get_plan — Plan places in the bus (ALL ROUTES, an optional function)

  • get_free_seats — Search number seats (bus and train) and search wagons for train. (Required for train)

  • get_discount — List of discounts for route (optional function)

  • get_all_routes — Timetable of route (optional function)

  • new_order — Creating a new order for the period depending on the terms of lock_min (generally 10 minutes). Upon the expiry of lock_min, the order will be automatically cancelled. Some routes allow blocking the seats for the indicated time. Moreover, some routes may be paid for even upon the expiry of lock_min, but this does not guarantee a successful sale and the specified seat (might be changed).

  • buy_ticket — Sale of tickets based on the generated order (item 3. new_order)

  • cancel_ticket — Order cancellation and ticket refund (united with the outdated function cancel_order)

  • get_ticket — Getting full information about a ticket (an optional function)

  • get_orer — Getting full information about a order

  • print_ticket — Getting an e-ticket form (confirmation for the carrier can be of different designs, depending on the selected route). The passenger must show this very form on the bus, and not a receipt from the terminal, bank, etc, otherwise the passenger may be denied a trip.

  • get_orders — Order list (if applicable payment)

  • get_tickets — List of tickets (if applicable payment)

  • get_tickets (dispatcher) — List of tickets for carriers and dispatchers

  • get_cash — Cash (if applicable payment)

In all the above requests, it is recommended to send the tag session=xxxx (user session) - this is how you can get routes where this tag is required.

API Reference

All data shall be transmitted via HTTP (HTTPS for real system) using POST method. In response to the query data returns as XML.

Address for test queries: https://test-api.bussystem.eu/server

Address for prod. queries: https://api.bussystem.eu/server

get_points

  POST /server/curl/get_points.php

get_routes

  POST /server/curl/get_routes.php

get_plan

  POST /server/curl/get_plan.php

get_free_seats

  POST /server/curl/get_free_seats.php

get_discount

  POST /server/curl/get_discount.php

get_all_routes

  POST /server/curl/get_all_routes.php

new_order

  POST /server/curl/new_order.php

buy_ticket

  POST /server/curl/buy_ticket.php

reg_ticket

  POST /server/curl/reg_ticket.php

cancel_ticket

  POST /server/curl/cancel_ticket.php

get_ticket

  POST /server/curl/get_ticket.php

get_order

  POST /server/curl/get_order.php

get_orders

  POST /server/curl/get_orders.php

get_orders (partners)

  POST /server/curl_partner/get_orders.php

get_tickets

  POST /server/curl_partner/get_tickets.php

get_tickets (dispatcher)

  POST /server/curl_dispatcher/get_tickets.php

get_cash

  POST /server/curl/get_cash.php

Documentation

Documentation

Support

For support, GitHub Issues