Paypal does not accept FORM in angularjs

I integrate paypal gateway in my angularjs application. In this, I present a form with a different input field. In this form, I dynamically adjust the quantity. For example: <input type="hidden" name="amount" value="{{paypal_data.reward_amount}}">
But paypal does not take the form and displays the following error.

The link you used to log in to PayPal contains an incorrectly formatted number of elements.

Value sets the value successfully. When I use the input type = "text" instead of "hidden", then its displaying the correct value in the text box, but paypal does not take the form. How to set the value dynamically for input in another way so that the form accepts paypal.

+5
source share
1 answer

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); 
+4
source

Source: https://habr.com/ru/post/1233041/


All Articles