I'm working on a payment plugin for V3.90 modelled off the Paypal Standard plugin. Just working on the UI at this point, but I also want to insert some code into each product page. I've looked at a few articles and followed the NopPlus.AskAQuestion plugin which does similar.
It doesn't appear to want to work however. Can I have a payment gateway and insert a widget in the same project?
I have a couple of write logs in there, config page works, the additional payment image appears in te cart however my widget doesn't display.
The code doesn't appear to be getting hit, and I'm not entirely sure how this process is supposed to work, being only a mediocre programmer.
So inmy main cs file I have the following:
public IList<string> GetWidgetZones()
{
_logger.Information("GetWidgetZone");
return new List<string> { "productdetails_overview_bottom" };
}
public void GetDisplayWidgetRoute(string widgetZone, out string actionName, out string controllerName, out RouteValueDictionary routeValues)
{
_logger.Information("Entered GetDisplayWidgetRoute");
actionName = "PublicInfo";
controllerName = "PaymentZipPay";
routeValues = new RouteValueDictionary
{
{"Namespaces", "Nop.Plugin.Payments.ZipPay.Controllers"},
{"area", null},
{"widgetZone", widgetZone}
};
}
and in the controller code I have
[ChildActionOnly]
public ActionResult PublicInfo(string widgetZone, object additionalData = null)
{
//var ZipPayPaymentProcessor = _zipPaymentProcessor; //_settingService.LoadSetting<ZipPayPaymentSettings>(storeScope);
//ViewBag.ZipPayEnvironment = (string)ZipPayPaymentProcessor.GetZipPayEnvironment();
//ViewBag.ZipPayPublicKey = (string)ZipPayPaymentProcessor.GetZipPayPublicKey();
_logger.Information("Entered PublicInfo");
return View("~/Plugins/Payments.ZipPay/Views/PublicZipInfo.cshtml");
}
There are a number of things I'm not sure about such as where does the controllername value come from for example. Is there a good explanation of what gets called and when?
Cheers,
Paul