seet default destinationEntryFacilityType

This commit is contained in:
O K
2025-12-27 11:15:24 +02:00
parent 2496d8f74a
commit 1ec760de1d

View File

@@ -268,16 +268,17 @@ class Usps_Api_Bridge extends Module
// 1. Prepare the specific payload for the cache key // 1. Prepare the specific payload for the cache key
// We simulate the modifications we are about to do to ensure the key is accurate // We simulate the modifications we are about to do to ensure the key is accurate
$cachePayload = $payload; $cachePayload = $payload;
$cachePayload['destinationEntryFacilityType'] = 'NONE';
if ($isInternational) { if ($isInternational) {
$cachePayload['destinationCountryCode'] = Country::getIsoById($destAddress->id_country); $cachePayload['destinationCountryCode'] = Country::getIsoById($destAddress->id_country);
$cachePayload['originZIPCode'] = $payload['originZIPCode']; // Ensure consistency $cachePayload['originZIPCode'] = $payload['originZIPCode']; // Ensure consistency
unset($cachePayload['destinationEntryFacilityType']); // unset($cachePayload['destinationEntryFacilityType']);
unset($cachePayload['destinationZIPCode']); unset($cachePayload['destinationZIPCode']);
$endpointType = 'INT'; $endpointType = 'INT';
} else { } else {
$cachePayload['destinationZIPCode'] = $destZip; $cachePayload['destinationZIPCode'] = $destZip;
$cachePayload['destinationEntryFacilityType'] = 'NONE'; // $cachePayload['destinationEntryFacilityType'] = 'NONE';
$endpointType = 'DOM'; $endpointType = 'DOM';
} }
@@ -384,7 +385,7 @@ class Usps_Api_Bridge extends Module
'INT_2' => 'PRIORITY_MAIL_INTERNATIONAL', 'INT_2' => 'PRIORITY_MAIL_INTERNATIONAL',
'INT_15' => 'FIRST-CLASS_PACKAGE_INTERNATIONAL_SERVICE', 'INT_15' => 'FIRST-CLASS_PACKAGE_INTERNATIONAL_SERVICE',
//'INT_4' => 'GLOBAL_EXPRESS_GUARANTEED' //'INT_4' => 'GLOBAL_EXPRESS_GUARANTEED'
'INT_4' => 'CLASS_PACKAGE_INTERNATIONAL_SERVICE' 'INT_4' => 'FIRST-CLASS_PACKAGE_INTERNATIONAL_SERVICE'
]; ];