IEX-2498 add endpoint coverage for new capital, mandates, and recurringng URL flows#466
IEX-2498 add endpoint coverage for new capital, mandates, and recurringng URL flows#466thomasc-adyen wants to merge 1 commit intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the API coverage by introducing new tests and mock data for Capital Dynamic Offers and Balance Platform Direct Debit Mandates. It also refines the logic for resolving recurring API live URLs, ensuring that the correct domain format and necessary prefixes are applied, thereby improving the robustness and reliability of endpoint interactions within the library. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for new paltokenization endpoints in Adyen/client.py, including logic for handling live endpoint prefixes. It also adds comprehensive test cases for various Balance Platform API functionalities (mandates, tax forms) and Capital API functionalities (dynamic offers, preliminary offers, static offers). The review suggests refactoring the live_endpoint_prefix check in Adyen/client.py to avoid duplication and using f-strings for improved URL construction readability.
Adyen/client.py
Outdated
| if self.live_endpoint_prefix is None: | ||
| error_string = ( | ||
| "Please set your live suffix. You can set it by running " | ||
| "adyen.client.live_endpoint_prefix = 'Your live suffix'" | ||
| ) | ||
| raise AdyenEndpointInvalidFormat(error_string) |
There was a problem hiding this comment.
This check for live_endpoint_prefix is duplicated across the if/elif blocks for pal-, paltokenization-, and checkout- endpoints. To improve maintainability, consider performing this check once for all relevant endpoint types before the if/elif chain. This will make the code cleaner and easier to manage as more endpoint types are added.
| endpoint = endpoint.replace( | ||
| "https://paltokenization-test.adyen.com/paltokenization/servlet/", | ||
| "https://" | ||
| + self.live_endpoint_prefix | ||
| + "-paltokenization-live.adyenpayments.com/paltokenization/servlet/", | ||
| ) |
There was a problem hiding this comment.
3e5f053 to
1675b0f
Compare
…ng URL flows Add serialization/deserialization tests and mock payloads for Capital Dynamic Offers and Balance Platform Direct Debit Mandates APIs, including tax form summary URL assertions. Also update recurring live URL resolution to use the paltokenization live domain format with required live endpoint prefix, and validate both test/live recurring endpoint behavior in DetermineEndpoint tests. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1675b0f to
f522cee
Compare
|



Add serialization/deserialization tests and mock payloads for Capital Dynamic Offers and Balance Platform Direct Debit Mandates APIs, including tax form summary URL assertions. Also update recurring live URL resolution to use the paltokenization live domain format with required live endpoint prefix, and validate both test/live recurring endpoint behavior in DetermineEndpoint tests.