[Feature]: Refactor `_determine_api_url` method in `Adyen/client.py`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- backend-api-design, payments
Línea de trabajo
Comienza en Adyen/client.py leyendo _determine_api_url y rastreando las llamadas API existentes que dependen de él. Compara los enfoques propuestos basados en el nivel de servicio y en el nombre del método antes de elegir un mapeo centralizado. Se considerará terminado cuando se eliminen las comprobaciones basadas en cadenas, sea más fácil ampliar la determinación de la URL y todas las llamadas API existentes sigan funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Feature summary
No response
Problem statement
The _determine_api_url method in Adyen/client.py is fragile and difficult to maintain. It relies on string manipulation and hardcoded values to determine the correct API endpoint URL. This makes it prone to errors and difficult to extend.
Problem:
- The current implementation uses a series of
if/elifstatements withinchecks on the endpoint string. This is not robust and can break if endpoint names change. - It has special logic for "pal-" and "checkout-" prefixes, including hardcoded URLs.
Proposed solution
The logic for determining the correct endpoint URL should be more robust and centralized. Here are two potential approaches:
- Service-level mapping: The service calling the client should be responsible for providing the correct and complete URL. The
_determine_api_urlmethod would then become a simple pass-through or perform minimal validation. - Method-name-based mapping: Instead of relying on URL substrings, the client could use the service and method names to look up the correct endpoint from a structured configuration or map. This would decouple the logic from the specific URL structure.
Alternatives considered
Another alternative is to rely on the "servers" field of OpenAPI specs, but currently those don't contain mappings for all environments
Additional context
Acceptance Criteria:
- Remove the string-based checks in
_determine_api_url. - Implement a more robust mechanism for URL determination.
- Ensure all existing API calls continue to work correctly.
- The new implementation should be easier to read, maintain, and extend for future services.
- Lenguaje dominante
- Python
- Estrellas
- 68
- Forks
- 51
- Merge medio
- 2 h 3 min
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Adyen/adyen-python-api-library
-
[Bug] api_*_version override has no effect on PAL-based service URLsPosiblemente ocupada @cobanfurkanx la tomó hace 9 días. AbiertoBug do not stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
[Feature]: Foreign Exchange APIAbiertoFeature
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Adyen/adyen-python-api-library#487 · 1 comentario · 1 reacción ·
-
[Test] Add baseUrl environment tests to all service test filesPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertodo not stale Test
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
-
chore: consolidate package metadata into pyproject.toml (PEP 621)Posiblemente ocupada @erdemtuna la tomó hace 190 días. Abiertodo not stale
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
-
[Bug]: Unknown properties return NonePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertodo not stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 48/100
Adyen/adyen-python-api-library#397 · 2 comentarios ·
Todos los issues de Adyen/adyen-python-api-library
Issues similares
-
fix formatting of the sample database page of the docsPosiblemente ocupada @Aaqibhafeezkhan la tomó hoy. Abiertodocumentation good first issue help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
chaoss/CollectOSS#544 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area/plugin good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
kestra-io/plugin-soda#137 ·
-
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
ibm-granite/granite.build#504 ·
Los mantenedores suelen responder en 2 días
-
`LazyFrameRemote` and `ExecuteRemote` sinks do not accept `Path`, like `LazyFrame` sinks do.Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día