Skip to content
PHP SDK for travelpayouts
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/thewulf7/travelPayouts
tests/thewulf7/travelPayouts
.gitignore
README.md
composer.json
phpunit.xml

README.md

Travel Payouts PHP SDK

Codeship Status for thewulf7/travel-payouts

Installation

Composer

composer require thewulf7/travel-payouts

or add to your composer.json file, in the "require" section

"thewulf7/travel-payouts": "1.1.*"

Usage

First of all create main Travel object and pass your token in it

use thewulf7\travelPayouts\Travel; 

$travel = new Travel('YOUR TOKEN HERE');

Then you can use it get different services

Tickets service

$ticketService = $travel->getTicketsService();
//Get flights found by our users in the last 48 hours from LED to MOW. Return array consists of thewulf7\travelPayouts\Ticket objects.
$flights = $ticketService->getLatestPrices('LED', 'MOW', false, 'rub', 'year', 1, 10);

See documentation

Flight service

$flightService = $travel->getFlightService();
$flightService
       ->setIp('127.0.0.1')
       ->setHost('aviasales.ru')
       ->setMarker('123')
       ->addPassenger('adults', 2)
       ->addSegment('LED', 'MOW', '2016-02-01');
$searchData    = $flightService->search('ru', 'Y');
$searchResults = $flightService->getSearchResults($searchData['search_id']);

Partner service

$partnerService = $travel->getPartnerService();
//get user balance and currency of the balance
list($balance, $currency) = $partnerService->getBalance();

Data service

$dataService = $travel->getDataService();
//get all airports in the system
$airports    = $dataService->getAirports(); 
You can’t perform that action at this time.