我将此GitHub代码用于酒店列表和酒店详情部分https://github.com/dyatlov/Expedia-PHP-API
预订过程我正在使用此代码:
$info = $expedia->getHotelInfo( $_REQUEST['hotelid'] );
echo '<pre>';
var_export( $info );
// book hotel
$expedia->set_method('POST');
$expedia->set_protocol('https://book.');
$result = $expedia->res( array(
'hotelId' => $_REQUEST['hotelid'],
'arrivalDate' => '7/27/2015',
'departureDate' => '7/29/2015',
'supplierType' => 'E',
'rateKey' => '234be234234afd',
'roomTypeCode' => 12345,
'rateCode' => '123123',
'chargeableRate' => '150.0',
'room1' => 1,
'room1FirstName' => 'John',
'room1LastName' => 'Guest',
'room1BedTypeId' => 1234,
'room1SmokingPreference' => 'no',
'email' => 'test@test.com',
'firstName' => 'Tester',
'lastName' => 'Tester',
'homePhone' => '1234567',
'workPhone' => '1234567',
'creditCardType' => 'VI',
'creditCardNumber' => '41111111111111111',
'creditCardIdentifier' => '123',
'creditCardExpirationMonth' => '05',
'creditCardExpirationYear' => '2017',
'address1' => 'travelnow',
'city' => 'Moscow',
'stateProvinceCode' => null,
'countryCode' => 'RU',
'postalCode' => '3357'
) );
但是我在这里将此代码集成到WordPress中,并且从请求URL我现在将获得酒店ID,请告诉我为Expedia进行现场预订的具体流程是什么以及如何获得确认并取消确认。我正在开发模式中完成所有这些工作。