Hacker News new | ask | show | jobs
by djm_ 1205 days ago
I remember working with SagePay as a payment provider back in 2008 (before we knew of Stripe!) and finding it interesting that card address validation was only done on the numbers in a full address.

For example, from "20 Windsor Road, London, SE1 6JH" it would extract 2016 and validate that against the banks details.

I thought that was quite a smart way as UK addresses can come in all forms, shapes and sizes (as the post shows) – but the minimal bits required to be correct are indeed the numbers as all postcodes have them and an incorrect number would mean a incorrect postcode.

Edit: the funny bit was that they made you work this out and send it along with the request rather than just handling it internally :)

1 comments

How would it work where the house has a name instead of a number e.g. Wisteria cottage, Bristol, BS1 1AA?
I presume that ‘hashes’ to 11.
Correct. Which means if you’re taking deliveries it’s probably better to have a house number as you get validated more frequently.
I live on a road where all the houses on one side were built first and numbered 1 2 3 4... The houses on the other side were built later and have names and no numbers.
It would just be 11