Hi @webmastersimonsinek ,
It seems you’re dealing with an IP issue related to the Stripe Gateway plugin. Also, thanks for sharing a screenshot and the versions of WooCommerce and the Stripe extension.
Just a heads-up, the latest versions are WooCommerce 9.4.1 and Stripe 8.9.0, so you might want to consider updating them. (Just make sure to back up your site first for safety)
“Payment failed: Invalid IP address. Order status changed from Pending payment to Failed.”
To give more details about the error message: The “Payment failed: Invalid IP address” suggests that during the checkout process, Stripe tried to process a payment but encountered an issue with the IP address from which the request was being made. Here’s what might have happened specifically:
- Stripe expects a valid customer IP to be sent along with the payment request for security and fraud prevention reasons.
- If your server sends an IP address that doesn’t follow the standard format or sends an internal IP address (like one that starts with 192.168., 10., or 172.16.), Stripe rejects the transaction as it appears to be coming from an invalid source.
- The payment cannot be processed without a valid IP, so the order automatically gets marked as failed in your WooCommerce system.
The fix typically involves checking server settings to make sure the correct IP is passed to Stripe. This means:
- Ensuring server configuration allows for passing along the proper IP address.
- If you have security plugins or firewalls, checking that they’re not altering or masking the IP address in a way that Stripe doesn’t accept.
If there are no issues with the security plugins you have installed, I would suggest checking with your hosting provider to ensure that your server’s IP address is correct and not being blocked. They could also help identify and resolve the issue by checking the server configuration.
Please keep us posted on your progress.
This is solved after the latest update.
We are having the same issue
invalid_request_error – mandate_data[customer_acceptance][online][ip_address]
Invalid IP address.
I updated woocommerce and stripe plugin with same issue (WC_Geolocation::get_ip_address() returns empty)
I made it to work by adding unset($_SERVER[‘HTTP_X_FORWARDED_FOR’]); in wp-config
it seems that get_ip_address will check if they are set which is always true and should also check if they are empty because nginx will forward ‘HTTP_X_FORWARDED_FOR’ as empty and the ip is in REMOTE_ADDR
Hi @n-for-all
I understand that you have a somewhat similar problem.
However, per forum best practices shown here, it is advised that you create a new thread so that we can address your issue(s) separately.
You can create a new thread here: https://wordpress.org/support/plugin/woocommerce/#new-topic-0 and make sure to include as much information as you can.
Thanks for understanding!