Start a new topic
Answered

Installing payment method to 2.10

Seeing the modules going to a seperate repository, I assume the new way of making modules is different as well. My try went like this:

  • Get the modules repo
  • Set up the admin and storefront
  • Add my module to the code
  • Test of my payment method was successful
  • Run the packaging script
  • Install my payment method zipfile to fresh 2.10 deployment, through the admin menu "install module"
  • Install was success, and admin site promted me to restart, which I did
  • After restart, I get error message when trying to access the admin site
[InvalidOperationException: The current type, VirtoCommerce.Domain.Payment.Services.IPaymentMethodsService, is an interface and cannot be constructed. Are you missing a type mapping?]
   Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.ThrowForAttemptingToConstructInterface(IBuilderContext context) +239
   lambda_method(Closure , IBuilderContext ) +39
   Microsoft.Practices.ObjectBuilder2.<>c__DisplayClass1.<GetBuildMethod>b__0(IBuilderContext context) +33
   Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +337
   Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +396
   Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +238

[ResolutionFailedException: Resolution of the dependency failed, type = "VirtoCommerce.Domain.Payment.Services.IPaymentMethodsService", name = "(none)".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The current type, VirtoCommerce.Domain.Payment.Services.IPaymentMethodsService, is an interface and cannot be constructed. Are you missing a type mapping?
-----------------------------------------------
At the time of the exception, the container was:

  Resolving VirtoCommerce.Domain.Payment.Services.IPaymentMethodsService,(none)
]
   Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +500
   Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides) +20
   Microsoft.Practices.Unity.UnityContainerExtensions.Resolve(IUnityContainer container, ResolverOverride[] overrides) +79
   Spa.KlarnaCheckout.Web.Module.Initialize() +167
   VirtoCommerce.Platform.Core.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo) +244

[ModuleInitializeException: An exception occurred while initializing module 'Spa.KlarnaCheckout'.]

Best Answer

You forgot to add required dependency to you module.manifest 

<dependencies>
<dependency id="VirtoCommerce.Core" version="2.10.0" />
</dependencies>

Can you show source code of your payment method module? Better will be send whole module source code archive. 

Sure, I uploaded a branch for you in my fork of the modules repo:

https://github.com/Sparkjop/vc-modules/tree/SIG_KlarnaCheckout/PLATFORM/Modules/PaymentGateways


I managed to install the payment method module to my local development environment. So this may actually be more related to how 2.10 is deployed to a standalone server.

Disregard my last comment. I depoyed a new fresh 2.10 to a standalone server, following the new instructions in the docs. Payment method still gives the same errors.

I also tried to install a custom shipping method, and that worked fine.

Answer

You forgot to add required dependency to you module.manifest 

<dependencies>
<dependency id="VirtoCommerce.Core" version="2.10.0" />
</dependencies>
Login or Signup to post a comment