Skip to content

Commit

Permalink
Better pickuppoint finder
Browse files Browse the repository at this point in the history
  • Loading branch information
ehibes committed Feb 9, 2024
1 parent 8744a87 commit c986753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/Provider/TntProviderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function it_finds_pickup_by_code(
$dropOffPoint->getLongitude()->willReturn('-1.55');


$client->getDropOffPoints('64200', 'Biarritz')->willReturn([
$client->getDropOffPoints('64200', null)->willReturn([
$dropOffPoint
]);
$pickupPointCode = new PickupPointCode('test###64200###Biarritz', 'tnt', 'FR');
Expand Down
4 changes: 2 additions & 2 deletions src/Provider/TntProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public function findPickupPoint(PickupPointCode $code): ?PickupPointInterface
$pickupId = $code->getIdPart();
$data = \explode('###', $pickupId);
Assert::count($data, 3, 'TNT Pickup ID is not correct.');
[$xettCode, $zipcode, $city] = $data;
[$xettCode, $zipcode] = $data;

$result = $this->client->getDropOffPoints($zipcode, $city);
$result = $this->client->getDropOffPoints($zipcode, null);

foreach ($result as $item) {
if ($item->getXETTCode() === $xettCode) {
Expand Down

0 comments on commit c986753

Please sign in to comment.