PayPal Error! Invalid payment amount
-
PayPal Error! Invalid payment amount.
I have this error, apparently it is a problem with the decimals. Paypal only receives 2 decimal places.
If I send the “Currency” field there is no problem. The problem starts when I perform a tax calculation. I create another calculation field called “Paypal Commission”, in this calculation field I multiply “Money” by 0.055.
I create another calculation field called “Total to pay”, in this field I add Currency + Paypal Commission.In the “PayPal” box I select the variable payment “Total to pay”.
This is when I get the problem, apparently the Paypal API is receiving more than 3 decimal places and it returns the error “Invalid payment amount”
-
Hi @ludwigpc,
Our team is already aware of this issue and is working on a fix. In the meanwhile, could you please try the following snippet and see whether it helps?
https://gist.github.com/wpmudev-sls/1b475f7988dad6400213a7edc1ad289f
You can try the above snippet as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
https://premium.wpmudev.org/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-pluginsKind Regards,
NithinThank you very much for the reply.
I just implemented the code in mu-plugins but it still hasn’t solved the error.
Do I need Forminator PRO for it to work?
Hi @ludwigpc,
It should have worked for the Free version too. Could you please share the form export and provide steps to replicate it so that we could further investigate what might be causing it?
Please check the following doc on how to export a form:
https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-exportYou can share the export file via Google Drive, Dropbox or any such cloud services in the next reply so that we could check further.
Looking forward to your response.
Kind Regards,
Nithin`{“type”:”form”,”data”:{“fields”:[{“id”:”name-1″,”element_id”:”name-1″,”form_id”:”wrapper-6578-3017″,”type”:”name”,”options”:[],”cols”:12,”conditions”:[],”wrapper_id”:”wrapper-6578-3017″,”field_label”:”Nombre y Apellido”,”placeholder”:”Nombre y apellido”,”prefix_label”:”Prefijo”,”fname_label”:”Nombre”,”fname_placeholder”:”E.g. John”,”mname_label”:”Segundo nombre”,”mname_placeholder”:”E.g. Smith”,”lname_label”:”Apellidos”,”lname_placeholder”:”E.g. Doe”,”prefix”:”true”,”fname”:”true”,”mname”:”true”,”lname”:”true”,”required_message”:”El nombre es obligatorio.”,”prefix_required_message”:”El prefijo es obligatorio”,”fname_required_message”:”El primer nombre es obligatorio.”,”mname_required_message”:”El segundo nombre es obligatorio.”,”lname_required_message”:”El apellido es obligatorio.”,”required”:true},{“id”:”date-1″,”element_id”:”date-1″,”form_id”:”wrapper-2026-2577″,”type”:”date”,”options”:[],”cols”:12,”conditions”:[{“element_id”:”name-1″,”rule”:”is”,”value”:”fecha”}],”wrapper_id”:”wrapper-2026-2577″,”field_type”:”picker”,”date_format”:”yy/mm/dd”,”default_date”:”today”,”field_label”:”Fecha”,”placeholder”:””,”icon”:”true”,”day_label”:”Día”,”day_placeholder”:”E.g. 01″,”month_label”:”Mes”,”month_placeholder”:”E.g. 01″,”year_label”:”Año”,”year_placeholder”:”E.g. 2000″,”restrict_message”:”Por favor, elige una de las fechas disponibles.”,”required”:true,”condition_action”:”show”,”condition_rule”:”any”},{“id”:”text-1″,”element_id”:”text-1″,”form_id”:”wrapper-3865-6634″,”type”:”text”,”options”:[],”cols”:12,”conditions”:[],”wrapper_id”:”wrapper-3865-6634″,”input_type”:”line”,”limit_type”:”characters”,”field_label”:”Producto/servicio”,”placeholder”:”Producto/servicio”,”required”:true},{“id”:”address-1″,”element_id”:”address-1″,”form_id”:”wrapper-7321-2874″,”type”:”address”,”options”:[],”cols”:12,”conditions”:[],”wrapper_id”:”wrapper-7321-2874″,”street_address”:false,”address_city”:”true”,”address_state”:false,”address_zip”:false,”address_country”:”true”,”address_line”:false,”street_address_label”:”Dirección”,”street_address_placeholder”:”E.g. 42 Wallaby Way”,”address_city_label”:”Ciudad”,”address_city_placeholder”:”E.g. Sydney”,”address_state_label”:”Estado/Provincia”,”address_state_placeholder”:”E.g. New South Wales”,”address_zip_label”:”Código postal”,”address_zip_placeholder”:”E.g. 2000″,”address_country_label”:”País”,”address_line_label”:”Apartamento, habitación, etc.”,”street_address_required_message”:”Este campo es obligatorio. Por favor, introduce la dirección.”,”address_zip_required_message”:”Este campo es obligatorio. Por favor, introduce el código postal.”,”address_country_required_message”:”Este campo es obligatorio. Introduce el país.”,”address_city_required_message”:”Este campo es obligatorio. Por favor, introduce la ciudad.”,”address_state_required_message”:”Este campo es obligatorio. Por favor, ingresa el estado.”,”address_line_required_message”:”Este campo es obligatorio. Introduce la línea de dirección.”,”address_city_required”:true,”address_country_prefill”:”ec”},{“id”:”email-1″,”element_id”:”email-1″,”form_id”:”wrapper-9685-2678″,”type”:”email”,”options”:[],”cols”:12,”conditions”:[],”wrapper_id”:”wrapper-9685-2678″,”validation”:false,”placeholder”:”Email”,”field_label”:”Email”,”required”:true},{“id”:”currency-1″,”element_id”:”currency-1″,”form_id”:”wrapper-4116-2588″,”type”:”currency”,”options”:[],”cols”:12,”conditions”:[],”wrapper_id”:”wrapper-4116-2588″,”calculations”:”true”,”limit_min”:”1″,”limit_max”:””,”currency”:”USD”,”field_label”:”MONTO A PAGAR”,”placeholder”:”MONTO A PAGAR”,”limit_message”:”true”,”limit_min_message”:”El monto mínimo a pagar es 20 USD”,”required”:true,”default_value”:”Pago mínimo 20 USD”},{“id”:”paypal-1″,”element_id”:”paypal-1″,”form_id”:”wrapper-8079-212″,”type”:”paypal”,”options”:[],”cols”:12,”conditions”:[],”wrapper_id”:”wrapper-8079-212″,”mode”:”live”,”currency”:”USD”,”amount_type”:”variable”,”label”:”checkout”,”color”:”gold”,”shape”:”rect”,”layout”:”vertical”,”tagline”:”true”,”locale”:”es_EC”,”debug_mode”:”disable”,”height”:”40″,”amount”:”1″,”variable”:”calculation-2″,”jcb”:true,”elo”:true,”hiper”:true},{“id”:”calculation-1″,”element_id”:”calculation-1″,”form_id”:”wrapper-1492-7524″,”type”:”calculation”,”options”:[],”cols”:12,”conditions”:[{“element_id”:”calculation-2″,”rule”:”is_great”,”value”:”0″}],”wrapper_id”:”wrapper-1492-7524″,”field_label”:”Comisión PayPal”,”formula”:”{currency-1}*0.055″,”condition_rule”:”any”,”condition_action”:”show”},{“id”:”calculation-2″,”element_id”:”calculation-2″,”form_id”:”wrapper-274-1957″,”type”:”calculation”,”options”:[],”cols”:12,”conditions”:[],”wrapper_id”:”wrapper-274-1957″,”field_label”:”PAGO TOTAL”,”hidden”:true,”formula”:”{currency-1}+{calculation-1}”},{“id”:”gdprcheckbox-1″,”element_id”:”gdprcheckbox-1″,”form_id”:”wrapper-6466-2323″,”type”:”gdprcheckbox”,”options”:[],”cols”:12,”conditions”:[],”wrapper_id”:”wrapper-6466-2323″,”required”:”true”,”field_label”:”GDPR”,”gdpr_description”:”<p>Confirmo que escribí bien mi correo electrónico donde me llegará la factura.</p>”,”required_message”:”Este campo es obligatorio. Por favor, compruebalo.”}],”settings”:{“pagination-header”:”nav”,”paginationData”:{“pagination-header-design”:”show”,”pagination-header”:”nav”},”formName”:”Botón de pago”,”version”:”1.14.11″,”form-border-style”:”none”,”form-padding”:””,”form-border”:””,”fields-style”:”open”,”validation”:”on_submit”,”form-style”:”material”,”enable-ajax”:”true”,”autoclose”:””,”submission-indicator”:”show”,”indicator-label”:”Enviando…”,”form-type”:”default”,”submission-behaviour”:”behaviour-hide”,”thankyou-message”:”<p>Pago exitoso, revisa tu email o carpeta de SPAM.</p>”,”submitData”:{“custom-submit-text”:”Enviar mensaje”,”custom-invalid-form-message”:”Error: tu formulario no es válido, ¡por favor, corrige los errores!”},”validation-inline”:”1″,”form-expire”:”no_expire”,”form-padding-top”:”0″,”form-padding-right”:”0″,”form-padding-bottom”:”0″,”form-padding-left”:”0″,”form-border-width”:”0″,”form-border-radius”:”0″,”cform-label-font-family”:”Roboto”,”cform-label-custom-family”:””,”cform-label-font-size”:”12″,”cform-label-font-weight”:”bold”,”cform-title-font-family”:”Roboto”,”cform-title-custom-family”:””,”cform-title-font-size”:”45″,”cform-title-font-weight”:”normal”,”cform-title-text-align”:”left”,”cform-subtitle-font-family”:”Roboto”,”cform-subtitle-custom-font”:””,”cform-subtitle-font-size”:”18″,”cform-subtitle-font-weight”:”normal”,”cform-subtitle-text-align”:”left”,”cform-input-font-family”:”Roboto”,”cform-input-custom-font”:””,”cform-input-font-size”:”16″,”cform-input-font-weight”:”normal”,”cform-radio-font-family”:”Roboto”,”cform-radio-custom-font”:””,”cform-radio-font-size”:”14″,”cform-radio-font-weight”:”normal”,”cform-select-font-family”:”Roboto”,”cform-select-custom-family”:””,”cform-select-font-size”:”16″,”cform-select-font-weight”:”normal”,”cform-multiselect-font-family”:”Roboto”,”cform-multiselect-custom-font”:””,”cform-multiselect-font-size”:”16″,”cform-multiselect-font-weight”:”normal”,”cform-dropdown-font-family”:”Roboto”,”cform-dropdown-custom-font”:””,”cform-dropdown-font-size”:”16″,”cform-dropdown-font-weight”:”normal”,”cform-calendar-font-family”:”Roboto”,”cform-calendar-custom-font”:””,”cform-calendar-font-size”:”13″,”cform-calendar-font-weight”:”normal”,”cform-button-font-family”:”Roboto”,”cform-button-custom-font”:””,”cform-button-font-size”:”14″,”cform-button-font-weight”:”500″,”cform-timeline-font-family”:”Roboto”,”cform-timeline-custom-font”:””,”cform-timeline-font-size”:”12″,”cform-timeline-font-weight”:”normal”,”cform-pagination-font-family”:””,”cform-pagination-custom-font”:””,”cform-pagination-font-size”:”16″,”cform-pagination-font-weight”:”normal”,”payment_require_ssl”:””,”submission-file”:”delete”,”form_name”:”boton-de-pago”,”form_status”:”publish”},”client_id”:null,”notifications”:[{“slug”:”notification-1234-4567″,”label”:”Admin Email”,”email-recipients”:”default”,”recipients”:”[email protected],[email protected]”,”email-subject”:”💵 Recibiste un pago de GSMSERVERECUADOR S.A.S.”,”email-editor”:”<p>Recibiste un pago por un valor de {currency-1}USD :</p>\n<p>Dirección IP: {user_ip}</p>\n<p>A continuación encontrarás los datos del cliente y adjunto el comprobante de respaldo:<br />{all_fields} <br />—<br />este mensaje fue enviado desde {site_url}.</p>\n<p>[e2pdf-attachment id=\”1\”]</p>”,”email-attachment”:”true”,”conditions”:[]},{“slug”:”notification-2595-8596″,”label”:”Confirmación cliente”,”email-subject”:”💵 PAGO RECIBIDO – GSMSERVERECUADOR S.A.S.”,”email-editor”:”<p>Estimado/a {name-1}, </p>\n<p>Acabamos de confirmar su pago por un valor de {currency-1} USD, adjuntamos su comprobante de respaldo. </p>\n<p>Fecha de pago: {date_dmy} | {date-1}</p>\n<p>País: {address-1-country}</p>\n<p>Producto: {text-1}</p>\n<p>Valor pagado: {currency-1}USD</p>\n<p> </p>\n<p>Mensaje enviado desde GSMSERVERECUADOR S.A.S.</p>\n<p>https://ecuadorgsmserver.com</p>\n<p>[e2pdf-attachment id=\”1\”]</p>”,”recipients”:”{email-1}”,”conditions”:[]}]},”status”:”publish”,”version”:”1.14.11″}
Here I send the form code » https://1drv.ms/t/s!Avss4jQX9VwpgZR2xCnrPQ_kHOPf9w?e=ZdKQBi
Hi @ludwigpc
Thank you for the form.
I was able to replicate using it and sent to our developers to double check the code.
We will keep you posted once our developers check it.
Best Regards
Patrick FreitasHi @ludwigpc
Can you please try to import this form?
The issue is related to calculations conditionals, the calc field 1 related to calc field 2 But Calc field 2 has a formula related to calc 1:
{currency-1}+{calculation-1}So our developer updated the rule to use the currency field instead which fixed the problem.
Let us know if it is working for you now.
Best Regards
Patrick FreitasThank you very much for your excellent technical support. Now it works very well.
Hi @ludwigpc
You are welcome.
We are marking this ticket as resolved, feel free to ping us any time you need.
Best Regards
Patrick Freitas
The topic ‘PayPal Error! Invalid payment amount’ is closed to new replies.