Exemplo n.º 1
0
if (!$order || (int) $orderRepLsm->getResponseStatus() != 200) {
    Util::getTemplate('500.php');
    return;
}
//update the tracking number
$order->trackingNumber = "1z555555555";
//parse entry
if (isset($_REQUEST['entry'])) {
    $entry = ApiLinks::decodeHateoasLink($_REQUEST['entry']);
} else {
    $entry = LSM_API_ENDPOINT . "order/ship";
}
//ensure we have a request to create
$lsm = new LsmCurl();
$lsm->setEndpoint($entry);
$lsm->usePost();
//send the request
$lsm->setParameters($order);
$lsm->sendRequest();
$response = $lsm->getResponseContent();
$status = (int) $lsm->getResponseStatus();
if (!$response || $status < 200 || $status > 204 || @(!$response->isSuccess)) {
    Util::getTemplate('500.php');
    return;
}
Util::getHeader();
if (DEBUG_API_CALLS) {
    echo "<pre class='debug'>";
    var_dump($response);
    echo "</pre>";
}