如何在WooCommerce中调用插件Ajax中的插件函数?

I am building custom payment gateway which I need to custom process payment call Ajax and redirect to order view page URL. Please check with the below example:

wp-admin/admin-ajax.php?action=custom_process_payment // 404 error


 For example
    //After clicking place order

function custom_process_payment($order_id){
$order = new wc_order($order_id);
// Mark as on-hold (we're awaiting the payment)
                $order->update_status( 'on-hold', __( 'Awaiting offline payment', 'wc-gateway-offline' ) );

}

    <script>
    var success =  funciton(response){
     jQuery.ajax({
                          type: "GET", 
                          url: ajaxurl,
                          dataType : "JSON",
                          data : {action: "custom_process_payment"},
                          //cache: false, 
                          success: function(response){
                            //redirect to order view page

                          }
                        });
    }
    </script>