Vendr failing to finalise some orders

Umbraco v10 with Vendr v3.0.11

Payment gateway is Verifone

Some orders are completing payment OK in Verifone and the callback to Vendr is happening, but the process does not complete.

Below shows that the GetOrderReferenceAsync function is being called - but I don’t know why twice, is that something Vendr does?

Then, nothing else happens and the customer is left on a blank page at the callback URL - like this

Has anyone experienced anything similar? All of our code has logging statements, so it appears as though Vendr stops for some reason, but I cannot figure out why, or the process to replicate the issue.

This is a common issue with payment provider processing (at least in my experience).
Confusion in the handling chain makes it hard to diagnose and fix.
If you have lots of logging that is helpful to workout if the expected functions are being hit, even if unexpectedly many times. Hopefully your functions are idempotent.

The blank page ending can happen if the hostname url is changing. This happened to me recently when my custom hostname randomly changed back to the azurewebsites.net hostname.

There is some weird random fault going on in the Umbraco Cloud hosting environment, whereby it loses the custom name and defaults back to the azure host. A complete site restart fixed it (recommendation from Umbraco HQ).

Otherwise, if you can repro the issue locally, then you have a chance of fixing it.
Check each callback function and make sure it is being called when you expect it to.
Check that the callback has the data you want.
Check that you are returning OkResult or BadResult appropriately.
Check the FinalizeAtContinueUrl property is set appropriately.
Check that the GenerateFormAsync() method has all the necessary values set right up front. This includes the required FQDN in the return address.

Good luck.

Thanks for your reply and the list of things to look at. However, for 99% of the time, the answer is yes / OK to all of them.

Something is causing Vendr (?) not to continue beyond the GetOrderReference call - sometimes. Up until that point, it all looks fine.

We have not been able to replicate the issue locally.

There is already a lot of logging in our code, but we have added some more which may help. Unfortunately, we cannot see any pattern to the problem purchases.

I noticed in your image that the url is ending in ‘azurewebsites.net’. Is this what you expect?
If you cannot reproduce it locally and it only happens on the live or dev sites (if you are cloud hosting) then this might be the issue.
A change in url might explain the blank page.
Try adding a rewrite rule to ensure that the correct hostname is applied.
URL Rewrites in Umbraco | Umbraco CMS