Closed brianyu28 closed 2 years ago
Possibly need Paypal gateway installed and configured - I see Paypal
mentioned in all the reports.
That class WCS_PayPal
should probably not be invoked at all, since WC Pay Subscriptions only supports WC Pay gateway. I'm looking at how to disable it higher up.
Possibly requires Braintree for WooCommerce Payment Gateway
installed and active. (PayPal alternative plugin)
Stack trace:
Error Details
=============
An error of type E_ERROR was caused in line 630 of the file /home1/comingp2/public_html/wp-content/plugins/woocommerce-payments/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/class-wcs-paypal.php. Error message: Uncaught Error: Class 'WC_Subscriptions' not found in /home1/comingp2/public_html/wp-content/plugins/woocommerce-payments/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/class-wcs-paypal.php:630
Stack trace:
#0 /home1/comingp2/public_html/wp-content/plugins/woocommerce-payments/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/abstracts/abstract-wcs-sv-api-base.php(413): WCS_PayPal->get_version()
#1 /home1/comingp2/public_html/wp-content/plugins/woocommerce-payments/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/abstracts/abstract-wcs-sv-api-base.php(323): WCS_SV_API_Base->get_request_user_agent()
#2 /home1/comingp2/public_html/wp-content/plugins/woocommerce-payments/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/abstracts/abstract-wcs-sv-api-base.php(105): WCS_SV_API_Base->get_request_args()
#3 /home1/comingp2/public_html/wp-content/plugins/woocommerce-payments/vendor/woocommerce/subscriptions-core/includes/gateways/paypal
Based on that call stack it looks like this is happening when preparing a request to the PayPal API, in subs-core code. So that's a bug - WC Subscriptions pro is not active, so all subscriptions should use WC Pay (or manual/paused).
Another report in 32333443-hc. SSR posted below. They are on PHP 7.2.34.
Another report in 32333443-hc. SSR posted below. They are on PHP 7.2.34.
When they came back to chat, we walked through installing 3.1, which solved the issue.
Marking this as critical until we confirm how common this is.
Pulling in this comment from the first PR proposal so the context is included here too.
The reason we init PayPal in core is for downgrade reasons. If a WC Subscriptions store previously had PayPal Subscriptions, and they downgrade to WC Payments we need to be able to send the request to cancel those subscriptions at PayPal.
I think the end game for loading PayPal in core is a bit more complex. Something like only load it if there are PayPal Subscriptions left on the site.
So I think to patch this error we can either:
The only reason why I think 2 might be a consideration is because I personally haven't tested the flow of having a PayPal Subscription, downgrading, switching to WC Pay Subscriptions, and confirming that PayPal cancels the old subscription. But I'd generally be in favour of going with 1, just in case - as a safer option.
Original comment: https://github.com/Automattic/woocommerce-subscriptions-core/pull/24#issuecomment-954276478
As reported in 32458900-HC, the user updated to 3.2.1, but WC Pay backend threw an empty screen.
Screenshot: https://d.pr/i/MWJlli Video screencast: https://drive.google.com/file/d/11HAoIT9tv_RwuFF0tok98V8-NafOyVfB/view
They temporarily used version 3.0.0, all working
Fixed in https://github.com/Automattic/woocommerce-payments/pull/3252 (will be released in WooCommerce Payments 3.2.2)
Describe the bug
A few users have reported the error
Uncaught Error: Class 'WC_Subscriptions' not found
coming from/wp-content/plugins/woocommerce-payments/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/class-wcs-paypal.php:630
.https://wordpress.org/support/topic/fatal-php-errors-in-version-3-2-0-php-7-2-34/#post-15016289
My understanding is that
WC_Subscriptions
is not a class defined in subscriptions-core, so references to it in subscriptions-core should be removed.To Reproduce
Haven't yet been able to reproduce.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context