function Action_UpdateShipment()
{
    // TODO: I dont know how to trigger this action in shipworks, always say has errors occurred while getting rates.
    // return success
    writeStartTag('UpdateSuccess');
    writeCloseTag('UpdateSuccess');
}
Esempio n. 2
0
function ExecuteOrderCommand($order, $command, $comments, $carrierData, $tracking)
{
    try {
        // to change statuses, we need to unhold if necessary
        if ($order->canUnhold()) {
            $order->unhold();
            $order->save();
        }
        switch (strtolower($command)) {
            case "complete":
                CompleteOrder($order, $comments, $carrierData, $tracking);
                break;
            case "cancel":
                $order->cancel();
                $order->addStatusToHistory($order->getStatus(), $comments);
                $order->save();
                break;
            case "hold":
                $order->hold();
                $order->addStatusToHistory($order->getStatus(), $comments);
                $order->save();
                break;
            default:
                outputError(80, "Unknown order command '{$command}'.");
                break;
        }
        writeStartTag("Debug");
        writeElement("OrderStatus", $order->getStatus());
        writeCloseTag("Debug");
    } catch (Exception $ex) {
        outputError(90, "Error Executing Command. " . $ex->getMessage());
    }
}