如何使用if else语句更改此jquery函数

I need to change this code to if else statement, because when else statement comes true it need to redirect to the PHP section.

I don't know how to write else statement for connecting that PHP section.

This is for a payment gateway.

$("#userInput").validate({
  rules: {
    btn_refund: "required"
  },
  messages: {
    btn_refund: "Customer id cannot be empty"
  }
});