• Resolved macksix

    (@macksix)


    With the Stripe Gateway plugin enabled, if I try to view an order receipt using an invalid order number with a valid key like this:

    https://example.com/checkout/order-pay/899/?key=wc_order_xSaL2oqfnfRYU

    a PHP Fatal error is thrown.

    [01-Jun-2024 09:02:20 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_total() on false in /home/example/example.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-method.php:596
    Stack trace: 0 /home/example/example.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-method.php(611): WC_Stripe_UPE_Payment_Method->get_current_order_amount() 1 /home/example/example.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-method.php(249): WC_Stripe_UPE_Payment_Method->is_inside_currency_limits(‘USD’) 2 /home/example/example.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-method.php(174): WC_Stripe_UPE_Payment_Method->is_enabled_at_checkout() 3 /home/example/example.com/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(324): WC_Stripe_UPE_Payment_Method->is_available() 4 /home/example/example.com/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php(587): WC_Payment_Gateways->get_available_payment_gateways() 5 /home/example/example.com/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php(315): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->render_button_wrapper_registrar() 6 /home/example/example.com/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/ButtonModule.php(62): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->render_wrapper() 7 /home/example/example.com/wp-includes/class-wp-hook.php(324): WooCommerce\PayPalCommerce\Button\ButtonModule::WooCommerce\PayPalCommerce\Button{closure}(Object(WP)) 8 /home/example/example.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) 9 /home/example/example.com/wp-includes/plugin.php(565): WP_Hook->do_action(Array) 10 /home/example/example.com/wp-includes/class-wp.php(830): do_action_ref_array(‘wp’, Array) 11 /home/example/example.com/wp-includes/functions.php(1336): WP->main(”) 12 /home/example/example.com/wp-blog-header.php(16): wp() 13 /home/example/example.com/index.php(17): require(‘/home/tinyquick…’) 14 {main}
    thrown in /home/example/example.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-method.php on line 596

    If the WooCommerce Stripe Gateway plugin is deactivated or the WooCommerce PayPal Payments plugin is deactivated, the error does not occur.

    WooCommerce PayPal Payments plugin Version 2.7.1
    WooCommerce Stripe Gateway plugin Version 8.3.1
    WordPress 6.5.3 running Twenty Twenty-Four theme.

    Please Fix ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi there @macksix,

    If you’re trying to view an order receipt using an invalid order number with a valid key, you’ll likely encounter an error.

    The system will not be able to locate the order because the order number is invalid, thus throwing the error message.

    I hope this information helps.

    Thread Starter macksix

    (@macksix)

    The error should be handled. It causes the “There has been a critical error on this website. Learn more about troubleshooting WordPress.” page to show on the site.

    It’s sloppy programming and it should be fixed.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @macksix

    I understand your point about error handling, and it’s indeed an important part of a well-designed system. We aim to provide a smooth and error-free experience for our users, and we would appreciate it if you could report this to the developer directly by creating a bug or enhancement report in our GitHub repo here: https://github.com/woocommerce/woocommerce-gateway-stripe/issues

    In the meantime, to prevent this error from occurring, I recommend avoiding the use of invalid order numbers and disabling debug mode.

    I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight.

    So in other words “Don’t do that”. Hilarious!

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @willf,

    So in other words “Don’t do that”. Hilarious!

    We understand your concern about this issue. Just as my colleague had earlier suggested, I recommend reporting about this to our developers for proper error handling.

    Here’s the direct link where you can report the issue: https://github.com/woocommerce/woocommerce-gateway-stripe/issues.

    With that said, I’ll go ahead and mark this thread as solved.

    Thanks for your understanding.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.