• Resolved sarldsecom

    (@sarldsecom)


    Good morning,

    It seems the plugin is sometimes causing issues with shoppers trying to pay for an order using a saved payment method. Here is the full stack trace. We’d appreciate if someone from the team could have a look, in order to get this part more stable.

    Thanks in advance

    [27-Sep-2024 17:05:20 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_token() on null in /opt/horrifiq/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php:969
    Stack trace:
    #0 /opt/horrifiq/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php(1449): WC_Stripe_UPE_Payment_Gateway->process_payment_with_saved_payment_method()
    #1 /opt/horrifiq/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php(459): WC_Stripe_UPE_Payment_Gateway->retry_after_error()
    #2 /opt/horrifiq/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php(733): WC_Gateway_Stripe->process_payment()
    #3 /opt/horrifiq/public_html/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1062): WC_Stripe_UPE_Payment_Gateway->process_payment()
    #4 /opt/horrifiq/public_html/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1293): WC_Checkout->process_order_payment()
    #5 /opt/horrifiq/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php(1702): WC_Checkout->process_checkout()
    #6 /opt/horrifiq/public_html/wp-includes/class-wp-hook.php(324): WC_Stripe_Payment_Request->ajax_create_order()
    #7 /opt/horrifiq/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #8 /opt/horrifiq/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
    #9 /opt/horrifiq/public_html/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(96): do_action()
    #10 /opt/horrifiq/public_html/wp-includes/class-wp-hook.php(324): WC_AJAX::do_wc_ajax()
    #11 /opt/horrifiq/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #12 /opt/horrifiq/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
    #13 /opt/horrifiq/public_html/wp-includes/template-loader.php(13): do_action()
    #14 /opt/horrifiq/public_html/wp-blog-header.php(19): require_once('/home/816423.cl...')
    #15 /opt/horrifiq/public_html/index.php(17): require('/home/816423.cl...')
    #16 {main}
    thrown in /opt/horrifiq/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php on line 969
Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter sarldsecom

    (@sarldsecom)

    Edit: It seems to have happened at least 4 times today in our store, and we can link these crashes to payments pi_3Q40oOA4E9tWwRaZ0Md0jnYF, pi_3Q40pCA4E9tWwRaZ1484062Q, pi_3Q42uxA4E9tWwRaZ1kSdv8FN and pi_3Q42vmA4E9tWwRaZ1fRFxaSv. This issue seems to mislead shoppers enough to believe their payment failed while it went through, and so, some of them are doing multiple orders inadvertently. There’s a real human and financial impact linked to this bug.

    • This reply was modified 1 year, 8 months ago by sarldsecom.
    Zee

    (@doublezed2)

    Hello sarldsecom,

    Thank you for contacting WooCommerce support.

    I appreciate you for providing the details and the stack trace.
    I understand the impact this issue is having on your customers and your store.

    Is this happening for all orders where customers are using a saved payment method, or is it more sporadic?

    To assist you further, I’d like to gather more information about your setup.
    Could you please send me a copy of your site’s System Status Report?
    You can find it by navigating to WooCommerce > Status, then selecting Get system report and clicking Copy for support.

    Once you have that, please paste the text in your reply using the Code block.
    This will help us diagnose the issue more effectively.

    Best regards.

    Thread Starter sarldsecom

    (@sarldsecom)

    Hi Zubair, hope you’re doing well !

    Actually, I haven’t been able to reproduce the issue myself, even trying to use a saved payment method twice, so I believe the issue is indeed sporadic, and it most likely doesn’t affects all users. I did not had anyone confirming this was coming from the saved payment methods feature, but according to the stack, it most likely is.

    I have sent you the related system report using your contact form on your website just now, hope it helps !

    Regards

    Zee

    (@doublezed2)

    Hello sarldsecom,

    Thank you for the clarification.

    Since we’re unable to consistently reproduce the issue, we’ll need more information to identify the cause.

    I wasn’t able to locate the system status report you sent through the contact form.
    Could you please resend it or upload it to Gist and share the URL with me here?

    Looking forward to your response. 🙂

    Thread Starter sarldsecom

    (@sarldsecom)

    Hi Zubair,

    According to the stack trace, the issue happens when a failed payment is retried (see the call to function retry_after_error()) and for some reason, the $token cannot be retrieved.

    I have went with a temporary solution in horrifiq.com, with this code just aborting the order and setting it as failed if the token is null. Not ideal as we should rather find the root cause on why the token is null in the first place.

    Here is the Woocommerce status report –> report

    Regards

    Zee

    (@doublezed2)

    Hello sarldsecom,

    Thank you for providing more context on the issue.

    It seems that the token retrieval failure is indeed the core problem, and your temporary solution is understandable given the circumstances, though not ideal for a long-term fix.

    To ensure this gets the proper attention and investigation, I recommend opening an issue on our GitHub repository at WooCommerce Stripe Gateway Issues.

    Please include the relevant stack trace and details about your solution. This will allow our development team to review it and help find the root cause of the token issue, as well as provide a fix.

    Best regards.

    Thread Starter sarldsecom

    (@sarldsecom)

    I understand. Our account acct_1H4UDbA4E9tWwRaZ has been closed a few days ago during my vacation because of this bug leading to a spike of chargebacks for “Duplicate” reasons, so I will just create this Github issue -> https://github.com/woocommerce/woocommerce-gateway-stripe/issues/3509

    I’d appreciate if someone from Stripe could help in getting my account back up, after all, that’s because of a bug in the plugin, not because of our business.

    Hi @sarldsecom,

    Sorry to hear that your account was closed due to the said bug. Also, I’d like to thank you for creating the GitHub issue.

    As a next step, I recommend that you contact us at Woo.com > My Account > Support. You may need to create an account before you can access that page.
    Please include a link to this forum thread, so that we can keep track of what’s already been done.

    Looking forward to assisting you further with the issues related to your account.

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

The topic ‘Call to a member function get_token() on null’ is closed to new replies.