Developer forum

Forum » Development » Rapido checkouthandler render not working

Rapido checkouthandler render not working

Reynir Viðar Ingason
Reply

Hey there,

 

I am having an issue with a checkouthandler rendering a post template.

I am using Rapido full and have several chekout handleres configured.
Some are working but others are not and I am failing to find what the difference is.
When I run this handler I just end up on an empty page. The order log shows the handler starting and running to the render function call.
I have verified that the post template is present and have tried various things like switching the contents of the template out for a simple string to see if it renders, it does not.

Any ideas on what could be causing this?

The checkouthandler StartCheckout looks like this:

        public override string StartCheckout(Order order)
        {
            try
            {
                LogEvent(order, "Checkout started");
                if (string.IsNullOrWhiteSpace(PostTemplate))
                {
                    throw new Exception("Post template not set.");
                }
                LogEvent(order, $"Template is set: {PostTemplate}");

                var template = new Template(PostTemplate);
                template.SetTag("OrderId", order.Id);
                LogEvent(order, $"Rendering PostTemplate");
                return Render(order, template);
            }
            catch (System.Threading.ThreadAbortException)
            {
                LogError(order, $"ThreadAborted");
                return string.Empty; //Do Nothing, this is expected
            }
            catch (Exception ex)
            {
                LogError(order, ex, "Unhandled exception with message: {0}", ex.Message);
                return RenderError(order, ex.Message);
            }
        }

Replies

 
Reynir Viðar Ingason
Reply

I seem to have it figured out, I somehow managed to mess up the path to the template file.
I could still edit it from the payment option config screen which is strange.

Reynir

 

You must be logged in to post in the forum