Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal not accepting the FORM in angularjs

I am integrating paypal gateway in my angularjs app. In that I am submitting form with various input field. In that form, I am setting up value of amount dynamically
For example: <input type="hidden" name="amount" value="{{paypal_data.reward_amount}}">
But paypal is not accepting form and displaying following error.

The link you have used to enter the PayPal system contains an incorrectly formatted item amount.

The value is setting to amount successfully. When I use input type= "text" instead of "hidden" then its displaying correct value in textbox but paypal is not accepting form. How to set value dynamically to input with another method so that the form will accept by paypal.

like image 226
Omkar Avatar asked Sep 27 '22 13:09

Omkar


1 Answers

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

setTimeout(function(){ $("#paybtn").click(); },0);
like image 197
Omkar Avatar answered Sep 29 '22 03:09

Omkar