diff --git a/src/Helper/MyParcelCollection.php b/src/Helper/MyParcelCollection.php index a2984318..805f641c 100644 --- a/src/Helper/MyParcelCollection.php +++ b/src/Helper/MyParcelCollection.php @@ -23,6 +23,7 @@ use MyParcelNL\Sdk\src\Exception\MissingFieldException; use MyParcelNL\Sdk\src\Factory\ConsignmentFactory; use MyParcelNL\Sdk\src\Model\Carrier\CarrierInstabox; +use MyParcelNL\Sdk\src\Model\Carrier\CarrierUPS; use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment; use MyParcelNL\Sdk\src\Model\Consignment\BaseConsignment; use MyParcelNL\Sdk\src\Model\MyParcelRequest; @@ -829,7 +830,7 @@ private function getNewCollectionFromResult($result): self $consignment = ConsignmentFactory::createByCarrierId($shipment['carrier_id'])->setApiKey($apiKey); //TODO: MY-32524 Make AbstractConsignmentAdapter for carrier specific exceptions - if (CarrierInstabox::ID === $shipment['carrier_id']) { + if (CarrierInstabox::ID === $shipment['carrier_id'] || CarrierUPS::ID === $shipment['carrier_id']) { $shipment['barcode'] = $shipment['barcode'] ?: $shipment['external_identifier']; } diff --git a/test/Model/Consignment/UPSConsignmentTest.php b/test/Model/Consignment/UPSConsignmentTest.php index b93bb12f..571bd809 100644 --- a/test/Model/Consignment/UPSConsignmentTest.php +++ b/test/Model/Consignment/UPSConsignmentTest.php @@ -4,7 +4,9 @@ namespace MyParcelNL\Sdk\Test\Model\Consignment; +use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLEuroplus; use MyParcelNL\Sdk\src\Model\Carrier\CarrierUPS; +use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment; use MyParcelNL\Sdk\Test\Bootstrap\ConsignmentTestCase; class UPSConsignmentTest extends ConsignmentTestCase @@ -16,7 +18,7 @@ class UPSConsignmentTest extends ConsignmentTestCase public function provideUPSConsignmentsData(): array { return $this->createConsignmentProviderDataset([ - 'NL -> NL' => $this->getDefaultAddress(), + 'NL -> EU' => [], ]); } @@ -42,9 +44,11 @@ protected function getDefaultConsignmentData(): array parent::getDefaultConsignmentData(), [ self::CARRIER_ID => CarrierUPS::ID, - self::FULL_STREET => 'Meander 631', - self::POSTAL_CODE => '6825ME', - self::CITY => 'Arnhem', + self::PACKAGE_TYPE => AbstractConsignment::PACKAGE_TYPE_PACKAGE, + self::FULL_STREET => 'Feldstrasse 17', + self::POSTAL_CODE => '39394', + self::CITY => 'Schwanebeck', + self::COUNTRY => 'DE', self::PHONE => '123456', ] );