• Resolved pjkozlowskijr

    (@pjkozlowskijr)


    Some of our WooCommerce subscriptions are failing to process renewal payments due to an error being generated by TaxJar. It’s an Uncaught TypeError indicating the $order must be of type WC_Order. I’ve included one of the log entries with the stack trace at the bottom of this message. Based on what I’m seeing, it looks like the argument being passed is the subscription ID, but TaxJar wants the order object.

    What’s weird is that this is only happening to a small fraction of our active subscriptions. Issue started on April 4. Since then, approximately 500 subscriptions have renewed. Of those, only 7 have had this issue. All of the subscriptions in question have successfully renewed multiple times prior to this issue.

    When this happens, WooCommerce places a notice at the top of the dashboard. After confirming that the customer was not charged and no renewal order was generated, I am able to manually process the renewal order successfully without seeing this same error message.

    Here is an entry from the failed-scheduled-actions log. Thank you in advance for any help!

    04-11-2023 @ 20:15:26 - scheduled action 7710413 (subscription payment) failed to finish processing due to the following error: Uncaught TypeError: TaxJar\Order_Tax_Calculation_Validator::__construct(): Argument #1 ($order) must be of type WC_Order, bool given, called in /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/taxjar-simplified-taxes-for-woocommerce/includes/TaxCalculation/class-tax-calculator-builder.php on line 171 and defined in /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/taxjar-simplified-taxes-for-woocommerce/includes/TaxCalculation/class-order-tax-calculation-validator.php:39
    Stack trace:
    #0 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/taxjar-simplified-taxes-for-woocommerce/includes/TaxCalculation/class-tax-calculator-builder.php(171): TaxJar\Order_Tax_Calculation_Validator->__construct(false, Object(WC_Taxjar_Nexus))
    #1 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/taxjar-simplified-taxes-for-woocommerce/includes/TaxCalculation/class-tax-calculator-builder.php(316): TaxJar\Tax_Calculator_Builder->set_order_validator(false)
    #2 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/taxjar-simplified-taxes-for-woocommerce/includes/class-taxjar-tax-calculation.php(245): TaxJar\Tax_Calculator_Builder->build_renewal_order_calculator(false)
    #3 /chroot/local/threechi/3chi.com/wordpress/wp-includes/class-wp-hook.php(308): TaxJar_Tax_Calculation->calculate_renewal_order_totals(false, Object(WC_Subscription), 'renewal_order')
    #4 /chroot/local/threechi/3chi.com/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters(false, Array)
    #5 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/wcs-order-functions.php(227): apply_filters('wcs_new_order_c...', false, Object(WC_Subscription), 'renewal_order')
    #6 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/wcs-renewal-functions.php(29): wcs_create_order_from_subscription(Object(WC_Subscription), 'renewal_order')
    #7 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-manager.php(141): wcs_create_renewal_order(Object(WC_Subscription))
    #8 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-manager.php(114): WC_Subscriptions_Manager::process_renewal(1034166, 'active', 'Subscription re...')
    #9 /chroot/local/threechi/3chi.com/wordpress/wp-includes/class-wp-hook.php(308): WC_Subscriptions_Manager::prepare_renewal(1034166)
    #10 /chroot/local/threechi/3chi.com/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
    #11 /chroot/local/threechi/3chi.com/wordpress/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
    #12 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/woocommerce/packages/action-scheduler/classes/actions/ActionScheduler_Action.php(43): do_action_ref_array('woocommerce_sch...', Array)
    #13 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/woocommerce/packages/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php(65): ActionScheduler_Action->execute()
    #14 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueRunner.php(166): ActionScheduler_Abstract_QueueRunner->process_action(7710413, 'WP Cron')
    #15 /chroot/local/threechi/3chi.com/wordpress/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueRunner.php(136): ActionScheduler_QueueRunner->do_batch(25, 'WP Cron')
    #16 /chroot/local/threechi/3chi.com/wordpress/wp-includes/class-wp-hook.php(308): ActionScheduler_QueueRunner->run('WP Cron')
    #17 /chroot/local/threechi/3chi.com/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
    #18 /chroot/local/threechi/3chi.com/wordpress/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
    #19 /chroot/local/threechi/3chi.com/wordpress/wp-cron.php(188): do_action_ref_array('action_schedule...', Array)
    #20 {main}
      thrown
    04-11-2023 @ 20:15:26 - action args: subscription_id: 1034166

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Subscription renewal failing to process due to TaxJar error’ is closed to new replies.