hyperwallet / python-sdk

An SDK implementation in Python for the v3 REST APIs.
MIT License
14 stars 19 forks source link

Library fails to construct correct request URLs on Windows. #30

Open colleen-love opened 4 years ago

colleen-love commented 4 years ago

When making a request on a windows machine, the URL of the request is formatted incorrectly. Here's the request for GET user:

-----------REQUEST-----------
GET https://uat-api.paylution.com/rest/v3/users%5Cusr-00000000-0000-0000-0000-000000000000
User-Agent: Hyperwallet Python SDK v1.3.0
Accept: application/json
Content-Type: application/json
Authorization: Basic {auth}

The request should look like this:

-----------REQUEST-----------
GET https://uat-api.paylution.com/rest/v3/users/usr-00000000-0000-0000-0000-000000000000
User-Agent: Hyperwallet Python SDK v1.3.0
Accept: application/json
Content-Type: application/json
Authorization: Basic {auth}

The culprit is line 117 of api.py

response = self.apiClient.doGet(
    os.path.join('users', userToken)
)

It should look like:

response = self.apiClient.doGet('users/' + userToken)

I would make a PR but this bug happens 54 times and is a part of most requests.

alimony commented 4 years ago

This was fixed in https://github.com/hyperwallet/python-sdk/commit/81e7b59a154791180093240165dc5bac87f09651