Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
171 stars 68 forks source link

Compatibility with YITH Booking and Appointment #7950

Open WillBrubaker opened 7 months ago

WillBrubaker commented 7 months ago

Describe the bug

With Woo Payments version >= 6.9, a fatal error is thrown when it is activated when YITH Booking and Appointment for WooCommerce Premium is active.

7504030-zen

To Reproduce

  1. YITH Booking and Appointment for WooCommerce Premium is an active plugin
  2. Activate Woo Payments
  3. Fatal error occurs

I reckon YITH uses the same product type but doesn't provide this method.

Actual behavior

2023-12-27T01:46:58+00:00 CRITICAL Uncaught Error: Call to undefined method WC_Product_Booking::get_requires_confirmation() in /home3/dinerore/public_html/wp-content/plugins/woocommerce-payments/includes/class-wc-payments-woopay-button-handler.php:652
Stack trace:
#0 /home3/dinerore/public_html/wp-content/plugins/woocommerce-payments/includes/class-wc-payments-woopay-button-handler.php(560): WC_Payments_WooPay_Button_Handler->is_product_supported()
#1 /home3/dinerore/public_html/wp-content/plugins/woocommerce-payments/includes/class-wc-payments-woopay-button-handler.php(154): WC_Payments_WooPay_Button_Handler->should_show_woopay_button()
#2 /home3/dinerore/public_html/wp-includes/class-wp-hook.php(324): WC_Payments_WooPay_Button_Handler->scripts('')
#3 /home3/dinerore/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#4 /home3/dinerore/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /home3/dinerore/public_html/wp-includes/script-loader.php(2262): do_action('wp_enqueue_scri...')
#6 /home3/dinerore/public_html/wp-includes/class-wp-hook.php(324): wp_enqueue_scripts('')
#7 /home3/dinerore/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#8 /home3/dinerore/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#9 /home3/dinerore/public_html/wp-includes/general-template.php(3052): do_action('wp_head')
#10 /home3/dinerore/public_html/wp-content/themes/laundry/header-2.php(8): wp_head()
#11 /home3/dinerore/public_html/wp-includes/template.php(790): require_once('/home3/dinerore...')
#12 /home3/dinerore/public_html/wp-includes/template.php(725): load_template('/home3/dinerore...', true, Array)
#13 /home3/dinerore/public_html/wp-includes/general-template.php(48): locate_template(Array, true, true, Array)
#14 /home3/dinerore/public_html/wp-content/themes/laundry/single.php(1): get_header('2')
#15 /home3/dinerore/public_html/wp-includes/template-loader.php(106): include('/home3/dinerore...')
#16 /home3/dinerore/public_html/wp-blog-header.php(19): require_once('/home3/dinerore...')
#17 /home3/dinerore/public_html/index.php(17): require('/home3/dinerore...')
#18 {main}
  thrown in /home3/dinerore/public_html/wp-content/plugins/woocommerce-payments/includes/class-wc-payments-woopay-button-handler.php on line 652

Screenshots

Expected behavior

To be able to activate Woo Payments

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

csmcneill commented 7 months ago

Flagging this to @hsingyuc since they've been working on WooPay <> Bookings compatibility a bit (see pdpOw2-2d5-p2 and pdpOw2-2sP-p2), which seems to be what this is related to.

cc @pierorocca

hsingyuc commented 7 months ago

Can someone explain to me what's YITH?

csmcneill commented 7 months ago

YITH is an independent seller of WooCommerce-related plugins: https://yithemes.com/

This issue is related to this specific product: https://yithemes.com/themes/plugins/yith-woocommerce-booking/