Skip to content

Commit

Permalink
createShipment: packetId -> packetIds
Browse files Browse the repository at this point in the history
  • Loading branch information
radimvaculik committed Oct 27, 2023
1 parent af2ba4d commit e58d50d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
15 changes: 12 additions & 3 deletions src/ApiRest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,22 @@ public function createPacketClaim(ClaimAttributes $attributes): iterable

/**
*
* @param string $packetId
* @param string[] $packetIds
* @param string $customBarcode
* @return iterable<mixed>
*/
public function createShipment(string $packetId, string $customBarcode): iterable
public function createShipment(array $packetIds, string $customBarcode): iterable
{
return $this->callApi(__FUNCTION__, ['packetId' => $packetId, 'customBarcode' => $customBarcode]);
return $this->callApi(
__FUNCTION__,
[
'packetIds' => [
'id' => $packetIds
],
'customBarcode' => $customBarcode,
'offset' => $offset
]
);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/ApiSoap.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ public function createPacketClaim(ClaimAttributes $attributes)


/**
* @param string[] $packetIds
* @return mixed
*/
public function createShipment(string $packetId, string $customBarcode)
public function createShipment(array $packetIds, string $customBarcode)
{
return $this->soap->createShipment($this->apiKey, $packetId, $customBarcode);
return $this->soap->createShipment($this->apiKey, $packetIds, $customBarcode);
}


Expand Down
3 changes: 2 additions & 1 deletion src/IApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ public function createPacket(PacketAttributes $attributes);
public function createPacketClaim(ClaimAttributes $attributes);

/**
* @param string[] $packetIds
* @return mixed
*/
public function createShipment(string $packetId, string $customBarcode);
public function createShipment(array $packetIds, string $customBarcode);

/**
* @return mixed
Expand Down

0 comments on commit e58d50d

Please sign in to comment.