| 1 | <?php |
||
| 4 | class Request |
||
| 5 | { |
||
| 6 | /** |
||
| 7 | * The API url. |
||
| 8 | * |
||
| 9 | * @var string |
||
| 10 | */ |
||
| 11 | protected static $consultURL = 'http://api.axado.com.br/v2/consulta/?token='; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Token for consult quotations. |
||
| 15 | * |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $token; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Constructor. |
||
| 22 | * |
||
| 23 | * @param string $token |
||
| 24 | */ |
||
| 25 | public function __construct(string $token) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Runs the request to Axado API and return a Response Object. |
||
| 32 | * |
||
| 33 | * @param string $jsonString |
||
| 34 | * |
||
| 35 | * @return Response |
||
| 36 | */ |
||
| 37 | public function consultShipping($jsonString): Response |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Request to Axado API. |
||
| 53 | * |
||
| 54 | * @codeCoverageIgnore |
||
| 55 | * |
||
| 56 | * @param string $method |
||
| 57 | * @param string $path |
||
| 58 | * @param string $data |
||
| 59 | * |
||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | protected function doRequest(string $method, string $path, string $data): array |
||
| 89 | } |
||
| 90 |