WooCommerce WebHook Retry

This seems to do the trick, it retries every 5 minutes and uses the built in woocommerce action name.

<?php

/*
Plugin Name: Custom Stuff
Description: Custom Functions, etc.
*/

// make sure woocommerce never disables a webhook
function overrule_webhook_disable_limit($number)
{
    return 999999999999; //very high number hopefully you'll never reach.
}
add_filter('woocommerce_max_webhook_delivery_failures', 'overrule_webhook_disable_limit');

// add listener for woocommerce web hooks
function woocommerce_webhook_listener_custom($http_args, $response, $duration, $arg, $id)
{
        $responseCode = wp_remote_retrieve_response_code($response);
        if ($responseCode < 200 || $responseCode > 299)
        {
                // re-queue web-hook for another attempt, retry every 5 minutes until success
                $timestamp = new DateTime('+5 minutes');
                $argsArray = array('webhook_id' => $id, 'arg' => $arg);
                WC()->queue()->schedule_single($timestamp, 'woocommerce_deliver_webhook_async', $args = $argsArray, $group = 'woocommerce-webhooks');
        }
}

add_action('woocommerce_webhook_delivery', 'woocommerce_webhook_listener_custom', 10, 5);