Make the payment form JS more flexible