Adyen / Adyen/adyen-python-api-library
[Bug] api_*_version override has no effect on PAL-based service URLs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 68
- Forks
- 49
- Avg merge
- 2h 3m
- Merged PRs (30d)
- 2
Description
Context
AdyenClient._set_url_version uses the following regex to replace the API version in endpoint URLs:
endpoint = re.sub(r"\.com/v\d{1,2}", f".com/{new_version}", endpoint)
This only matches URLs where the version segment appears immediately after the domain, e.g.:
checkout-test.adyen.com/v71✓management-test.adyen.com/v3✓
It does not match PAL-based URLs where the version is deeper in the path, e.g.:
pal-test.adyen.com/pal/servlet/Recurring/v68✗pal-test.adyen.com/pal/servlet/Payment/v68✗pal-test.adyen.com/pal/servlet/BinLookup/v54✗
Proposed Change
Update the regex to match a version segment anywhere in the path:
endpoint = re.sub(r"/v\d+(?=/|$)", f"/{new_version}", endpoint)
Also add a None guard to avoid corrupting unrelated service URLs when only one api_*_version is set:
version = version_lookup[service]
if version is None:
return endpoint
Benefit
Setting api_recurring_version, api_payment_version, api_payout_version, api_bin_lookup_version, or api_stored_value_version on AdyenClient currently has no effect. The fix makes version overrides work consistently across all services.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at AdyenClient.set_url_version and inspect how the version lookup is applied to service endpoint URLs. Check the listed PAL-based endpoints and existing URL-version behavior, then verify that each api*_version override changes its matching path while an unset version leaves unrelated URLs unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100