jetsgit / spree_tax_cloud

Spree Interface for TaxCloud SOAP API
19 stars 32 forks source link

Strip whitespace from Spree zipcode field #70

Closed sergiokas closed 9 years ago

sergiokas commented 9 years ago

Spree allows anything to be saved in the zipcode field (with little validation), since it has to accept any kind of worldwide zip codes.

That allows users to put heading (or trailing) whitespace in there (very frequent when autofilling or copy/pasting addresses), breaking TaxCloud integration when trying to get the first 5 digits. Striping whitespace right before sending it to TaxCloud solves the issue, without altering whatever's saved in Spree models.