Basic DHL implementation, Refactor redundant code
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Xentral\Carrier\Dhl\Data;
|
||||
|
||||
use DateTimeImmutable;
|
||||
|
||||
class ShipmentDetails
|
||||
{
|
||||
public string $product;
|
||||
public string $accountNumber;
|
||||
public string $customerReference;
|
||||
private string $shipmentDate;
|
||||
public string $costCentre;
|
||||
public string $returnShipmentAccountNumber;
|
||||
public string $returnShipmentReference;
|
||||
public ShipmentItem $ShipmentItem;
|
||||
public ShipmentService $Service;
|
||||
public ShipmentNotification $Notification;
|
||||
public Bank $BankData;
|
||||
|
||||
public function SetShipmentDate(DateTimeImmutable $date): void {
|
||||
$this->shipmentDate = $date->format('Y-m-d');
|
||||
}
|
||||
|
||||
public function GetShipmentDate(): DateTimeImmutable {
|
||||
return DateTimeImmutable::createFromFormat('Y-m-d', $this->shipmentDate);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user