When the payment is completed I use a CustomViewEngine to override the default view: "Checkout/completed" with a view from my plugin.
The problem is that this default view is overridden also when a different payment option is selected.
How can I check if my payment option plugin is being use and only then to override?
This is my CustomeViewEngine code:
public class CustomViewEngine : IViewLocationExpander
{
public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable<string> viewLocations)
{
if (context.ControllerName == "Checkout" && context.ViewName == "Completed")
{
viewLocations = new string[] { "/Plugins/Payments.Tranzila/Views/CheckoutCompleted.cshtml"}.Concat(viewLocations);
}
return viewLocations;
}