gpt4 book ai didi

php - Sabre API 货币转换

转载 作者:行者123 更新时间:2023-12-04 15:50:39 25 4
gpt4 key购买 nike

我需要有关如何在 Sabre REST API 中将美元货币更改为菲律宾货币的帮助。使用 Bargain Finder Max。

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

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

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

"PriceRequestInformation" : {
"CurrencyCode" : "PHP"
}

最佳答案

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

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

关于php - Sabre API 货币转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53943398/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com