Posted: 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: I’ve had my host scan for malware and the site is clean, so it’s not a hack. Thanks, |
|
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. |
|
Hey Josh, [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 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. |
|
This reply has been marked as private. | |
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:
So looks like your server does not list 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? |
|
Hey Tony, |
|
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.
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. |
|
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, |
|
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? |
|
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! |
|
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. |
|
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. |
|
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.