WC_Order_Refund and get_payment_method
-
Hello,
We found a fatal error with the plugin :
AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to undefined method WC_Order_Refund::get_payment_method() in /wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php:848As mentioned here : https://github.com/woocommerce/woocommerce/issues/24531
That is because WC_Order_Refund is an extension of WC_Abstract_Order and not WC_Order where the function is defined.I tried their solution and it seems to be working :
before calling$order->get_payment_method()if ( is_a( $order, 'WC_Order_Refund' ) ) { $order = wc_get_order( $order->get_parent_id() ); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘WC_Order_Refund and get_payment_method’ is closed to new replies.