arthurdejong / python-stdnum

A Python library to provide functions to handle, parse and validate standard numbers.
https://arthurdejong.org/python-stdnum/
GNU Lesser General Public License v2.1
489 stars 204 forks source link

Add support for Ghana TIN #326

Closed unho closed 1 year ago

unho commented 1 year ago

Fixes #262.

arthurdejong commented 1 year ago

It seems that most of the numbers that start with a C or V from the tests do not validate on https://gra.gov.gh/online-tools/verify-tin/

The C numbers sometimes end with an X which suggest that the last digit is a check digit.

unho commented 1 year ago

@arthurdejong in that page there is the following warning:

This tool is only for Personal TIN verification and not for Company TIN

That explains why none of the non-P Ghana TIN numbers validate there.

unho commented 1 year ago

@arthurdejong I have been trying to find some way to verify company TIN numbers for Ghana online, but I only could find some URL that doesn't load. I have updated the ticket with a link to the page where I found that URL.

arthurdejong commented 1 year ago

Thanks for pointing out the noticed I missed on the https://gra.gov.gh/online-tools/verify-tin/ service. There seems to be another portal but that doesn't support searching on the TIN and neither shows it. This site seems to be unreachable.

I did look at the numbers and the check digit calculation seems to be exactly the same as ISBN10 so I've added a check digit calculation function and merged it as 7be2291.