Add ensure order function to checkout controller