Mark a Magento order as complete programmatically
I'm trying to mark a "Processing" order as Complete when I get a certain response back from a third party service. I've got everything set up for this, but the only problem is that orders are staying in the Processing state. I'm generating an invoice (I don't think I need this though, as each item is marked as "invoiced" in the Magento backend) and a shipment like so: $order = Mage::getModel('sales/order')... (etc) $shipment = $order->prepareShipment($quantities); $shipment->register(); $shipment->setOrder($order); $shipment->save(); $invoice = $order->prepareInvoice($quantities); $invoice-