Skip to content

Commit

Permalink
fix: use correct insurance format (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
joerivanveen committed Feb 17, 2023
1 parent 526e007 commit 78318aa
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 26 deletions.
22 changes: 0 additions & 22 deletions Dockerfile

This file was deleted.

5 changes: 5 additions & 0 deletions src/Model/Consignment/AbstractConsignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ 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';
/**
* @deprecated since jan 2023 extra_assurance is no longer supported
*/
public const SHIPMENT_OPTION_EXTRA_ASSURANCE = 'extra_assurance';

public const EXTRA_OPTION_DELIVERY_DATE = 'delivery_date';
Expand Down Expand Up @@ -1536,6 +1539,7 @@ public function hasHideSender(): ?bool
* @param bool $extraAssurance
* @codeCoverageIgnore
* @return $this
* @deprecated since 2023
*/
public function setExtraAssurance(bool $extraAssurance): self
{
Expand All @@ -1546,6 +1550,7 @@ public function setExtraAssurance(bool $extraAssurance): self

/**
* @return null|bool
* @deprecated since 2023
*/
public function hasExtraAssurance(): ?bool
{
Expand Down
18 changes: 17 additions & 1 deletion src/Model/Consignment/DHLForYouConsignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function getAllowedShipmentOptions(): array
return [
self::SHIPMENT_OPTION_AGE_CHECK,
self::SHIPMENT_OPTION_HIDE_SENDER,
self::SHIPMENT_OPTION_EXTRA_ASSURANCE,
self::SHIPMENT_OPTION_INSURANCE,
self::SHIPMENT_OPTION_ONLY_RECIPIENT,
self::SHIPMENT_OPTION_SIGNATURE,
self::SHIPMENT_OPTION_SAME_DAY_DELIVERY,
Expand All @@ -63,4 +63,20 @@ public function getLocalCountryCode(): string
{
return self::CC_NL;
}

/**
* @return int[]
*/
protected function getLocalInsurancePossibilities(): array
{
return [
500,
1000,
1500,
2000,
2500,
3000,
];
}

}
6 changes: 3 additions & 3 deletions test/Model/Consignment/DHLForYouConsignmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public function provideDHLForYouConsignmentsData(): array
self::HIDE_SENDER => true,
self::SAME_DAY_DELIVERY => true,
],
'Extra assurance' => [
self::EXTRA_ASSURANCE => true,
'Insurance' => [
self::INSURANCE => 500,
self::SAME_DAY_DELIVERY => true,
self::expected(self::INSURANCE) => 0,
self::expected(self::INSURANCE) => 500,
],
'Return' => [
self::RETURN => true,
Expand Down

0 comments on commit 78318aa

Please sign in to comment.