• Resolved shaunek

    (@shaunek)


    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author BitPay

    (@bitpay)

    Thank you so much for the contribution @shaunek! We’ll take a look and give this a test tomorrow and plan for a patch release this week.

    Thread Starter shaunek

    (@shaunek)

    Sweet! I see you already merged the PR, how great. I’ll look forward to the plugin update.

    @bitpay What is the best way to suggest a minor improvement/change to the plugin? We did have to make one other change to the plugin code because of a business need, it is a pretty small change, but it might be considered a feature change. Should I share our code customization + rational via Github PR or should I open a Github Issue to open a discussion or some other option? I could do a PR but I don’t want to be presumptuous if you aren’t interested in feature requests. It is a pretty minor thing – basically we really don’t want the Woo order status to go directly to “processing” right when the invoice goes to “paid”.

    Plugin Author BitPay

    (@bitpay)

    Hey @shaunek — this is exactly the kind of engagement we’re hoping for from the community and are surely open to features and functionality. It would be fantastic if you could open an issue to give us a heads up, and then I’ll run through it with everyone. There we can discuss how we want to approach it. For example, something like this might be a great fit for a setting. Thanks!

    Thread Starter shaunek

    (@shaunek)

    Thanks @bitpay, I ended up creating a github issue and I think I’ll create a PR in the next week or so. Thanks for the help and encouragement.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘RuntimeException thrown when “complete” status received’ is closed to new replies.