PHPackages                             thomaswiener/client-amsbus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thomaswiener/client-amsbus

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thomaswiener/client-amsbus
==========================

amsbus booking client

06PHP

Since Nov 21Pushed 11y ago1 watchersCompare

[ Source](https://github.com/thomaswiener/client-amsbus)[ Packagist](https://packagist.org/packages/thomaswiener/client-amsbus)[ RSS](/packages/thomaswiener-client-amsbus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

AmsBus Client [![Build Status](https://camo.githubusercontent.com/24187fd5d189065a7750ce8496395501c69296b3acdb97b8c71a320119abcb2c/68747470733a2f2f7472617669732d63692e6f72672f74686f6d61737769656e65722f636c69656e742d616d736275732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thomaswiener/client-amsbus)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#amsbus-client-)

### General

[](#general)

#### About

[](#about)

This package is a php client implementation for the AmsBus (RO) Webservice (SOAP). It is based on the webservice description found here: INSERT DOC HERE

Below you will find example calls for the different endpoints.

#### Installation

[](#installation)

Install via composer.

Add **"thomaswiener/client-amsbus": "dev-master"** to your composer.json and update vendors.

#### Source

[](#source)

ProviderUrlPackagistGithub### Setup

[](#setup)

```
$loader = require_once __DIR__ . "/./vendor/autoload.php";

$config = array(
    'url'                   => 'https://eshopcv.amsbus.cz:8443/',
    'id'                    => 'xxxxxxxxxxxxx',
    'version'               => 'v1',
    'sslVerifcationEnabled' => false
);

$client            = new \AmsBusClient\Client($config);
$stationService    = new \AmsBusClient\Endpoint\Station($client);
$connectionService = new \AmsBusClient\Endpoint\Connection($client);
$seatService       = new \AmsBusClient\Endpoint\Seat($client);
$ticketService     = new \AmsBusClient\Endpoint\Ticket($client);

originCode       = 'Praha [*CZ]';
$destinationCode = 'Brno [*CZ]';
$pax             = ['John Doe', 'Jane Doe'];
$tripDate        = (new \DateTime())->setDate(2014, 12, 2);
```

### Station

[](#station)

#### Search by String

[](#search-by-string)

```
$searchString = "Ber";
$response = $stationService->search($searchString);
```

### Connection

[](#connection)

#### Search

[](#search)

```
$connectionData = new \AmsBusClient\Data\Connection();
$connectionData
    ->setFrom($originCode)
    ->setTo($destinationCode)
    ->setTripDate($tripDate);

$response = $connectionService->search($connectionData);
$handle = $response->getData()->handle;
```

#### Get Info

[](#get-info)

```
foreach ($response->getData()->connections as $index => $connection) {
    break;
}
$urlParams = [$handleId, $indexId];

$response = $connectionService->getInfo($urlParams);
```

### Seat

[](#seat)

#### Block

[](#block)

```
$response = $seatService->block(array(), $urlParams);
```

#### Unblock

[](#unblock)

```
$response = $seatService->unblock(array(), $urlParams);
```

### Ticket

[](#ticket)

#### Create

[](#create)

```
$urlParams = [$ticketHandle]; #from response

$additionalInfo = new \AmsBusClient\Data\AdditionalInfo();
foreach ($tickets as $index => $ticket) {
    $passenger = new \AmsBusClient\Data\Passenger();
    $passenger->setName('John Doe');
    $passenger->setTicketIdx($index);   //the ticket index in the array (probably)
    $additionalInfo->addPassenger($passenger);
}

$response = $ticketService->create($additionalInfo, $urlParams);
$ticket = $response->getData();
```

#### Get

[](#get)

```
$response = $ticketService->get($ticketHandle);
```

#### Cancel

[](#cancel)

```
$response = $ticketService->cancel($ticketHandle);
```

#### Refund

[](#refund)

```
foreach ($tickets as $ticket) {
    $transCode = $ticket->transCode;
    $operation = \AmsBusClient\Endpoint\Interfaces\TicketInterface::OPERATION_THERE;
    $response = $ticketService->refund($transCode, $operation);
    $refundHandles[] = $response->getData()->refundHandle;
}
```

#### RefundCancel

[](#refundcancel)

```
foreach ($refundHandles as $refundHandle) {
    $response = $ticketService->refundCancel($refundHandle);
}
```

#### RefundConfirm

[](#refundconfirm)

```
foreach ($refundHandles as $refundHandle) {
    $response = $ticketService->refundConfirm($refundHandle);
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1422be5fd5ea66b3a1b008fa0cccd7596217c82027ab5e2ae79341419ac7dc87?d=identicon)[twiener](/maintainers/twiener)

---

Top Contributors

[![thomaswiener](https://avatars.githubusercontent.com/u/1860954?v=4)](https://github.com/thomaswiener "thomaswiener (36 commits)")[![klederson](https://avatars.githubusercontent.com/u/25665?v=4)](https://github.com/klederson "klederson (1 commits)")[![raphaelsaez](https://avatars.githubusercontent.com/u/1648344?v=4)](https://github.com/raphaelsaez "raphaelsaez (1 commits)")[![xgustaf](https://avatars.githubusercontent.com/u/1751802?v=4)](https://github.com/xgustaf "xgustaf (1 commits)")

### Embed Badge

![Health badge](/badges/thomaswiener-client-amsbus/health.svg)

```
[![Health](https://phpackages.com/badges/thomaswiener-client-amsbus/health.svg)](https://phpackages.com/packages/thomaswiener-client-amsbus)
```

###  Alternatives

[yavin/symfony-form-tree

create select field with indentation for tree structure

1591.1k1](/packages/yavin-symfony-form-tree)[spatie/laravel-help-space

Integrate Helpspace in your Laravel app

2333.7k](/packages/spatie-laravel-help-space)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
