Conversation
supportMy users are again experiencing an “Invalid payment amount” error. Here is the form export: https://pastebin.com/raw/uPt6mrDt . I updated to Forminator version 1.54.0 and we still have this issue. The current user experiencing this has entered simply 100 in the “Donation” field. It seems that every time I update this software, something breaks.
Hi @elmonty Sorry to hear you are having this issue. I was able to replicate the problem around the issue on my lab site but we also tested on other websites and it isn’t happening. I believe the problem is around the calculation. Could you duplicate the form, remove the paypal field and submit it without the payment field, then go to wp-admin > Forminator > Submissions and locate the submission, check the total value, will it show 103 or 104? ( considering only the donation + super charge 3.5 ). In short, the “(0+0}+100)*((3.5/100)+1)” is 103.5, using round it the front end seems to be rounding to 103 while backend to 104 therefore invalid payment amount. I also escalated this to our second line support team, once we hear back from the second line support team we will let you know. Best Regards Patrick Freitas
Hi @elmonty An update here Could you please let us know if you are using PHP 8.4 or lower versions? The problem seems because a difference between PHP 8.3 to 8.4 when round happens to down vs up ( https://stackoverflow.com/a/79816702 ), if you are using 8.3 or lower, please try updating to PHP 8.4. I understand that front end via JavaScript the calculation seems correct and I also reported it to our second level support, but in the meantime the PHP 8.4 solution would fix the issue. Best Regards Patrick Freitas
Hi @elmonty Sorry to hear you are having this issue. I was able to replicate the problem around the issue on my lab site but we also tested on other websites and it isn’t happening. I believe the problem is around the calculation. Could you duplicate the form, remove the paypal field and submit it without the payment field, then go to wp-admin > Forminator > Submissions and locate the submission, check the total value, will it show 103 or 104? ( considering only the donation + super charge 3.5 ). In short, the “(0+0}+100)*((3.5/100)+1)” is 103.5, using round it the front end seems to be rounding to 103 while backend to 104 therefore invalid payment amount. I also escalated this to our second line support team, once we hear back from the second line support team we will let you know. Best Regards Patrick Freitas
Hi @elmonty An update here Could you please let us know if you are using PHP 8.4 or lower versions? The problem seems because a difference between PHP 8.3 to 8.4 when round happens to down vs up ( https://stackoverflow.com/a/79816702 ), if you are using 8.3 or lower, please try updating to PHP 8.4. I understand that front end via JavaScript the calculation seems correct and I also reported it to our second level support, but in the meantime the PHP 8.4 solution would fix the issue. Best Regards Patrick Freitas