die("Prepare a config.php file. See: config.php.example"); } include '../config.php'; use AntiMattr\ShipmentTracking\Client\AfterShip\TrackingClient; use AntiMattr\ShipmentTracking\Model\CommonTracking; use Buzz\Client\Curl; // See config.php.example $apiKey = AFTERSHIP_API_KEY; $host = 'https://api.aftership.com'; $path = '/v4'; $buzz = new Curl(); $client = new TrackingClient($apiKey, $host, $path, $buzz); $courier = 'usps'; $number = 'xxxxxx'; $tracking = new CommonTracking(); $tracking->setCourier($courier); $tracking->setNumber($number); $error = ''; $success = ''; if ($_POST) { try { if (!isset($_POST['courier'])) { throw new \Exception("The courier was not submitted"); } if (!isset($_POST['number'])) { throw new \Exception("The tracking number was not submitted"); } $courier = $_POST['courier']; $number = $_POST['number']; $tracking->setCourier($courier); $tracking->setNumber($number);