Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func TestCountryRates_GetRate(t *testing.T) {
}

c, _ = GetCountryRates("RO")
if r, _ := c.GetRate("standard"); r != 19 {
t.Errorf("Standard VAT rate for RO is supposed to be 19. Got %.2f", r)
if r, _ := c.GetRate("standard"); r != 21 {
t.Errorf("Standard VAT rate for RO is supposed to be 21. Got %.2f", r)
}
}

Expand Down
2 changes: 1 addition & 1 deletion validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func ValidateFormat(vatNumber string) error {
"EL": `[0-9]{9}`,
"ES": `[A-Z][0-9]{7}[A-Z]|[0-9]{8}[A-Z]|[A-Z][0-9]{8}`,
"FI": `[0-9]{8}`,
"FR": `([A-Z]{2}|[0-9]{2})[0-9]{9}`,
"FR": `[A-Z0-9]{2}[0-9]{9}`,
// Supposedly the regex for GB numbers is `[0-9]{9}|[0-9]{12}|(GD|HA)[0-9]{3}`,
// but our validator service only accepts numbers with 9 or 12 digits following the country code.
// Seems like the official site only accepts 9 digits... https://www.gov.uk/check-uk-vat-number
Expand Down
3 changes: 3 additions & 0 deletions validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ var tests = []struct {
{"FI1234567", ErrInvalidVATNumberFormat},
{"FI12345678", nil},
{"FR12345678901", nil},
{"FR1B345678901", nil},
{"FRAB345678901", nil},
{"FRABC45678901", ErrInvalidVATNumberFormat},
{"FR1234567890", ErrInvalidVATNumberFormat},
{"GB999999973", nil},
{"GB156730098481", nil},
Expand Down
Loading