Support

Home Forums Event Espresso Premium Stripe deactivated

Stripe deactivated

Posted: March 18, 2021 at 1:37 pm


socialsparkmedia

March 18, 2021 at 1:37 pm

My site stopped processing registrations a day or so ago. I logged in today and I see several unusual messages:
The payment method Stripe was automatically deactivated because it appears its associated Event Espresso Addon was recently deactivated.
It can be reactivated on the Plugins admin page, then you can reactivate the payment method.

Except the plugin was not deactivated, although the payment method within EE was, so there was no payment method selected at all. That was an easy fix, but why did it happen?
Second, I got this message:
A new State named “North Carolina (NC)” was dynamically added from an Event Espresso form for the Country of “Åland Islands”.
To verify, edit, and/or delete this new State, please go to the Event Espresso – General Settings > Countries Tab and update the States / Provinces section.
Check “Yes” to have this new State added to dropdown select lists in forms.

The same message is duplicated for North Carolina added to United States and South Carolina added to United States. Now there are 3 of each of those two states listed in the settings. Should I delete the extras? Why did this happen?

I’ve had my host scan for malware and the site is clean, so it’s not a hack.

Thanks,
Fran


Josh

  • Support Staff

March 18, 2021 at 4:51 pm

Hi Fran,

The Stripe payment method being deactivated would have happened if the Stripe add-on wasn’t activated even for a short time. You could check the server’s logs to see if there were any errors between now & the time it was last known to be activated.

The “new” states are the result of user input. On the Event Espresso registration form, there’s a small form for adding states/provinces/countries that aren’t included in the dropdown list. It’s safe to delete any extras.


socialsparkmedia

March 19, 2021 at 3:39 pm

Hey Josh,
All of the server logs say Zero bytes, however, I did find this in the PHP error log:

[15-Mar-2021 18:36:38 UTC] PHP Warning: php_uname() has been disabled for security reasons in /www/wp-content/plugins/eea-stripe-gateway/includes/stripe-php-6.35.1/lib/ApiRequestor.php on line 293
[15-Mar-2021 18:39:10 UTC] PHP Warning: php_uname() has been disabled for security reasons in /www/wp-content/plugins/eea-stripe-gateway/includes/stripe-php-6.35.1/lib/ApiRequestor.php on line 293

I’m afraid this is going to happen again. There’s no telling how many registrations I lost because of this.

Thanks for your help.
Fran


socialsparkmedia

March 19, 2021 at 3:47 pm

This reply has been marked as private.


Tony

  • Support Staff

March 23, 2021 at 6:18 am

Hi Fran,

The error mentioned wouldn’t de-activate the payment method. That’s used to send some details of the server over to Stripe when sending a request, however, the library already checks if the function has been disabled using:

$uname_disabled = in_array('php_uname', explode(',', ini_get('disable_functions')), true);
$uname = $uname_disabled ? '(disabled)' : php_uname();

So looks like your server does not list php_uname() in disabled functions, but does actually have it disabled meaning when it runs the above warning is thrown.

The check for this runs within EE4 core, and it basically grabs all of the directories registered as payment methods, loops over them and checks for any that are set as active and confirms they are available. I can’t think of any reason for a registered payment method to not show in the list used.

Is Stripe the only payment method enabled on your site?


socialsparkmedia

March 23, 2021 at 11:29 am

Hey Tony,
Most of what you said is over my head. But to answer your question, Stripe is the only payment method enabled on my site. When I encountered the problem the message in my dashboard said that the EE Stripe Gateway plugin had been deactivated, but that was not true, it was still activated. What I figured out was that there were no payment methods connected in EE, so I had to go in and reconnect Stripe and then everything was fine.


Tony

  • Support Staff

March 24, 2021 at 5:48 am

In short, the error from php_uname() means your host has disabled it so it can’t run, the Stripe add-on is still trying to run it even though it checks to see if it has been disabled prior to doing so as its not listed as disabled on your server.

That error isn’t causing the problem you reported here, for now, you can ignore it.

