0

我是 EAN 开发的新手。我正在使用 EAN 在 PHP 中开发酒店预订系统。我想从 EAN API 获取预订详情。

以下是我的代码:

$itinerary = xxxxxx;
        $cid = 55505;
        $minorRev = 13;
        $apiKey = "y2dfnyvwbwkvgth76hfjdej7";
        $locale = "en_US";
        $currencyCode = "USD";
        $customerSessionId;
        $customerUserAgent;
        $customerIpAddress;
        $url = "http:api.ean.com/ean-services/rs/hotel/v3/";
        $urlBook = "https:book.api.ean.com/ean-services/rs/hotel/v3/";

        $url = ($service == 'res') ? $urlBook : $url;
        $url .= $service
                . "?minorRev={$minorRev}"
                . "&cid={$cid}"
                . "&apiKey={$apiKey}"
                . "&customerUserAgent=" . rawurlencode($customerUserAgent)
                . "&customerIpAddress={$customerIpAddress}"
                . "&customerSessionId={$customerSessionID}"
                . "&locale={$locale}"
                . "&currencyCode={$currencyCode}";

        $xml = "
        <HotelItineraryRequest>
            <itineraryId>{$itinerary}</itineraryId>
            <email>customer@mail.com</email>
       </HotelItineraryRequest>
        ";

        $curl = new Curl();
        $info = $curl->exec($xml, $url, "ItinerarySearch");
        print_r($info);

它显示以下错误: 无法服务此请求。身份验证失败

这段代码有什么问题。有什么解决方案可以让我从 EAN 获取预订详细信息。

我使用来自 expedia 的演示 php 代码库:http: //developer.ean.com/code_library/samples/PHP_Booking

提前致谢。

4

0 回答 0