Skip to content

Commit

Permalink
MOL-1196: update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalij Mik committed Dec 4, 2023
1 parent 2dbf5af commit 41a0b86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
6 changes: 2 additions & 4 deletions src/Service/TrackingInfoStructFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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));

Expand Down
8 changes: 0 additions & 8 deletions tests/PHPUnit/Service/TrackingInfoStructFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41a0b86

Please sign in to comment.