The online payment methods have a redirect after the order is created.
The user selects the payment method on the payment page. Some payment methods require input. After submitting his order he is redirected to the respective payment provider where he has to authorize his payment. Then he comes back to the shop and the Receipt page is shown.
If the payment fails or is canceled, the user is sent back to the payment page where he can select another payment method. Internally the old order is canceled and a new basket is created, but this is invisible for the customer.