Forgot a method and renew crashes
-
You have forgotten to write a method with name get_renew_order_id in the class YWSBS_Subscription …
I found it out when, I got below fatal error:
[22-Nov-2023 11:07:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined method YWSBS_Subscription::get_renew_order_id() in /home4/uxrbttmy/public_html/www/wp-content/plugins/yith-woocommerce-subscription/includes/gateways/paypal/includes/class.ywsbs-paypal-ipn-handler.php:300 Stack trace: #0 /home4/uxrbttmy/public_html/www/wp-content/plugins/yith-woocommerce-subscription/includes/gateways/paypal/includes/class.ywsbs-paypal-ipn-handler.php(160): YWSBS_PayPal_IPN_Handler->paypal_ipn_request(Array) #1 /home4/uxrbttmy/public_html/www/wp-content/plugins/yith-woocommerce-subscription/includes/gateways/paypal/includes/class.ywsbs-paypal-ipn-handler.php(85): YWSBS_PayPal_IPN_Handler->process_paypal_request(Object(Automattic\WooCommerce\Admin\Overrides\Order), Array) #2 /home4/uxrbttmy/public_html/www/wp-includes/class-wp-hook.php(324): YWSBS_PayPal_IPN_Handler->valid_response(Array) #3 /home4/uxrbttmy/public_html/renewal.fashionexpr in /home4/uxrbttmy/public_html/www/wp-content/plugins/yith-woocommerce-subscription/includes/gateways/paypal/includes/class.ywsbs-paypal-ipn-handler.php on line 300
I have written the method in class YWSBS_Subscription as follow to fix the problem:
public function get_renew_order_id(){ $renew_order = $this->get( 'renew_order' ); return is_object($renew_order) && method_exists($renew_order, 'get_id') ? $renew_order->get_id() : (int)$renew_order; }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Forgot a method and renew crashes’ is closed to new replies.