File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments