• Resolved patrykbarc

    (@patrykbarc)


    Hi WPDesk Support Team,

    I’m experiencing a critical (fatal) error on my WooCommerce store when using Flexible Subscriptions alongside WooCommerce Payments (WooPayments). The error occurs every time I try to view or edit a subscription order in the WordPress admin panel. Environment

    • WordPress: latest version
    • WooCommerce: 10.5.1
    • Flexible Subscriptions: latest version (free)
    • WooCommerce Payments (WooPayments): latest version
    • PHP: 8.4

    Error Description

    The method WC_Payments_Subscription_Service::is_wcpay_subscription() expects an argument of type WC_Subscription, but receives WPDesk\FlexibleSubscriptions\Subscription\Subscription instead. This causes an uncaught TypeError and crashes the admin order/subscription edit page. Error Log (anonymized)

    Uncaught TypeError: WC_Payments_Subscription_Service::is_wcpay_subscription():
    Argument #1 ($subscription) must be of type WC_Subscription,
    WPDesk\FlexibleSubscriptions\Subscription\Subscription given,
    called in .../wp-content/plugins/woocommerce-payments/includes/subscriptions/class-wc-payments-subscription-service.php on line 703
    and defined in .../wp-content/plugins/woocommerce-payments/includes/subscriptions/class-wc-payments-subscription-service.php:287

    Backtrace (anonymized)

    #0  .../woocommerce-payments/includes/subscriptions/class-wc-payments-subscription-service.php(703):
        WC_Payments_Subscription_Service::is_wcpay_subscription()
    #1  .../wp-includes/class-wp-hook.php(343):
        WC_Payments_Subscription_Service->prevent_wcpay_manual_renewal()
    #2  .../wp-includes/plugin.php(205):
        WP_Hook->apply_filters()
    #3  .../woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php(227):
        apply_filters()
    #4  .../woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php(37):
        WC_Meta_Box_Order_Actions::get_available_order_actions_for_order()
    #5  .../wp-admin/includes/template.php(1453):
        WC_Meta_Box_Order_Actions::output()
    #6  .../woocommerce/src/Internal/Admin/Orders/Edit.php(502):
        do_meta_boxes()
    #7  .../woocommerce/src/Internal/Admin/Orders/Edit.php(410):
        Automattic\WooCommerce\Internal\Admin\Orders\Edit->render_meta_boxes()
    #8  .../woocommerce/src/Internal/Admin/Orders/PageController.php(295):
        Automattic\WooCommerce\Internal\Admin\Orders\Edit->display()

    Steps to Reproduce

    1. Install and activate both Flexible Subscriptions and WooCommerce Payments.
    2. Create a subscription product using Flexible Subscriptions.
    3. Place a test subscription order.
    4. Go to WooCommerce → Orders and try to edit/view the subscription order.
    5. The page crashes with the fatal TypeError shown above.

    Root Cause Analysis

    It appears that WooCommerce Payments hooks into the woocommerce_order_actions filter via its prevent_wcpay_manual_renewal() method (line 703 of class-wc-payments-subscription-service.php). This method calls is_wcpay_subscription(), which has a strict type hint expecting WC_Subscription. However, Flexible Subscriptions passes its own WPDesk\FlexibleSubscriptions\Subscription\Subscription object, which does not extend WC_Subscription, causing the fatal error. Expected Behavior

    Flexible Subscriptions should be compatible with WooCommerce Payments without causing fatal errors. The Subscription object should either extend WC_Subscription or be filtered out before being passed to WooCommerce Payments hooks. Actual Behavior

    A fatal TypeError is thrown, making it impossible to manage subscription orders in the admin panel. Impact

    This is a critical issue — the admin order edit screen is completely broken for any subscription created with Flexible Subscriptions when WooCommerce Payments is active. This blocks day-to-day store management.

    I would appreciate it if you could look into this and provide a fix or a recommended workaround. Thank you for your time.

    Best regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support rzepsen

    (@rzepsen)

    Hi, @patrykbarc

    Thank you for your detailed report and for providing the stack trace — this is very helpful.

    At the moment, Flexible Subscriptions does not support integration with WooCommerce Payments (WooPayments). The error you are experiencing is a result of an architectural incompatibility between the two plugins.

    WooCommerce Payments expects a WC_Subscription object in its internal hooks, while Flexible Subscriptions uses its own WPDesk\FlexibleSubscriptions\Subscription\Subscription class. Since our Subscription class does not extend WC_Subscription, WooPayments’ strict type hinting leads to the fatal TypeError you described.

    I have forwarded this issue to our plugin development team for further analysis. Additionally, I’ve added your email address to the list of customers waiting for WooCommerce Payments integration. If support for WooPayments is added in the future, I will inform you directly.

    For now, as a workaround, I recommend testing Flexible Subscriptions with other payment gateway plugins that are commonly used with subscriptions, especially:

    • Stripe
    • PayPal

    These gateways typically work well with our plugin and do not rely on the WooPayments subscription service layer.

    I understand this is a critical issue affecting your admin workflow, and I appreciate your patience.

    Feel free to contact me if you have more questions.

    Thread Starter patrykbarc

    (@patrykbarc)

    Hi @rzepsen

    Thank you for your quick response.

    I didn’t know that Flexible Subscriptions doesn’t work with WooCommerce, thank you for explaining!

    I will try to use other payment gateways as you recommended.

    I’m keeping my fingers crossed for the WooPayments integration, because your plugin is great.

    Best regards

    Plugin Support rzepsen

    (@rzepsen)

    Hi @patrykbarc

    Thank you for your kind words — we really appreciate your feedback!

    Just to clarify: Flexible Subscriptions is fully integrated with WooCommerce Subscriptions, but it is not currently integrated with WooCommerce Payments (WooPayments). These are two separate systems, and WooPayments uses its own subscription handling layer, which is why the compatibility issue occurs.

    Your plan to test other payment gateways is a very good approach. In particular, Stripe and PayPal usually work well with our plugin.

    I’ve also kept your contact on the list of customers interested in WooPayments integration. If support for WooCommerce Payments is added in the future, I will be sure to inform you.

    Thank you again for your patience and for the positive feedback — it means a lot to us!

    Thread Starter patrykbarc

    (@patrykbarc)

    Hi @rzepsen

    Yes, sorry – I meant WooPayments.

    By the way, I would like to ask if Flexible Subscriptions is compatible with the przelewy24 service?

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.