PHP code example of thewulf7 / travel-payouts

1. Go to this page and download the library: Download thewulf7/travel-payouts library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

thewulf7 / travel-payouts example snippets


use thewulf7\travelPayouts\Travel; 

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

$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);

$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']);

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

$dataService = $travel->getDataService();
//get all airports in the system
$airports    = $dataService->getAirports();