Skip to content

Commit fd832d7

Browse files
authored
Update Tracking.php
1 parent a1074b8 commit fd832d7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Tracking.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Tracking extends Auth
1010
{
1111
private TrackingQuery $query;
1212
private ?string $trackingNumber;
13+
private object $apiResponse;
1314

1415
public function __construct()
1516
{
@@ -51,7 +52,7 @@ public function fetch(string $client_id, string $client_secret): array
5152
]);
5253
$httpClient->setUrl($this->_getAPIBaseURL() . "/api/track/v1/details/" . $this->trackingNumber . $queryParams);
5354
$httpClient->setMethod("GET");
54-
$res = $httpClient->fetch();
55+
$this->apiResponse = $res = $httpClient->fetch();
5556

5657
if (!isset($res->trackResponse)) {
5758
if (isset($res->response)) {
@@ -82,4 +83,9 @@ public function setMode(string $mode): self
8283
parent::setMode($mode);
8384
return $this;
8485
}
86+
87+
public function getResponse(): string
88+
{
89+
return json_encode($this->apiResponse);
90+
}
8591
}

0 commit comments

Comments
 (0)