Thursday, May 19, 2011

ASPDNSF + QuickBooks Gateway + Zip 5-4 = Error

Version: AspDotNetStorefront 8.0.1.2

Problem:

Billing addresses with zip 5-4 e.g. 90019-5929 causes the QuickBooks gateway to error with the following message: The string X in the field CreditCardPostalCode is too long. The maximum length is 9.

Solution:

In file: \ASPDNSFGateways\QBMerchantServices.cs make the following modification:

//mod start Aydus 5/09/2011: Strip any non-numeric characters from zip. e.g. dash when address validation turned on.
System.Text.RegularExpressions.Regex nonNumericCharacters = new System.Text.RegularExpressions.Regex(@"[^0-9]");
creditCard.BillingPostalCode = nonNumericCharacters.Replace(UseBillingAddress.Zip, String.Empty);
//creditCard.BillingPostalCode = UseBillingAddress.Zip;
//mod end

Tuesday, May 17, 2011

How to Get ASPDotNetStorefront Store URL

Version: AspDotNetStorefront 8.x

Problem:

How do I get the current store url?

Solution:

There are a number of variables available.
In an XMLPackage use the following: <xsl:value-of select= “/root/System/StoreUrl” />
In .NET call the following function AppLogic.GetStoreHTTPLocation or AppLogic.GetStoreDomain