From 41a0b862e6a0f3afe2108d08222ad1f82db60c6e Mon Sep 17 00:00:00 2001 From: Vitalij Mik Date: Fri, 1 Dec 2023 13:31:31 +0100 Subject: [PATCH] MOL-1196: update comment --- src/Service/TrackingInfoStructFactory.php | 6 ++---- tests/PHPUnit/Service/TrackingInfoStructFactoryTest.php | 8 -------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Service/TrackingInfoStructFactory.php b/src/Service/TrackingInfoStructFactory.php index e7d732a48..218808c20 100644 --- a/src/Service/TrackingInfoStructFactory.php +++ b/src/Service/TrackingInfoStructFactory.php @@ -21,7 +21,8 @@ public function createFromDelivery(OrderDeliveryEntity $orderDeliveryEntity):?Sh return null; } /** - * mollie accepts only one tracking struct with code per shippment + * Currently we create one shipping in mollie for one order. one shipping object can have only one tracking code. + * When we have multiple Tracking Codes, we do not know which tracking code we should send to mollie. So we just dont send any tracking information at all * * https://docs.mollie.com/reference/v2/shipments-api/create-shipment */ @@ -46,9 +47,6 @@ public function create(string $trackingCarrier, string $trackingCode, string $tr throw new \InvalidArgumentException('Missing Argument for Tracking Code!'); } - if (strpos($trackingUrl, '%s') === false) { - throw new \InvalidArgumentException('Missing %s as code placeholder in Tracking URL'); - } $trackingUrl = trim(sprintf($trackingUrl, $trackingCode)); diff --git a/tests/PHPUnit/Service/TrackingInfoStructFactoryTest.php b/tests/PHPUnit/Service/TrackingInfoStructFactoryTest.php index 5ff22ff39..7524a62c0 100644 --- a/tests/PHPUnit/Service/TrackingInfoStructFactoryTest.php +++ b/tests/PHPUnit/Service/TrackingInfoStructFactoryTest.php @@ -83,14 +83,6 @@ public function testInfoStructCreatedByArguments(): void } - public function testExceptionIsThrownWithoutPlaceholderInUrl(): void - { - $this->expectException(\InvalidArgumentException::class); - $trackingInfoStruct = $this->factory->create('Test', 'testCode', 'https://test.foo?code'); - - $this->assertNull($trackingInfoStruct); - } - /** * @dataProvider invalidCodes * @param string $url