Wrong model item passed into ViewDataDictionary

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I know this is a long shot...  The change to Core has been a bit daunting.  I've worked through everything (my prior plugins, scheduled tasks, etc.) - save for this last problem.  A while back I bought the source code to a Stripe plugin thinking that would 'future proof' me.  I've made changes (e.g., a ViewComponent, etc.) but I now get:

"The model item passed into the ViewDataDictionary is of type 'Nop.Web.Models.Checkout.CheckoutPaymentInfoModel', but this ViewDataDictionary instance requires a model item of type 'Nop.Plugin.Payments.Stripe.Models.PaymentInfoModel'."

As I mentioned, I know this is a long shot, but is this error 'instantly recognizable' to any one?  I've worked more 'around' Nop than 'inside' it, so any pointers would be much appreciated.
6 years ago
I had the exact same error. For me, I wasn't passing the model to the viewcomponent view. So inside my PaymentPaymentProcessorViewComponent.cs, I had this:

return View("~/Plugins/Payments.PaymentProcessor/Views/PaymentInfo.cshtml");

And it should be this:

return View("~/Plugins/Payments.PaymentProcessor/Views/PaymentInfo.cshtml", model);

Wasted a lot of time on that oversight, ugh. Anyway, hope it helps someone.
6 years ago
This is great!  I'll take the upgrade off the back burner now and see if this fixes my issue as well.  It looks *very* hopeful ... thanks!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.