How can I show the thank-you page for an order created via code?

@alexmeuer Happy to help.
Order confirmation emails supposed to be sent on live mode