ustmaestro/goglobalapi

这是 goglobal 服务 API 库。

安装: 179

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 4

分支: 3

开放问题: 0

类型:项目

dev-master 2016-04-15 16:57 UTC

This package is not auto-updated.

Last update: 2024-09-26 00:39:56 UTC


README

goglobalapi

这是用 PHP 编写的 GoGlobal WebService API 库。

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一

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

或者

"ustmaestro/goglobalapi": "dev-master"

将以下内容添加到 composer.json 文件的 require 部分。

用法

如果您不使用 composer,请添加以下行以注册 ustmaestro\goglobalapi 命名空间

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

GGService 使用示例

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

可用的服务公共方法 更多详细信息请参阅 API 文档

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)