1: <?php
2:
3: namespace ShippoClient;
4:
5: use ShippoClient\Entity\Tracks as TracksResponse;
6: use ShippoClient\Http\Request;
7:
8: class Tracks
9: {
10: private $request;
11:
12: public function __construct(Request $request)
13: {
14: $this->request = $request;
15: }
16:
17: public function getStandaloneTrack($carrier, $trackingNumber)
18: {
19: $responseArray = $this->request->get("tracks/$carrier/$trackingNumber");
20:
21: return new TracksResponse($responseArray);
22: }
23:
24: public function create($carrier, $trackingNumber, $metadata = null)
25: {
26: $responseArray = $this->request->post('tracks/', [
27: 'carrier' => $carrier,
28: 'tracking_number' => $trackingNumber,
29: 'metadata' => $metadata,
30: ]);
31:
32: return new TracksResponse($responseArray);
33: }
34: }
35: