Whether the PayPal module redirects a customer to the PayPal payment gateway before or after the order has been created?

The right way is to redirect a customer to a payment gateway AFTER the order has been created (like the PayPal module does).