When I encountered the problem the message in my dashboard said that the EE Stripe Gateway plugin had been deactivated, but that was not true, it was still activated.

Ok, so just to give some idea of what happens, each time EE wants to load the payment methods it does something like this:

1. Grab all the payment methods available in ‘core’ (the EE4 plugin itself).

2. Fires a ‘hook’ to allow any additional add-ons to jump in and let EE know there are other payment methods available than just what is in the ‘core’.

3. Loops over all of the payment methods set to be active in the settings and checks that the active ones are available from the above 2 steps.

4. If it finds any ‘active’ payment methods in the settings that are not available from #2 then as far as EE knows, the add-on for it has been de-activated but was left active in settings so it deactivates it in the settings (can’t use a payment method if it’s not available) and shows that notice.

5. Loops over the active payment methods still showing after #5 and displays them.

So the above happening on your site means at some point a request was made but the Stripe add-on didn’t jump in at #2 and inject itself into the process so EE set it to no longer be active (the payment methods in Event Espresso -> Payment methods, not the Stripe add-on/plugin itself).

I can’t reproduce this on any of my test sites when doing various weird and wonderful things with the requests to try and get something to happen. The (kinda) unfortunate part is that the above process is working as expected for 99% of your requests otherwise your Stripe payment method wouldn’t be available, that’s great as its working but also means its really tough to troubleshoot as I don’t know how to reproduce.

Right now I think the only thing we could do is add some additional code on the site to log when a payment method is de-activated and add some details of what request caused that to happen to a log file. That way if it happens again we can look over the log and see if it gives any clues on why it happened.


socialsparkmedia

March 26, 2021 at 2:40 pm

Right now I think the only thing we could do is add some additional code on the site to log when a payment method is de-activated and add some details of what request caused that to happen to a log file. That way if it happens again we can look over the log and see if it gives any clues on why it happened.”

Yes, I’d like to do that. What’s most important to me though, is to be notified if this happens again so that I can quickly fix it. Can you incorporate that kind of notification into the code you’re talking about?

Thanks for your help,
Fran


Tony

  • Support Staff

March 31, 2021 at 7:03 am

Hi Fran,

If you want an email any time this happens I can just include the details we need within that email rather than logging to the server.

Something like this: https://gist.github.com/Pebblo/12979a1194031534d3af5b8eefd045e0

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

I can send you a zip file with the above function already in a plugin if needed?


socialsparkmedia

March 31, 2021 at 7:30 am

Yes, if you could send the plugin that would be great. I know creating it is well documented, but it will still take me awhile to figure it out!
Thanks so much, Tony!


Tony

  • Support Staff

March 31, 2021 at 7:59 am

You’re most welcome, I’ve sent that over via email.

I added some details on how to test this in the email, then realized if anyone else is following they should also do this, so adding them here:

Once you’ve added the above I recommend you test to confirm the email sends (sometimes email is a little finicky)

To do this without interrupting your events much, what I would do is download another payment method and install that, then deactivate it to trigger the email.

So for example, download the Sage Pay Payment Gateway from your account. Install it, activate it.

In another tab go to Event Espresso -> Payment methods. Sage pay should now show.

Activate that payment method (you don’t need to add settings, just click on it and enable it)

Back in the other tab with the plugin list open, de-activate the SagePay payment method add-on you just installed.

Switch back to the other tab again and refresh the payment methods, you should see a notice showing the payment method de-activated and then you should receive an email.

It has some additional details to help track down what caused the deactivation but the subject should be ‘EE Payment method deactivated’ and the first line should show which payment method.

If that all worked fine, delete the SagePay payment method add-on.


socialsparkmedia

March 31, 2021 at 8:43 am

Worked like a charm! Thank you so much, Tony. My client will feel better knowing that we’ll be notified immediately should something like this happen again.


Tony

  • Support Staff

March 31, 2021 at 8:47 am

You’re most welcome.

Hopefully, you won’t need it and whatever caused the above doesn’t happen again.

The support post ‘Stripe deactivated’ 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