• Resolved David Tolnem

    (@tolnem)


    I’m not sure how the customer got into this state, but we had a situation today where WC_QuickPay_Subscription::cart_contains_failed_renewal_order_payment() returned true on line 351 in classes/woocommerce-quickpay-order.php (inside the method get_order_number_for_api), but WC_QuickPay_Subscription::get_subscriptions_for_renewal_order() returned false, because the array of subscriptions was empty. This caused a fatal error on line 354.

    I’ve solved this locally by turning the line
    $order_number .= sprintf( '-%d', $subscription->get_failed_payment_count() );
    into

    
    if ( $subscription ) {
    	$order_number .= sprintf( '-%d', $subscription->get_failed_payment_count() );
    }
    else {
    	$order_number .= sprintf( '-%d', time() );
    }
    

    I’m hoping you’ll be able to add this or something similar to a future release.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Fatal error when renewing subscription’ is closed to new replies.