Open andrewlimaza opened 4 years ago
+1 for this idea - I just was about to suggest it in the dev Slack channel and saw this issue.
Can we use the wp_doing_ajax()
function (which should be true for IPN/Webhook handlers) and, if that is the case, give a general message about the cancellation being caused by an ajax request, likely due to cancellation at a payment gateway? https://developer.wordpress.org/reference/functions/wp_doing_ajax/
Can we use the wp_doing_ajax()...
This is a good approach. It shows a bit more context for folks here, but also covers other cases where levels change during AJAX calls (our Zapier add on).
Would we want "System Cancelled" to be the message so it covers all cases?
If a user cancels from payment gateway side (i.e. PayPal) the reason shows as "N/A". We could maybe handle this to say "Cancelled at gateway" to make it clearer for admins.