Skip to content

Conversation

@barreeeiroo
Copy link
Contributor

Fixes

While integrating Payment Rails API with this library, I realized there are quite a few things missing. Mainly, the search (or find) methods have lots of attributes missing, and as we needed a way to get a specific recipient by email address, we decided to modify the SDK a little bit.
The new UrlUtils class provides a method to automatically get all Python method parameters and convert them into a Payment Rails API equivalent. There is an example available at RecipientGateway.search: the only condition is that Python method attributes name have to match with PR API ones.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

By using the UrlUtils.parse method, it will automatically parse all attributes and convert them to lowerCamelCase, as according to the API.
@barreeeiroo
Copy link
Contributor Author

For example, in the following piece of code:

g = RecipientGateway(None, None)
g.search(page_size=15, email="diego@kodular.io")

the endpoint variable in RecipientGateway.search value will be /v1/recipients?pageSize=15&email=diego%40sdc.gal

@fronugget fronugget merged commit 292e9c9 into trolley:master Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants