2017 © Pedro Peláez
 

project goglobalapi

This is goglobal service api library.

image

ustmaestro/goglobalapi

This is goglobal service api library.

  • Friday, April 15, 2016
  • by ustmaestro
  • Repository
  • 4 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 56 % Grown

The README.md

goglobalapi

This is GoGlobal WebService api library written in PHP., (*1)

Install

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist ustmaestro/goglobalapi "dev-master"

or add, (*4)

"ustmaestro/goglobalapi": "dev-master"

to the require section of your composer.json file., (*5)

Usage

If you do not use composer add following line, that will register ustmaestro\goglobalapi namespace, (*6)

require_once( path_to_loader_class . '/Loader.php');

An example o using GGService, (*7)

use ustmaestro\goglobalapi\GGService;
use ustmaestro\goglobalapi\lib\GGSearchModel;

$config['agency'] = 'Your GG Agency ID';
$config['user'] = 'Your GG Username';
$config['password'] = 'Your GG Password';

$service = new GGService($config);
$model = new GGSearchModel();

$model->city_code = 2016;       // GG internal city code
$model->check_in = '20161003';  // check in date
$model->nights = 3;             // number of nights

$model->rooms_number = 2;       // number of rooms

$model->rooms_persons = [       // persons count by rooms !!! attention index starts with -1-
    '1' => [                    // room 1
        'adult' => 1,           // adults count
        'child' => 0,           // childrens count
    ],
    '2' => [                    // room 1
        'adult' => 2,           // adults count
        'child' => 1,           // childrens count
    ],
];

$results =  $service->searchHotels($model);
var_dump($results);

Available service public methods For more details check api documentation, (*8)

public function setMaxResults($max)
public function getMaxResults()
public function setTimeout($timeout)
public function getTimeout($timeout)

public function searchHotels(GGSearchModel $model)
public function searchHotelsGeo(GGSearchModel $model)
public function getHotelInfo($hotelCode)
public function getHotelInfoGeo($hotelCode)
public function insertBooking($agentReference, $hotelCode, $hotelCheckIn, $hotelNights, $hasAlternative, $leaderId, $bookingRooms)
public function cancelBooking($bookingId)
public function searchBooking($bookingId)
public function searchBookingAdvanced($dateFrom = "", $dateTo = "", $paxName = "", $cityCode = "", $nights = "", $hotelName = "")
public function checkBookingStatus($bookingId)
public function checkBookingsStatus($bookingsId = [])
public function checkBookingValuation($hotelCode, $arrivalDate)
public function getBookingVoucher($bookingId, $emergencyPhone = true)
public function getPiggyPoints($bookingId, $emergencyPhone = true)
public function getPaymentService($bookingId, $returnUrl)
public function getPriceBreakdown($hotelCode)
public function getBookingAmendementInfo($bookingId)

The Versions

15/04 2016

dev-master

9999999-dev

This is goglobal service api library.

  Sources   Download

Apache-2.0

by Avatar ustmaestro