thewulf7 / travel-payouts
PHP SDK for travelpayouts.com
Installs: 1 800
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 3
Forks: 19
Open Issues: 2
Requires
- php: >=5.4.0
- guzzle/guzzle: *
- guzzlehttp/guzzle: *
- ramsey/array_column: *
Requires (Dev)
- phpunit/php-invoker: >=1.1.0@stable
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-11-05 12:30:58 UTC
README
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();