Skip to content

Commit

Permalink
Фикс #19
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaoda committed Aug 23, 2020
1 parent a9018d3 commit f901949
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/Dispatching/Endpoints/Batches/Batches.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,20 @@ public function getOrderById(string $id): Order
}

/**
* @param string $barcode
* @return Order|null
* Поиск заказов по ШПИ или внутреннему номеру во всех партиях.
*
* @param string $query ШПИ или внутренний номер заказа
*
* @see https://otpravka.pochta.ru/specification#/batches-find_orders_with_barcode
*
* @return Order[]|null
*/
public function findOrderByTrackingNumber(string $barcode): ?Order
public function findOrdersInAllBatches(string $query): ?iterable
{
return $this->client->get('/1.0/shipment/search', GenericRequest::create(['query' => $barcode]), Order::class);
return $this->client->get(
'/1.0/shipment/search',
GenericRequest::create(['query' => $query]),
new ArrayOf(Order::class)
);
}
}

0 comments on commit f901949

Please sign in to comment.