RuntimeException thrown when “complete” status received
-
As we were testing the plugin we noticed an important error that was happening when the IPN/webhook was received. Based on my understanding of the code, the intent is that when the BitPay invoice status updates to “complete” this plugin will respond to the IPN message and attempt to update the Woocommerce order status, which depends on the configuration the WordPress administrator chooses in the plugin settings. However, this plugin instead throws a
RuntimeException
with a message like this:Wrong BitPay status. Status: complete available status: Array
(
[0] => completed
)This RuntimeException causes the order status to not be updated. See
\BitPayLib\BitPayIpnProcess->process_completed()
method. The end user customer won’t notice a problem, but a saavy Woocommerce administrator would see the error in the logs and also notice that the order status should have changed but it didn’t.What I think is the problem is that your developer accidentally typed “completed” instead of “complete” – it is very understandable since the BitPay invoice status is “complete” and an important Woocommerce order status is “completed” – so similar ?? I’ve actually fixed the problem in a fork on Github and submitted a pull request: https://github.com/bitpay/bitpay-checkout-for-woocommerce/pull/66. If you don’t see any issues with it it would be great if you could accept the change and publish a new version of the plugin to the WordPress repository.
For the short term we have manually patched the plugin’s code directly on our servers, but this is not sustainable way for us to fix the code since there isn’t an easy way for us to override with WP hooks, etc. The next time you publish a plugin update we may loose our customization if this isn’t addressed.
The version of the plugin we have installed is the most recent version on the WordPress plugin repository, 5.3.1. We are running PHP 8.2.14. I am certain the the other plugins we are running are not relevant, but if you really need them for some reason just ask.
- The topic ‘RuntimeException thrown when “complete” status received’ is closed to new replies.