I fixed this by applying some logic. I used below jQuery code
setTimeout(function(){},100);
I submitted the form, applying some delay using the function.
I think when I used only $("#paybtn").click(); //Automatic Button Click function $("#paybtn").click(); //Automatic Button Click function , it submitted the form before assigning a value to the input. Finally, I used below code that worked successfully with me
setTimeout(function(){ $("#paybtn").click(); },0);
source share