Skip to content

Commit

Permalink
fix: implement pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianSDV committed Nov 22, 2024
1 parent 81cde17 commit 14409fb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
5 changes: 2 additions & 3 deletions src/App/Order/Calculator/UPS/UPSAgeCheckCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -20,7 +20,6 @@ public function calculate(): void
return;
}

$shipmentOptions->signature = TriStateService::ENABLED;
$shipmentOptions->onlyRecipient = TriStateService::ENABLED;
$shipmentOptions->signature = TriStateService::ENABLED;
}
}
12 changes: 6 additions & 6 deletions src/App/Order/Calculator/UPS/UPSDeliveryTypeCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"package_type": 1,
"delivery_type": 2,
"age_check": 1,
"only_recipient": 1,
"signature": 1
},
"physical_properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"package_type": 1,
"delivery_type": 7,
"age_check": 1,
"only_recipient": 1,
"signature": 1
},
"physical_properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"label_description": "",
"large_format": 0,
"only_recipient": 1,
"only_recipient": 0,
"package_type": 1,
"return": 0,
"same_day_delivery": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"label_description": "",
"large_format": 0,
"only_recipient": 1,
"only_recipient": 0,
"package_type": 1,
"return": 0,
"same_day_delivery": 0,
Expand Down

0 comments on commit 14409fb

Please sign in to comment.