How can a payment module redirect the customer to a payment gateway on the «Place Order» button click?

How does a payment method pass its configuration to the client side (JavaScript)?