Port process_order to PDO