Just an update-
I'm currently working with a couple people to try to get the Litepaid issue figured out. I will keep the store down tonight so that there is no confusion with orders while I'm asleep. I'll re-enable the store in the morning(PST) so that people can place orders and I can keep an eye on the issues that may occur. I will be testing possible solutions tonight in the meantime.
I sincerely apologize for the shaky launch. Thanks to everyone for your patience while I get everything figured out.
-Fuse
UPDATE:Sent to both Litepaid and the woocommerce plugin dev, who is also a Gulden fan
:
This is definitely an issue with when the webhook is called via the cronjob.
I tested 4 separate transactions to verify. When the webhook is called after the customer completes payment at Litepaid, the order updates correctly. When the webhook is called during the checkout process, it cancels the order because it sees the order on Litepaid as being "invoice not paid".
I'm guessing there are two approaches to fixing this. The first is a long delay between webhook calls. However, if someone was to checkout right when the cronjob ran, it would cancel the order.
Another option is to find a way to embed the webhook call in the woocommerce checkout process so that it is called when the customer receives the "thank you for your order" screen. This screen is shown whether the customer pays or not via litepaid. I tested both paying and not paying, and woocommerce thinks the order happened and displays this page. Again, there is a chance that a customer could get a cancelled order if two customers are checking out around the same time. The "thank you" screen displaying for non-payment orders is an issue as well that will need to be patched at some point.
The third option, if it's even possible, is to implement a countdown in the woocommerce plugin that would cancel the order a set time from when the invoice was created. Litepaid only gives you 15 minutes to complete a transaction anyway. Some maybe implement a 17 minute timeout(for safe measure). So the plugin calls LitePaid, finds the invoice and the time of the invoice, and gives woocommerce 17 minutes before it cancels the order. Again, not sure if it is possible, but it would be the best way of doing this so that you can just call the webhook all the time, and get immediate results.
If anyone else running a woocommerce webshop with the litepaid plugin, please let me know if you've seen this before. I'm guessing I can't be the only one this is happening to.
I will update everyone when I hear back from both parties.
-Fuse