首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sabre货币换算

Sabre货币换算
EN

Stack Overflow用户
提问于 2018-12-27 10:21:52
回答 1查看 372关注 0票数 3

我需要帮助如何在Sabre REST中将美元兑换成菲律宾货币。用便宜的马克斯。

它需要改变货币,因为我们位于菲律宾。提供下面的代码,如果凭据有问题,只需发布,我将创建一个新的访问令牌。

代码语言:javascript
复制
<?php
$key = "T1RLAQK5VRIz4u9UxsrtRpVkv3TPUpGDpxD3eZ1ylkey88VRPyWu7FXRAADAK01jW46inTdqwxIBMPzzfM30QkYRuzvEnf3wEslyMSLmfZMPfV0rTTjdyuv4EYAzi+276mRO3f1VRsDI+Y/VW+CRm82SYlgkp6cW+MhqltdgpnuP+uzDCL8aXE3yD3hcRXQPlEDbFtcjWQ1lLE1fmfr5+xrcHwtggEGcwRG4BDyVwDgKFucjSfE9jZ51ORnYpTPgfK6rDsyHU/rJr8QKb83PVqKBKD+L/FeKaqrQolkcn5Pdemg2bWFtaTzNoQCi";
$header[] = "Authorization: Bearer " . $key;
$header[] = "Accept: application/json"; 
$header[] = "Content-Type: application/json";
$data = '{
 "OTA_AirLowFareSearchRQ": {
     "Target": "Production",
       "POS": {
            "Source": [{
                "PseudoCityCode":"F9CE",
                "RequestorID": {
                    "Type": "1",
                  "ID": "1",
                    "CompanyName": {
                  }
             }
         }]
        },
        "OriginDestinationInformation": [{
          "RPH": "1",
           "DepartureDateTime": "2019-01-05T11:00:00",
           "OriginLocation": {
             "LocationCode": "CGK"
         },
            "DestinationLocation": {
                "LocationCode": "SUB"
         },
            "TPA_Extensions": {
             "SegmentType": {
                    "Code": "O"
               }
         }
     },
        {
         "RPH": "2",
           "DepartureDateTime": "2019-01-06T11:00:00",
           "OriginLocation": {
             "LocationCode": "CGK"
         },
            "DestinationLocation": {
                "LocationCode": "SUB"
         },
            "TPA_Extensions": {
             "SegmentType": {
                    "Code": "O"
               }
         }
     }],
       "TravelPreferences": {
          "ValidInterlineTicket": true,
           "CabinPref": [{
             "Cabin": "Y",
             "PreferLevel": "Preferred"
            }],
           "TPA_Extensions": {
             "TripType": {
                   "Value": "Return"
             },
                "LongConnectTime": {
                    "Min": 780,
                 "Max": 1200,
                    "Enable": true
              },
                "ExcludeCallDirectCarriers": {
                  "Enabled": true
             }
         }
     },
        "TravelerInfoSummary": {
            "SeatsRequested": [1],
          "AirTravelerAvail": [{
              "PassengerTypeQuantity": [{
                 "Code": "ADT",
                    "Quantity": 1
               }]
            }],
            "PriceRequestInformation" : {
                "CurrencyCode" : "PHP"
            }
        },
        "TPA_Extensions": {
         "IntelliSellTransaction": {
             "RequestType": {
                    "Name": "50ITINS"
             }
         }
     }
 }
}';
$jsonstr = json_decode($data, true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api-crt.cert.havail.sabre.com/v4.3.0/shop/flights?mode=live&limit=50&offset=1" );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER,$header);

$result = curl_exec ($ch);
?>

我刚刚添加了下面的代码:

代码语言:javascript
复制
"PriceRequestInformation" : {
                "CurrencyCode" : "PHP"
            }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-12-27 14:57:11

您可以在TravelerInfoSummary -> PriceRequestInformation下更改货币代码。对于REST,我认为DTO类似。

代码语言:javascript
复制
<TravelerInfoSummary>
    <SeatsRequested>1</SeatsRequested>
    <AirTravelerAvail>
        <PassengerTypeQuantity Code="ADT" Quantity="1" />
    </AirTravelerAvail>
    <PriceRequestInformation CurrencyCode="CAD">
        <TPA_Extensions>
            <Priority>
                <Price Priority="1" />
                <DirectFlights Priority="2" />
                <Time Priority="3" />
                <Vendor Priority="4" />
            </Priority>
        </TPA_Extensions>
    </PriceRequestInformation>
</TravelerInfoSummary>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53943398

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档