diff --git a/src/App/Order/Calculator/UPS/UPSAgeCheckCalculator.php b/src/App/Order/Calculator/UPS/UPSAgeCheckCalculator.php index 0db8bc725..996363ca2 100644 --- a/src/App/Order/Calculator/UPS/UPSAgeCheckCalculator.php +++ b/src/App/Order/Calculator/UPS/UPSAgeCheckCalculator.php @@ -8,7 +8,7 @@ use MyParcelNL\Pdk\Types\Service\TriStateService; /** - * When age check is enabled, signature and only recipient are required. + * When age check is enabled, signature is required. */ final class UPSAgeCheckCalculator extends AbstractPdkOrderOptionCalculator { @@ -20,7 +20,6 @@ public function calculate(): void return; } - $shipmentOptions->signature = TriStateService::ENABLED; - $shipmentOptions->onlyRecipient = TriStateService::ENABLED; + $shipmentOptions->signature = TriStateService::ENABLED; } } diff --git a/src/App/Order/Calculator/UPS/UPSDeliveryTypeCalculator.php b/src/App/Order/Calculator/UPS/UPSDeliveryTypeCalculator.php index 6efbe3109..e44a07cb2 100644 --- a/src/App/Order/Calculator/UPS/UPSDeliveryTypeCalculator.php +++ b/src/App/Order/Calculator/UPS/UPSDeliveryTypeCalculator.php @@ -16,13 +16,13 @@ class UPSDeliveryTypeCalculator extends AbstractPdkOrderOptionCalculator public function calculate(): void { $deliveryOptions = $this->order->deliveryOptions; - $cc = $this->order->shippingAddress->cc; - switch ($deliveryOptions->deliveryType) { - case DeliveryOptions::DELIVERY_TYPE_EXPRESS_NAME: - if ($cc !== CountryCodes::CC_NL) { - $deliveryOptions->deliveryType = DeliveryOptions::DELIVERY_TYPE_STANDARD_NAME; - } + $isExpress = $deliveryOptions->deliveryType === DeliveryOptions::DELIVERY_TYPE_EXPRESS_NAME; + if ( + $isExpress + && $this->order->shippingAddress->cc !== CountryCodes::CC_NL + ) { + $deliveryOptions->deliveryType = DeliveryOptions::DELIVERY_TYPE_STANDARD_NAME; } } } diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_default__data_set_export_age_check__data_set_carrier_UPS_to_Belgium__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_default__data_set_export_age_check__data_set_carrier_UPS_to_Belgium__1.json index 6f4dc3b0c..b9410752a 100644 --- a/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_default__data_set_export_age_check__data_set_carrier_UPS_to_Belgium__1.json +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_default__data_set_export_age_check__data_set_carrier_UPS_to_Belgium__1.json @@ -10,7 +10,6 @@ "package_type": 1, "delivery_type": 2, "age_check": 1, - "only_recipient": 1, "signature": 1 }, "physical_properties": { diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_default__data_set_export_age_check__data_set_carrier_UPS_to_Netherlands_express__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_default__data_set_export_age_check__data_set_carrier_UPS_to_Netherlands_express__1.json index 2a207f490..e0e72d032 100644 --- a/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_default__data_set_export_age_check__data_set_carrier_UPS_to_Netherlands_express__1.json +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_default__data_set_export_age_check__data_set_carrier_UPS_to_Netherlands_express__1.json @@ -10,7 +10,6 @@ "package_type": 1, "delivery_type": 7, "age_check": 1, - "only_recipient": 1, "signature": 1 }, "physical_properties": { diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_order_mode__data_set_export_age_check__data_set_carrier_UPS_to_Belgium__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_order_mode__data_set_export_age_check__data_set_carrier_UPS_to_Belgium__1.json index 94c73a3ff..fa0881bfc 100644 --- a/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_order_mode__data_set_export_age_check__data_set_carrier_UPS_to_Belgium__1.json +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_order_mode__data_set_export_age_check__data_set_carrier_UPS_to_Belgium__1.json @@ -45,7 +45,7 @@ }, "label_description": "", "large_format": 0, - "only_recipient": 1, + "only_recipient": 0, "package_type": 1, "return": 0, "same_day_delivery": 0, diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_order_mode__data_set_export_age_check__data_set_carrier_UPS_to_Netherlands_express__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_order_mode__data_set_export_age_check__data_set_carrier_UPS_to_Netherlands_express__1.json index 48db51351..34a1ebbaa 100644 --- a/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_order_mode__data_set_export_age_check__data_set_carrier_UPS_to_Netherlands_express__1.json +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_order_with_data_set_order_mode__data_set_export_age_check__data_set_carrier_UPS_to_Netherlands_express__1.json @@ -45,7 +45,7 @@ }, "label_description": "", "large_format": 0, - "only_recipient": 1, + "only_recipient": 0, "package_type": 1, "return": 0, "same_day_delivery": 0,