-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid validation for Invoice and Order Country #153
Comments
BUT
|
But
|
Country codes are not supported:
In their interface, you can search by country codes, but it's the English or the Swedish name that can be set. (Actually, in their interface, if it's a foreign key, you can only set the English name. If the country is Sweden, you can only set it to Sverige. But if you set the country to The country that is set is the customer country. I guess the same rules apply to |
Notice that the implementation for |
I asked Fortnox to send me the list list of countries that Fortnox allows. Here it is:
|
When we wrote the validations for
Invoice
andOrder
, we assumed Fortnox API uses country codes for theCountry
attribute. Unfortunately, that is not true.Country
is a string containing the full country name! If you look at the documentation examples, you see that they have"Country": "Sverige"
, and I recently got this error in one of our apps when a user tried to fetch an Order from Fortnox API:[Fortnox::API::Model::Order.new] "United Kingdom" (String) has invalid type for :country violates constraints (included_in?(["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI"...
If you read the documentation for
Invoice
, it says that the string "Must be a name of an existing country.". What that means I do not know, so I've send a question to Fortnox API support. Apparently, you can write the country name in both Swedish (as the documentation exampel) and English (as the example above). What other languages are supported? Why do they not use country codes? There are so many questions... 😕 ❓The text was updated successfully, but these errors were encountered: