Skip to content

Commit

Permalink
#37524 Kleinpaket replaces Warenpost
Browse files Browse the repository at this point in the history
  • Loading branch information
mbe1987 committed Dec 5, 2024
1 parent 8e303ba commit 34b5101
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ModuleConfiguration extends ModuleConfiguration_parent
'PAKET' => 'DHL PAKET',
'PAKET_INTERNATIONAL' => 'PAKET INTERNATIONAL',
'EUROPAKET' => 'DHL EUROPAKET',
'WARENPOST' => 'Warenpost',
'KLEINPAKET' => 'DHL Kleinpaket',
'WARENPOST_INTERNATIONAL' => 'Warenpost International',
];

Expand All @@ -67,7 +67,7 @@ class ModuleConfiguration extends ModuleConfiguration_parent
'DHL PAKET' => 'PAKET',
'PAKET INTERNATIONAL' => 'PAKET_INTERNATIONAL',
'DHL EUROPAKET' => 'EUROPAKET',
'Warenpost' => 'WARENPOST',
'DHL Kleinpaket' => 'KLEINPAKET',
'Warenpost International' => 'WARENPOST_INTERNATIONAL',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'SHOP_MODULE_mo_dhl__authentication_check' => '',

'SHOP_MODULE_GROUP_mo_dhl__portokasse' => 'Portokasse',
'SHOP_MODULE_mo_dhl__portokasse_user' => 'Portokasse Benutzername (für Internetmarke und Warenpost)',
'SHOP_MODULE_mo_dhl__portokasse_user' => 'Portokasse Benutzername (für Internetmarke)',
'HELP_SHOP_MODULE_mo_dhl__portokasse_user' => 'Ihre E-Mail Adresse für die <a href="https://portokasse.deutschepost.de/">Portokasse</a>. Noch kein Kunde? Dann registrieren Sie sich <a href="https://portokasse.deutschepost.de/portokasse/#!/register/">hier</a>.',
'SHOP_MODULE_mo_dhl__portokasse_password' => 'Portokasse Passwort',
'HELP_SHOP_MODULE_mo_dhl__portokasse_password' => 'Ihr Passwort für die <a href="https://portokasse.deutschepost.de/">Portokasse</a>.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'SHOP_MODULE_mo_dhl__authentication_check' => '',

'SHOP_MODULE_GROUP_mo_dhl__portokasse' => 'Portokasse',
'SHOP_MODULE_mo_dhl__portokasse_user' => 'Portokasse Username (for Internetmarke and Warenpost)',
'SHOP_MODULE_mo_dhl__portokasse_user' => 'Portokasse Username (for Internetmarke)',
'HELP_SHOP_MODULE_mo_dhl__portokasse_user' => 'Your E-Mail Adress for the <a href="https://portokasse.deutschepost.de/">Portokasse</a>. Not a customer yet? Then register <a href="https://portokasse.deutschepost.de/portokasse/#!/register/">here</a>.',
'SHOP_MODULE_mo_dhl__portokasse_password' => 'Portokasse Password',
'HELP_SHOP_MODULE_mo_dhl__portokasse_password' => 'Your Password for the <a href="https://portokasse.deutschepost.de/">Portokasse</a>.',
Expand Down
12 changes: 6 additions & 6 deletions src/modules/mo/mo_dhl/Shipment/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class Process
const EUROPAKET = 'EUROPAKET';

/**
* @var string Warenpost national
* @var string DHL Kleinpaket
*/
const WARENPOST = 'WARENPOST';
const KLEINPAKET = 'KLEINPAKET';

