Really need help

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I'm trying to build a plugin and get this error.

"
The controller for path '/Admin/Payment/ConfigureMethod' was not found or does not implement IController.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The controller for path '/Admin/Payment/ConfigureMethod' was not found or does not implement IController.

Source Error:


Line 8:  @if (!String.IsNullOrEmpty(Model.ConfigurationActionName))
Line 9:  {
Line 10:     @Html.Action(Model.ConfigurationActionName, Model.ConfigurationControllerName, Model.ConfigurationRouteValues);
Line 11: }
Line 12: else


Source File: c:\inetpub\wwwroot\Nop\Presentation\Nop.Web\Administration\Views\Payment\ConfigureMethod.cshtml    Line: 10
"

Is there someone how can point me in right direction to get it to work?
12 years ago
https://www.nopcommerce.com/boards/t/10969/nop-20-plugin.aspx?p=4
12 years ago
I have tried this but it will not help. I have no clue of what to do :(
12 years ago
Do you have this method in your class that implements BasePlugin, IPaymentMethod?


        public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "Configure";
            controllerName = "PaymentXYZ";
            routeValues = new RouteValueDictionary() { { "Namespaces", "Nop.Plugin.Payments.XYZ.Controllers" }, { "area", null } };
        }


XYZ will be different for you.
12 years ago
I have this in my PaymentProcessor.cs

public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "Configure";
            controllerName = "PaysonPayment";
            routeValues = new RouteValueDictionary() { { "Namespaces", "Nop.Plugin.Payments.PaysonPayment.Controllers" }, { "area", null } };
        }
12 years ago
And your controller is named PaysonPaymentController with a Configure method inside?  Can you verify that namespace is correct in the controller's file?
12 years ago
This is my controller, the name is "PaysonPaymentController.cs"

[AdminAuthorize]
    [ChildActionOnly]
    public ActionResult Configure()
    {
        var model = new ConfigurationModel();
        model.UseSandbox = _paysonPaymentSettings.UseSandBox;
        model.AgentId = _paysonPaymentSettings.AgentId;
        model.CancelUrl = _paysonPaymentSettings.CancelUrl;
        model.SellerEmail = _paysonPaymentSettings.SellerEmail;
        model.Description = _paysonPaymentSettings.Description;
        model.OkUrl = _paysonPaymentSettings.OkUrl;
        model.Md5 = _paysonPaymentSettings.Md5;
        model.GuaranteeOffered = _paysonPaymentSettings.GuaranteeOffered;

        return View("Nop.Plugin.Payments.Payson.Views.PaymentPaysonStandard.Configure", model);
    }

    [HttpPost]
    [AdminAuthorize]
    [ChildActionOnly]
    public ActionResult Configure(ConfigurationModel model)
    {
        if (!ModelState.IsValid)
            return Configure();

        _paysonPaymentSettings.UseSandBox = model.UseSandbox;
        _paysonPaymentSettings.AgentId = model.AgentId;
        _paysonPaymentSettings.CancelUrl = model.CancelUrl;
        _paysonPaymentSettings.SellerEmail = model.SellerEmail;
        _paysonPaymentSettings.Description = model.Description;
        _paysonPaymentSettings.OkUrl = model.OkUrl;
        _paysonPaymentSettings.Md5 = model.Md5;
        _paysonPaymentSettings.GuaranteeOffered = model.GuaranteeOffered;

        return View("Nop.Plugin.Payments.Payson.Views.PaymentPaysonStandard.Configure", model);
    }

One thing that I maybe have done wrong. In the GetConfigurationRoute method is this ".. routeValues = new RouteValueDictionary() { { "Namespaces",..." What is Namespaces? I tink it takes the namspaces tag in web.config? It might be the problem?
12 years ago
Namespace is the line right above your class declaration.  It could be different for every file.
12 years ago
routeValues = new RouteValueDictionary() { { "Namespaces", "Nop.Plugin.Payments.PaysonPayment.Controllers" 


return View("Nop.Plugin.Payments.Payson.Views.PaymentPaysonStandard.Configure", model);


This is probably your problem. You've got Nop.Plugin.Payments.PaysonPayment in one and just Payson in the other.  One of those is probably right and the other needs to be changed.
12 years ago
Yes, I know that and that namspace is correct "namespace Nop.Plugin.Payments.Payson.Controllers"

What i ment in my last message was in the getconfigurationroute there is this raw "routeValues = new RouteValueDictionary() { { "Namespaces", "Nop.Plugin.Payments.PaysonPayment.Controllers" }, { "area", null } };"

What is Namespaces in that row?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.