News:

Support the VirtueMart project and become a member

Main Menu

Having problems with Avalara vmcalculatin plugin

Started by tmdonovan, August 01, 2013, 21:20:29 PM

Previous topic - Next topic

tmdonovan

Hi
Joomla 2.5.14 and VM 2.0.21b.

I am trying to use the Avalara vmcalculation plugin and having problems.  Avalara has confirmed that I have set up the development account correctly,, so the problem appears to be in the Avalara plugin.

1) when I set Check address to United States, then I get a completely blank screen  in view-cart.  That means, nothing n the screen - no template header/footer etc.
2) when I set Check address to nothing, view-cart works fine, I see the Sales Tax text under the product list but there is no amount for it.

I have tried debugging plugins/vmcalculations/avalara/avalara.php, and see that the Class constructor is called. But I never see getAvaTax() being called. I think this is the function that invokes AvaTax to get the tax amount right? 

Any ideas why this isn't working?  Or any ideas how I can debug this further to understand why getAvaTax doesn't get invoked?

Thanks!!

Milbo

Hello tmdonovan,
this plugin is directly supported by me. Please install the package below. It is just the latest version, with a small fix for addresses. It is just a minor, but maybe in your case it makes a difference.

If you want to understand better what avatax is doing, then enable vmdebug in the vm config (1. Tab). You may also enable the specific avadebug in the file at line 21 you have

defined('AVATAX_DEBUG') or define('AVATAX_DEBUG', 0);


just set a 1 instead 0 to see the avatax specific output. In fact the blank page must be somehow reasoned by your server.

[attachment cleanup by admin]
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

tmdonovan

Hi Milbo,
thanks for getting back to me.  I installed the latest version of the plugin, and enabled both vmdeb and avatax debug.  Now, I am getting the entire white screen once I log in as a customer.  I see vmdebug statements up to the point of login, and never see any avatax debug statements.

I notice the new version of the plugin says vm2.0.22a-1.0.  Does this mean I need to be on this version of VM to run this version of the plugin? 

Milbo

blank page in general, please read here http://forum.virtuemart.net/index.php?topic=117042.0

The plugin need 2.0.22, yes. The update from 2.0.18 to 2.0.22a is imho simple
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

tmdonovan

Hi Milbo,

We upgraded VirtueMart to 2.0.22a and have installed the vmcalculation AvaTax plugin version 2.0.22a, and it still does not calculate any tax.  I have configured the Tax rule to collect tax only in New York, and the system seems to recognize this.  That is, when the shopper is shipping to New York, the text "Sales Tax" displays in the cart.  When I change the shopper ship to state to Hawaii, this text does not display. 

I have avatax-debug set to 1, and no avatax debug statements display.  When I turn vmdebug on, I see these debig statements, but never any avatax debug state,emts.  And I no longer get the white screen of death, but it does not look to melike the interface is ever invoked.

Please advise how I should proceed.  Thanks,
Terry

tmdonovan

Hi,
I found out why the AvaTax interface was not being invoked; when I upgraded the AvaTax calculation rule math operation was reset.  I changed it back to Avalara and now the interface is being invoked as soon as the shopper billto (same as  shipto) is entered.

However, the Avalara interface is failing:
AvaTax Error Invalid ZIP/Postal Code
AvaTax Error Invalid or Missing State/Province. Address in incomplete or invalid.

In the GetTaxRequest object, the Origin Address is blank, and the Destination Address is filled in with my valid home address.

After the request is executed, I get the following:
vmdebug Error, but no exception in getAvaTax Success Var1:

GetTaxResult Object
(
    [DocCode:GetTaxResult:private] =>
    [AdjustmentDescription:GetTaxResult:private] =>
    [DocDate:GetTaxResult:private] => 2013-08-09
    [TaxDate:GetTaxResult:private] => 2013-08-09
    [DocType:GetTaxResult:private] => SalesOrder
    [DocStatus:GetTaxResult:private] => Temporary
    [Reconciled:GetTaxResult:private] =>
    [Locked:GetTaxResult:private] =>
    [Timestamp:GetTaxResult:private] => 2013-08-09T14:19:18.4487778Z
    [TotalAmount:GetTaxResult:private] => 0
    [TotalDiscount:GetTaxResult:private] => 0
    [TotalExemption:GetTaxResult:private] => 0
    [TotalTaxable:GetTaxResult:private] => 0
    [TotalTax:GetTaxResult:private] => 0
    [AdjustmentReason:GetTaxResult:private] => 0
    [Version:GetTaxResult:private] => 1
    [TaxLines:GetTaxResult:private] => stdClass Object
        (
        )

    [TotalTaxCalculated:GetTaxResult:private] => 0
    [TaxSummary:GetTaxResult:private] => stdClass Object
        (
        )

    [TransactionId:GetTaxResult:private] => 491348731
    [ResultCode:GetTaxResult:private] => Error
    [Messages:GetTaxResult:private] => stdClass Object
        (
            [Message] => Array
                (
                   
  • => Message Object
                            (
                                [Summary:Message:private] => Invalid ZIP/Postal Code.
                                [Details:Message:private] => The ZIP/Postal Code does not exist and could not be determined by the city/municipality and state/province.
                                [HelpLink:Message:private] => http://www.avalara.com
                                [RefersTo:Message:private] => Addresses[0].PostalCode
                                [Severity:Message:private] => Error
                                [Source:Message:private] => Avalara.AvaTax.Services.Tax
                                [Name:Message:private] => PostalCodeError
                            )

                        [1] => Message Object
                            (
                                [Summary:Message:private] => Invalid or missing State/Province. Address is incomplete or invalid.
                                [Details:Message:private] => -, -, -, - US
                                [HelpLink:Message:private] => http://www.avalara.com
                                [RefersTo:Message:private] => Addresses[0]
                                [Severity:Message:private] => Error
                                [Source:Message:private] => Avalara.AvaTax.Services.Tax
                                [Name:Message:private] => TaxAddressError
                            )

                    )

            )

        [DocId] => 0
        [HashCode] => 0
        [TaxAddresses] => stdClass Object
            (
            )

    )



    So is the problem that the Origin Address is not filled out?  Or is there a problem validating my Destination Address?  Please advise.
    Terry

tmdonovan

It appears the problem was with the origin address.  Once the vendor address was configured in the admin/shop, the system successfully invokes AvaTax and the sales tax amount is returned and displayed in the cart.

However, when you then leave the view-cart page to select a shipping option or to enter payment information, when you return to the view-cart page the sales tax field is blank again.  It looks like AvaTax is being invoked again for both of these actions, and these invocation fail on a SOAP exception, unable to parse URL.  Any ideas why AvaTax is being invoked under these conditions, and why it fails?

tmdonovan

I have done further debugging to determine why the second and subsequent invocations are failing with a SOAP exception.  What I am seeing is that the TaxServiceSOAP object is not being created correctly.  For example, on the first invocation, $this->_connectionType = 'Development', but on the second invocation it is 'Production' which I believe is the default value.  And once the TaxServiceSOAP object is instantiated, it looks like this:
TaxServiceSoap Object
(
    [client:protected] => DynamicSoapClient Object
        (
            [config:DynamicSoapClient:private] => ATConfig Object
                (
                    [_ivars:ATConfig:private] =>
                )

            [TextCase] => Upper
            [location] => no url specified/Tax/TaxSvc.asmx
            [trace] => 1
            [_classmap] => Array
                (
                    [BaseAddress] => Address
                    [ValidAddress] => ValidAddress
                    [Message] => Message
                    [ValidateRequest] => ValidateRequest
                    [IsAuthorizedResult] => IsAuthorizedResult
                    [PingResult] => PingResult
                    [ValidateResult] => ValidateResult
                    [Line] => Line
                    [AdjustTaxRequest] => AdjustTaxRequest
                    [AdjustTaxResult] => AdjustTaxResult
                    [CancelTaxRequest] => CancelTaxRequest
                    [CancelTaxResult] => CancelTaxResult
                    [CommitTaxRequest] => CommitTaxRequest
                    [CommitTaxResult] => CommitTaxResult
                    [GetTaxRequest] => GetTaxRequest
                    [GetTaxResult] => GetTaxResult
                    [GetTaxHistoryRequest] => GetTaxHistoryRequest
                    [GetTaxHistoryResult] => GetTaxHistoryResult
                    [PostTaxRequest] => PostTaxRequest
                    [PostTaxResult] => PostTaxResult
                    [ReconcileTaxHistoryRequest] => ReconcileTaxHistoryRequest
                    [ReconcileTaxHistoryResult] => ReconcileTaxHistoryResult
                    [TaxLine] => TaxLine
                    [TaxDetail] => TaxDetail
                    [ApplyPaymentRequest] => ApplyPaymentRequest
                    [ApplyPaymentResult] => ApplyPaymentResult
                    [BaseResult] => BaseResult
                    [TaxOverride] => TaxOverride
                )

            [_soap_version] => 1
            [sdl] => Resource id #275
        )

)

You can see that the ATConfig node is empty, and this is where the URL would normally be.  I have tried several things to correct this but none of them seem to work.  It seems like the ability to correctly create the ATConfig object from within the TaxServiceSOAP constructor is compromised; perhaps addressibility to some required objects has been  lost. 

Please help; this interface does not work properly and it is impacting our schedule enormously.  I think Avalara support has emailed you to assist but there has been no response to that request or to any entries in this topic for over a week.

tmdonovan

Thanks Max for fixing the problem.  I have tested the AvaTax interface thoroughly and it seems to be working perfectly now; I can also see the committed transactions in my AvaTax account.