/**
* string Internetmarke
Expand Down Expand Up @@ -180,7 +180,7 @@ class Process
self::SERVICE_GO_GREEN,
self::SERVICE_ADDITIONAL_INSURANCE,
],
self::WARENPOST => [
self::KLEINPAKET => [
self::SERVICE_PREFERRED_NEIGHBOUR,
self::SERVICE_PREFERRED_LOCATION,
self::SERVICE_NOTIFICATION,
Expand Down Expand Up @@ -258,7 +258,7 @@ public function __toString()
self::PAKET => '01',
self::PAKET_INTERNATIONAL => '53',
self::EUROPAKET => '54',
self::WARENPOST => '62',
self::KLEINPAKET => '62',
self::WARENPOST_INTERNATIONAL => '66',
self::RETOURE_FUER_PAKET => '07',
];
Expand Down Expand Up @@ -428,7 +428,7 @@ public function getServiceIdentifier()
self::PAKET => 'V01PAK',
self::PAKET_INTERNATIONAL => 'V53WPAK',
self::EUROPAKET => 'V54EPAK',
self::WARENPOST => 'V62WP',
self::KLEINPAKET => 'V62KP',
self::WARENPOST_INTERNATIONAL => 'V66WPI',
self::RETOURE_FUER_PAKET => 'V01PAK',
];
Expand Down Expand Up @@ -480,7 +480,7 @@ public static function getAvailableProcesses()
'PAKET' => 'DHL Paket',
'PAKET_INTERNATIONAL' => 'DHL Paket International',
'EUROPAKET' => 'DHL Europaket (B2B)',
'WARENPOST' => 'Warenpost national',
'KLEINPAKET' => 'DHL Kleinpaket',
'INTERNETMARKE' => 'Internetmarke',
'WARENPOST_INTERNATIONAL'=> 'Warenpost International',
];
Expand Down
6 changes: 3 additions & 3 deletions tests/Api/ParcelShipping/BaseParcelShippingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function getUniqueShipmentId()
* @param string $product
* @return Shipment
*/
protected function createShipmentToGermany($product = 'V01PAK'): Shipment
protected function createShipmentToGermany($product = 'V62KP'): Shipment
{
$receiver = [
'name1' => 'a b',
Expand All @@ -65,11 +65,11 @@ protected function createShipmentToGermany($product = 'V01PAK'): Shipment
$shipmentDetails = new ShipmentDetails();
$weight = new Weight();
$weight->setUom('kg');
$weight->setValue(12);
$weight->setValue(0.8);
$shipmentDetails->setWeight($weight);
$shipment->setDetails($shipmentDetails);
$shipment->setCreationSoftware(CsvExporter::CREATOR_TAG);
$shipment->setBillingNumber(new BillingNumber(Ekp::build('3333333333'), Process::build(Process::PAKET), Participation::build('01')));
$shipment->setBillingNumber(new BillingNumber(Ekp::build('3333333333'), Process::build(Process::KLEINPAKET), Participation::build('01')));
$shipment->setProduct($product);
$shipment->setRefNo('Bestellnr. 123');
$shipment->setShipDate((new \DateTime()));
Expand Down
2 changes: 1 addition & 1 deletion tests/Api/ParcelShipping/ValidateShipmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testValidateShipment()
$response = $this->buildParcelShipping()->createOrders($request, $query, [], \Mediaopt\DHL\Api\MyAccount\Runtime\Client\Client::FETCH_RESPONSE);
$this->assertInstanceOf(ResponseInterface::class, $response);
$payload = \json_decode($response->getBody(), true);
$this->assertEquals(200, $response->getStatusCode(), $payload['status']['detail'] ?? $payload['detail']);
$this->assertEquals(200, $response->getStatusCode(), $payload['items'][0]['validationMessages'][0]['validationMessage'] ?? $payload['status']['detail'] ?? $payload['detail']);
}

public function testValidateShipmentOutsideGermany()
Expand Down
20 changes: 10 additions & 10 deletions tests/Shipment/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class ProcessTest extends TestCase
'V86PARCEL',
'V87PARCEL',
'V82PARCEL',
'V62WP',
'V62KP',
];

const PROCESS_IDENTIFIERS = [
Process::PAKET,
Process::PAKET_INTERNATIONAL,
Process::EUROPAKET,
Process::WARENPOST,
Process::KLEINPAKET,
];

const ADDITIONAL_SERVICE_IDENTIFIERS = [
Expand Down Expand Up @@ -105,17 +105,17 @@ public function testThatAnUnknownServiceHasNoProducts()
$this->assertEmpty(Process::getProcessesSupportingService('UNKNOWN_SERVICE'));
}

public function testThatWarenpostSupportsCertainServices()
public function testThatKleinpaketSupportsCertainServices()
{
$warenpost = Process::build(Process::WARENPOST);
$this->assertTrue($warenpost->supportsGoGreen());
$this->assertTrue($warenpost->supportsPreferredLocation());
$this->assertTrue($warenpost->supportsPreferredNeighbour());
$kleinpaket = Process::build(Process::KLEINPAKET);
$this->assertTrue($kleinpaket->supportsGoGreen());
$this->assertTrue($kleinpaket->supportsPreferredLocation());
$this->assertTrue($kleinpaket->supportsPreferredNeighbour());
}

public function testThatWarenpostDoesNotSupportCertainServices()
public function testThatKleinpaketDoesNotSupportCertainServices()
{
$warenpost = Process::build(Process::WARENPOST);
$this->assertFalse($warenpost->supportsPreferredDay());
$kleinpaket = Process::build(Process::KLEINPAKET);
$this->assertFalse($kleinpaket->supportsPreferredDay());
}
}

0 comments on commit 34b5101

Please sign in to comment.