Support

Home Forums Event Espresso Premium Error with payment transaction – refund

Error with payment transaction – refund

Posted: October 10, 2023 at 12:03 pm


baystate

October 10, 2023 at 12:03 pm

Hello,
I am writing on behalf of Rosemary Cloran, account owner, to get some help resolving an error with our EE plugin. I help with tech stuff. I am pasting the error details we received below my signature.

I confirmed with staff today that they got an error screen (There has been a critical error…) when they attempted to process a refund for a registration when the box to send a msg to the registrant was NOT checked. After the error screen, they went back to the dashboard and processed the refund again and checked the box to send a msg and the refund went through fine.

Can you help us figure out what the error details below mean and how to fix the problem?

APPLICATIONS INFO: EE core 5.0.10, WP 6.3.1, PHP 8.2
NOTE: We recently upgraded WP and PHP and our site theme.

Thanks, Caryn Anderson (tech help)
Bay State Skating School (https://baystateskatingschool.org/)

Error Details
=============
An error of type E_ERROR was caused in line 1156 of the file /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php. Error message: Uncaught TypeError: abs(): Argument #1 ($num) must be of type int|float, string given in /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/admin_pages/transactions/Transactions_Admin_Page.core.php:1851
Stack trace:
#0 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/admin_pages/transactions/Transactions_Admin_Page.core.php(1851): abs(‘$160.00’)
#1 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/admin_pages/transactions/Transactions_Admin_Page.core.php(1601): Transactions_Admin_Page->_create_payment_from_request_data(Array)
#2 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(1149): Transactions_Admin_Page->apply_payments_or_refunds()
#3 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(878): EE_Admin_Page->_route_admin_request()
#4 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(688): EE_Admin_Page->route_admin_request()
#5 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(286): EE_Admin_Page->_page_setup()
#6 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_Init.core.php(472): EE_Admin_Page->initializePage()
#7 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_Init.core.php(315): EE_Admin_Page_Init->_initialize_admin_page()
#8 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_Loader.core.php(185): EE_Admin_Page_Init->do_initial_loads()
#9 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_Loader.core.php(94): EE_Admin_Page_Loader->findAndLoadAdminPages()
#10 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin.core.php(195): EE_Admin_Page_Loader->init()
#11 /nas/content/live/bsss/wp-includes/class-wp-hook.php(310): EE_Admin->init(”)
#12 /nas/content/live/bsss/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(”, Array)
#13 /nas/content/live/bsss/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#14 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/EE_System.core.php(1184): do_action(‘AHEE__EE_System…’)
#15 /nas/content/live/bsss/wp-includes/class-wp-hook.php(310): EE_System->initialize_last(”)
#16 /nas/content/live/bsss/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#17 /nas/content/live/bsss/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#18 /nas/content/live/bsss/wp-settings.php(632): do_action(‘init’)
#19 /nas/content/live/bsss/wp-config.php(132): require_once(‘/nas/content/li…’)
#20 /nas/content/live/bsss/wp-load.php(50): require_once(‘/nas/content/li…’)
#21 /nas/content/live/bsss/wp-admin/admin.php(34): require_once(‘/nas/content/li…’)
#22 {main}

Next RuntimeException: Page route "apply_payments_or_refunds" with the supplied arguments () threw the following exception: abs(): Argument #1 ($num) must be of type int|float, string given in /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php:1156
Stack trace:
#0 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(878): EE_Admin_Page->_route_admin_request()
#1 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(688): EE_Admin_Page->route_admin_request()
#2 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(286): EE_Admin_Page->_page_setup()
#3 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_Init.core.php(472): EE_Admin_Page->initializePage()
#4 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_Init.core.php(315): EE_Admin_Page_Init->_initialize_admin_page()
#5 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_Loader.core.php(185): EE_Admin_Page_Init->do_initial_loads()
#6 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_Loader.core.php(94): EE_Admin_Page_Loader->findAndLoadAdminPages()
#7 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin.core.php(195): EE_Admin_Page_Loader->init()
#8 /nas/content/live/bsss/wp-includes/class-wp-hook.php(310): EE_Admin->init(”)
#9 /nas/content/live/bsss/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(”, Array)
#10 /nas/content/live/bsss/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#11 /nas/content/live/bsss/wp-content/plugins/event-espresso-core-reg/core/EE_System.core.php(1184): do_action(‘AHEE__EE_System…’)
#12 /nas/content/live/bsss/wp-includes/class-wp-hook.php(310): EE_System->initialize_last(”)
#13 /nas/content/live/bsss/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#14 /nas/content/live/bsss/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#15 /nas/content/live/bsss/wp-settings.php(632): do_action(‘init’)
#16 /nas/content/live/bsss/wp-config.php(132): require_once(‘/nas/content/li…’)
#17 /nas/content/live/bsss/wp-load.php(50): require_once(‘/nas/content/li…’)
#18 /nas/content/live/bsss/wp-admin/admin.php(34): require_once(‘/nas/content/li…’)
#19 {main}
thrown


Rio

  • Support Staff

October 10, 2023 at 11:57 pm

Hello,

May we know if you also made some test? Like disabling some plugins and checking for conflict?

You can use https://wordpress.org/plugins/health-check/ or any similar plugin.

You can do the above using Troubleshooting mode:

Tools -> Site Health -> Troubleshooting -> Enabled Troubleshooting mode.

That will disable all plugins and switch to a default theme and then allow you to enable specific plugins for troubleshooting. Once disabled you will revert back to the current state.

May we also know if you had refund before? was it successful? Do you also remember if there was custom code you used for EE?

thanks.


Tony

  • Support Staff

October 11, 2023 at 8:58 am

Hi there,

This is the issue:

abs(‘$160.00’)

When the currency symbol is included there is becomes a ‘string’ (a string of characters) and the abs() function does not accept strings.

When staff are entering/editing the amount within the refund section, make sure they do NOT include the current within the amount field, this section:

https://monosnap.com/file/hMKX3H2D98D7SozFBs8KITkohPscMI

That should prevent that error from happening.

I have created a ticket for use to investigate this further and see if we can strip out any additional characters from the field but the above should work in the meantime.


baystate

October 11, 2023 at 3:00 pm

Thank you so much. I now understand that the “$” is causing the error (thanks for helping extract that from all that code).

I have advised the staff to not include “$”. So we will test again with and without “$” to confirm.

Obviously, it would be great if the EE code stripped extra characters or at least validated entries with a warning that only numbers were accepted before causing a “critical error”. But at least it seems that our data entry behaviors can prevent the issue. Thanks.


Tony

  • Support Staff

October 11, 2023 at 3:20 pm

Obviously, it would be great if the EE code stripped extra characters or at least validated entries with a warning that only numbers were accepted before causing a “critical error”.

Whilst I agree, to explain a little…. as of PHP8, the abs() function will now throw a fatal if passed a tpe num doe not support, so the current code in EE has worked for a long time but now fatals due to a PHP change.

But… we’ll see what we can do here to prevent this in a future update 🙂

The support post ‘Error with payment transaction – refund’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso