Facing issues while overriding the Avalara Module

Hi, we are trying to override VC-Avalara-Module methods.
Avalara Tax module version: 3.201.0
Platform Versions : 3.253.1
We are facing some issues with this Methods :
Method 1 : SendOrderToAvaTax
Method 2 : FromOrder
Method 1 :


This is error we getting while overriding base class.

This is base class method.
we have checked the dependencies and versions of module it was similar as we trying to override.
Method 2:
We have override this method but breakpoints are not getting hit while I am trying to debug this method.

1 Like

Hi Aman.

I think something wrong with module.manifest. Did you add dependency on VirtoCommerce.AvalaraTax in dependencies section to load your custom module after AvalaraTax?

Could you share source of your custom module? It helps understanding the reason of the problem.
Attach here or submit to support@virtocommerce.com.

We Have uploaded our Code on the GitHub

Method 1 : SendOrderToAvaTax

Method 2 : FromOrder

First, thank you for the code, it helps. We will review it in detail.

Second, You need to add dependencies on AvaTax into your module manifest.

AvaTaxExtension/module.manifest at master · divchavan298/AvaTaxExtension (github.com)

It allows VC to load your module after Virto Commerce Ava Tax, otherwise, the default module will restore the default implementation.

You can find more information in the documentation: Modularity - Versioning and Dependencies - Developer Center (virtocommerce.org)

Third, in your custom module, during the module initialization, I don’t see all declarations of your new implementation for NBAvaTaxExtension and in Dependency Injections. All custom classes should be declared.

Please find more information in the Tutorials - Extending Domain Models - Developer Center (virtocommerce.org)

  1. Remove VirtoCommerce.TaxModule.Data package reference form NB.AvaTaxExtension.Core project.

  2. Add Dependency to Avalara Tax module to module.manifest:

    <dependencies>
        <dependency id="VirtoCommerce.AvalaraTax" version="3.201.0" />
    </dependencies>
  1. Register IOrderSynconization service override in module Initialize:
    serviceCollection.AddTransient<IOrdersSynchronizationService, NBAvaTaxExtension>();
  1. Correct the SendOrderToAvaTax override method signature. Use VirtoCommerce.CoreModule.Core.Common.Address. Current codebase does not build without it.
    protected override async Task SendOrderToAvaTax(CustomerOrder order, string companyCode, VirtoCommerce.CoreModule.Core.Common.Address sourceAddress, AvaTaxClient avaTaxClient)
  1. Remove serviceCollection.AddTransient<AvaCreateTransactionModel, ExtendAvaCreateTransactionModel>() from module Initialize;

  2. Register overriden Avatax transaction model in module Initialize:

   AbstractTypeFactory<AvaCreateTransactionModel>.OverrideType<ExtendAvaCreateTransactionModel, ExtendAvaCreateTransactionModel>();

1 Like

Thanks @ksavosteev and @OlegoO ,this resolves the issue.