Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8304193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:46:52+00:00 2026-06-08T17:46:52+00:00

I use this tutorial to create Plugin Architecture in my solution and I also

  • 0

I use this tutorial to create Plugin Architecture in my solution and I also use ninject for the first time:

http://www.codeproject.com/script/Articles/ArticleVersion.aspx?aid=358360&av=526320&msg=4308834#xx4308834xx

Now in MVC application while user is in the process of checkout I get the payment method he selects and need to retrieve the plugin for the selected payment method. I have succeeded in retrieving plugin controller this way, though I have no idea whether it is safe or acceptable practice:

Type type = Type.GetType(paymentMethod.PaymentMethodPluginType);  

 //get plugin controller

var paymentController = ServiceLocator.Current.GetInstance(type) as BasePaymentController;

//get validations from plugin

    var warnings = paymentController.ValidatePaymentForm(form);

        //get payment info from plugin

        var paymentInfo = paymentController.GetPaymentInfo(form);
        //…

I also need to access a plugin class for processing the payment.
I have an interface IPaymentMethod

  public partial interface IPaymentMethod 
  {
   void  PostProcessPayment (PostProcessPaymentRequest postprocessPaymentRequest);        

  }

And plugin PaymentProcessor like this

public class PluginPaymentProcessor :IPaymentMethod
    {        
        public void PostProcessPayment (PostProcessPaymentRequest postprocessPaymentRequest)
        {
            ///
        }

Now in MVC project I try to access PostProcessPayment method this way 

IPaymentMethod pluginpaymentmethod = ServiceLocator.Current.GetInstance<IPaymentMethod>(paymentMethod.PaymentProcessor);

here paymentMethod.PaymentProcessor is “MyApp.Plugins.MyPlugin.PluginPaymentProcessor, MyApp.Plugins.MyPlugin,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null”

   And want to use pluginpaymentmethod like i do in controller example

pluginpaymentmethod.PostProcessPayment(postProcessPaymentRequest);

but it throws error that resource is not found and pluginpaymentmethod is not loaded. How can I fix it or can you suggest any tutorial with similar implementations? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:46:54+00:00Added an answer on June 8, 2026 at 5:46 pm

    assuming you have a concrete class called MyPlugin which has the IPaymentMethod interface, then your ninject bindings should look a bit like:

    private static void RegisterServices(IKernel kernel){
        kernel.Bind<IPaymentMethod>().To<MyPlugin>().InRequestScope();
    }
    

    check that this is in place in your NinjectWebCommon.cs class under the App_Start folder. A trickier scenario might be that IPaymentMethod has to be registered in the same way that the Ninject IKernel is bound:

    kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
    

    that would potentially be a trickier issue to work out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/ It authenticates against
Googled out- could use some help here. I followed this excellent tutorial here (http://www.malteahrens.com/#/blog/howto-onenote-dev/)
I followed this tuorial to create a COM dll in Visual Basic. http://www.codeproject.com/KB/COM/Basics_of_Idl_file.aspx I
I use Pjax with tutorial from http://railscasts.com/episodes/294-playing-with-pjax?view=comments I don't need change url and this
use this website a lot but first time posting. My program creates a number
I have used the signalR chat app (as laid out in this tutorial http://sergiotapia.com/2011/09/signalr-with-mvc3-chat-app-build-asynchronous-real-time-persistant-connection-websites/
I'm starting to use webservices in Android and I followed this tutorial: Create Web
i found a couple HTML5 audio examples: jQuery plugin: http://www.happyworm.com/jquery/jplayer/latest/demo-01.htm This site uses the
I've followed instructions http://code.google.com/webtoolkit/doc/latest/tutorial/gettingstarted.html in order to create sample GWT program. Now I would
I'm following this tutorial about building a multilingual web sites using PHP gettext http://onlamp.com/pub/a/php/2002/06/13/php.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.