gpt4 book ai didi

php - 使用 PHP 和星期六航运的 FedEx API

转载 作者:行者123 更新时间:2023-12-02 04:15:26 28 4
gpt4 key购买 nike

我正在尝试弄清楚如何使用带有 php 的 fedex api 强制星期六交货。谁能帮忙举个例子。我尝试了几种周五发货日期的方法,但都没有提供周六发货,只有周一发货。这是代码的一部分:

            if ($data['special_service']) {
echo "special services friday ship date <br>";

//$request['SpecialServicesRequested']['SpecialServiceTypes'] = 'SATURDAY_DELIVERY';
//$request['RateRequest']['VariableOptionsServiceOptionType'] = 'SATURDAY_DELIVERY';
$request['SpecialServicesRequested']['ShipmentSpecialServiceType'] = 'SATURDAY_DELIVERY';

}
$request['ReturnTransitAndCommit'] = true;
$request['RequestedShipment']['DropoffType'] = 'REGULAR_PICKUP'; // valid values REGULAR_PICKUP, REQUEST_COURIER, ...
$request['RequestedShipment']['ShipTimestamp'] = $date; // date("c", $post[3])
$request['RequestedShipment']['ServiceType'] = $data['service_type']; // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ...
$request['RequestedShipment']['PackagingType'] = 'FEDEX_ENVELOPE'; // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ...
$request['RequestedShipment']['TotalInsuredValue']=array(
'Amount'=>100,
'Currency'=>'USD'
);
$request['RequestedShipment']['Shipper'] = $this->addShipper();
$request['RequestedShipment']['Recipient'] = $this->addRecipient($data);
$request['RequestedShipment']['ShippingChargesPayment'] = $this->addShippingChargesPayment();
$request['RequestedShipment']['PackageCount'] = '1';
$request['RequestedShipment']['RequestedPackageLineItems'] = $this->addPackageLineItem1();

这是我从代码中得到的结果:

array(3) { ["amount"]=> string(5) "33.53"["deliveryDate"]=> string(10) "12/07/2015"["serviceType"]=> string(18 ) "PRIORITY_OVERNIGHT"}

返回日期为周一,未加周六运费。

最佳答案

使用“SpecialServicesRequested”选项会导致返回 星期六交付选项。如果您改为使用“VariableOptions”,那么您将获得与标准选项混合的星期六交付选项。示例:

$ratesRequest['VariableOptions'] = 'SATURDAY_DELIVERY';

关于php - 使用 PHP 和星期六航运的 FedEx API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34094893/

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