-
Notifications
You must be signed in to change notification settings - Fork 4
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
Inconsistencies in Supported Countries List #16
Comments
Hi @Alexander01998 👋 Thanks for raising this issue, there is definitely something we'll investigate further on the SDK side as we would not expect to be seeing a ValueError here. However, unfortunately I'm going to keep this issue open and come back with updates while we work at making this error case more clear and better handled all around. |
We've now released v0.2.0 with some changes around enums prevents this error at the SDK level 👍 |
Hey @mikeymike, thanks for the update, but there still seems to be a mismatch between which countries the SDK thinks are supported and which countries the API thinks are supported. For example, I just found out that
As you can see, It seems like this might be a bug on the API side where it's using an outdated country list. If the API is maintained by a different team at Paddle, could you please let them know about this bug? It's really frustrating to find all these edge cases where a country works on one side but not the other. Update: Country code Update 2: Country codes |
Hey @Alexander01998 thanks for the extra details around this and the specific examples is great 🙏 I'll make sure this is raised with the relevant people here and get some clarity on the behaviour. I'll update here as things progress. |
Hey @mikeymike, thanks for the follow-up on this issue and for escalating it with the team! 👍 By the way, I noticed that v0.2.0 isn't available on PyPi yet. It still shows 0.1.3 as the latest version. Is the new release supposed to be available there? |
Hey @Alexander01998, thanks for flagging this, we have just released v0.2.1 on PyPi, there was an issue with one of the pipelines that was suppose to publish to PyPi. |
Describe the bug
If you request a price preview for a
customer_ip_address
located in Nicaragua, aValueError
is thrown with the message'NI' is not a valid CountryCode
. I can't share the IP address for privacy reasons, but the same bug also occurs if you manually try to construct theAddressPreview
object with acountry_code
ofNI
.Steps to reproduce
Run this:
You will get the following error:
Or, if you have an IP address from Nicaragua to test with:
And then you get this error:
Expected behavior
NI
should be an accepted country code inpaddle_billing.Entities.Shared.AddressPreview
, because it's possible for Paddle's servers to respond with an address object that has the country codeNI
.Alternatively, it should not be possible for Paddle's servers to respond with an address that has a country code of
NI
. (Though I'd recommend the former solution, since Nicaragua obviously is a valid country.)Code snippets
Python version
Python 3.12
SDK version
paddle-python-sdk==0.1.3
API version
Paddle Version 1 (default)
Additional context
Update: The same problem happens with Russia (RU).
The text was updated successfully, but these errors were encountered: