CustomViewEngine: Check selected Payment option

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
I developed a new payment plugin.
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;
}
3 года назад
If you can access the order (somehow from the context), then it has a field PaymentMethodSystemName
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.