Tag Archives: AbleCommerce

AbleCommerce unable to process payment after initial rejection

If a payment for an anonymous order does not go through the first time for whatever reason (invalid card number, payment gateway timeout, etc.) subsequent attempts to submit a payment for that order will fail with the error:

Value cannot be null. Parameter name: request.Payment.Order.User

This is due to a bug in AbleCommerce that causes the user ID associated with the order to be removed. This is the correct action for anonymous orders that have been completed, but in this case order processing is not yet complete.

To work around the issue you have to dive into the database and add the anonymous user’s ID back to the order record. After this step has been done the next attempt to process a payment should proceed normally. This has to be done after each payment failure.

AbleCommerce Tax Zone Modification

One of the features of AbleCommerce is the ability to charge taxes based on address. The feature is nice, but has one major flaw … the tax rate has to managed manually. We actually have only a few states where we are required to charge taxes, but one of those is California which is horribly convoluted. The problem boils down to, essentially, the need to track the tax rate for each zip code individually. You can’t even really use blocks of zip codes because a locality’s zip codes may not be consecutive.

AbleCommerce uses the concept of zones for assigning tax rates. For our purposes a zone can be applied based on state or a combination of state and a list of zip codes. Because of California’s tax rules and AbleCommerce’s tax rule management functionality we have to create a separate zone for each tax rate. The zip code list is just a comma-separated string of zip codes. Maintaining the information for the >1000 zip codes is difficult to do in this format.

I created a simple PHP-based page that keeps track of each zip code and its associated tax rate. While not perfect, this goes a long way towards simplifying maintenance of this information. A link to this page can be located in the AbleCommerce administrative section under Configure->Regions->Zones.

AbleCommerce has one other issue that has to be addressed. The default AbleCommerce installation limits a zone’s zip code filter to 255 characters (or about 40 zip codes) in the database and on the web form. Due to the situation with California taxes we have some zones that have significantly more than 40 zip codes and would require the creation of over 70 zones. To get around this problem I removed the web form limit and modified the database field ac_shipZones@PostalCodeFilter to be varchar(8000).