diff --git a/src/Model/Consignment/AbstractConsignment.php b/src/Model/Consignment/AbstractConsignment.php index 122d1a8c..9c98ddce 100755 --- a/src/Model/Consignment/AbstractConsignment.php +++ b/src/Model/Consignment/AbstractConsignment.php @@ -43,6 +43,7 @@ abstract class AbstractConsignment public const SHIPMENT_OPTION_RETURN = 'return'; public const SHIPMENT_OPTION_SAME_DAY_DELIVERY = 'same_day_delivery'; public const SHIPMENT_OPTION_SIGNATURE = 'signature'; + public const SHIPMENT_OPTION_COLLECT = 'collect'; public const SHIPMENT_OPTION_RECEIPT_CODE = 'receipt_code'; /** * @deprecated since jan 2023 extra_assurance is no longer supported @@ -57,6 +58,7 @@ abstract class AbstractConsignment self::SHIPMENT_OPTION_ONLY_RECIPIENT, self::SHIPMENT_OPTION_RETURN, self::SHIPMENT_OPTION_SIGNATURE, + self::SHIPMENT_OPTION_COLLECT, self::SHIPMENT_OPTION_RECEIPT_CODE, ]; @@ -72,6 +74,7 @@ abstract class AbstractConsignment public const DELIVERY_TYPE_STANDARD = 2; public const DELIVERY_TYPE_EVENING = 3; public const DELIVERY_TYPE_PICKUP = 4; + public const DELIVERY_TYPE_EXPRESS = 7; /** * @deprecated Since November 2019 is it no longer possible to use pickup express. @@ -82,6 +85,7 @@ abstract class AbstractConsignment public const DELIVERY_TYPE_STANDARD_NAME = 'standard'; public const DELIVERY_TYPE_EVENING_NAME = 'evening'; public const DELIVERY_TYPE_PICKUP_NAME = 'pickup'; + public const DELIVERY_TYPE_EXPRESS_NAME = 'express'; /** * @deprecated Since November 2019 is it no longer possible to use pickup express. @@ -94,6 +98,7 @@ abstract class AbstractConsignment self::DELIVERY_TYPE_STANDARD, self::DELIVERY_TYPE_EVENING, self::DELIVERY_TYPE_PICKUP, + self::DELIVERY_TYPE_EXPRESS, self::DELIVERY_TYPE_PICKUP_EXPRESS, ]; @@ -103,6 +108,7 @@ abstract class AbstractConsignment self::DELIVERY_TYPE_STANDARD_NAME, self::DELIVERY_TYPE_EVENING_NAME, self::DELIVERY_TYPE_PICKUP_NAME, + self::DELIVERY_TYPE_EXPRESS_NAME, self::DELIVERY_TYPE_PICKUP_EXPRESS_NAME, ]; @@ -112,6 +118,7 @@ abstract class AbstractConsignment self::DELIVERY_TYPE_STANDARD_NAME => self::DELIVERY_TYPE_STANDARD, self::DELIVERY_TYPE_EVENING_NAME => self::DELIVERY_TYPE_EVENING, self::DELIVERY_TYPE_PICKUP_NAME => self::DELIVERY_TYPE_PICKUP, + self::DELIVERY_TYPE_EXPRESS_NAME => self::DELIVERY_TYPE_EXPRESS, self::DELIVERY_TYPE_PICKUP_EXPRESS_NAME => self::DELIVERY_TYPE_PICKUP_EXPRESS, ]; diff --git a/src/Model/Consignment/UPSConsignment.php b/src/Model/Consignment/UPSConsignment.php index a71cf4e7..77a03fc9 100644 --- a/src/Model/Consignment/UPSConsignment.php +++ b/src/Model/Consignment/UPSConsignment.php @@ -56,7 +56,58 @@ public function getAllowedPackageTypes(): array public function getAllowedDeliveryTypes(): array { return [ - self::DELIVERY_TYPE_STANDARD, + self::DELIVERY_TYPE_STANDARD_NAME, + self::DELIVERY_TYPE_EXPRESS_NAME, ]; } + + /** + * @return string[] + */ + public function getAllowedShipmentOptions(): array + { + return [ + self::SHIPMENT_OPTION_AGE_CHECK, + self::SHIPMENT_OPTION_COLLECT, + self::SHIPMENT_OPTION_INSURANCE, + self::SHIPMENT_OPTION_ONLY_RECIPIENT, + self::SHIPMENT_OPTION_SIGNATURE, + ]; + } + + /** + * @return int[] + */ + protected function getLocalInsurancePossibilities(): array + { + return [ + 250, + 500, + 1000, + 1500, + 2000, + 2500, + 3000, + 3500, + 4000, + 4500, + 5000, + ]; + } + + /** + * @return int[] + */ + protected function getEuInsurancePossibilities(): array + { + return $this->getLocalInsurancePossibilities(); + } + + /** + * @return array + */ + protected function getNlToBeInsurancePossibilities(): array + { + return $this->getLocalInsurancePossibilities(); + } }