diff --git a/CHANGELOG.md b/CHANGELOG.md index 8032526e..232259b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,22 @@ # Changelog +## 3.8.0 (2026-09-11) + +### Features + +#### Use specific sub-endpoints URLs for create /instalment_schedules: with_schedule and with_dates + +The two variants for creating an instalment_schedule were surfaced as separate functions. However, they both went to the same URL and endpoint on the backend. + +This created some bugs in generating our openapi schema and therefore our API reference documentation. + +Therefore, we've added specific URLs for each endpoint aliased to the original one: `POST /instalment_schedules/with_dates` or `POST /instalment_schedules/with_schedule`. + +The existing POST /instalment_schedules endpoint is unchanged and will remain available for the foreseeable future. + +Client libraries will now use the specific endpoint matching the method - if you are stubbing the HTTP call you may need to update those stubs. + ## 3.7.5 (2026-09-09) ### Fixes diff --git a/gocardless_pro/__init__.py b/gocardless_pro/__init__.py index 82e61637..9ead0db9 100644 --- a/gocardless_pro/__init__.py +++ b/gocardless_pro/__init__.py @@ -2,5 +2,5 @@ from .client import Client -__version__ = '3.7.5' +__version__ = '3.8.0' diff --git a/gocardless_pro/api_client.py b/gocardless_pro/api_client.py index 676213d6..329022ad 100644 --- a/gocardless_pro/api_client.py +++ b/gocardless_pro/api_client.py @@ -172,7 +172,7 @@ def _default_headers(self): 'Authorization': 'Bearer {0}'.format(self.access_token), 'Content-Type': 'application/json', 'GoCardless-Client-Library': 'gocardless-pro-python', - 'GoCardless-Client-Version': '3.7.5', + 'GoCardless-Client-Version': '3.8.0', 'User-Agent': self._user_agent(), 'GoCardless-Version': '2015-07-06', } @@ -181,7 +181,7 @@ def _user_agent(self): python_version = '.'.join(platform.python_version_tuple()[0:2]) vm_version = '{}.{}.{}-{}{}'.format(*sys.version_info) return ' '.join([ - 'gocardless-pro-python/3.7.5', + 'gocardless-pro-python/3.8.0', 'python/{0}'.format(python_version), '{0}/{1}'.format(platform.python_implementation(), vm_version), '{0}/{1}'.format(platform.system(), platform.release()), diff --git a/gocardless_pro/services/instalment_schedules_service.py b/gocardless_pro/services/instalment_schedules_service.py index 92924d34..a0c860ab 100644 --- a/gocardless_pro/services/instalment_schedules_service.py +++ b/gocardless_pro/services/instalment_schedules_service.py @@ -47,7 +47,7 @@ def create_with_dates(self,params=None, headers=None): Returns: InstalmentSchedule """ - path = '/instalment_schedules' + path = '/instalment_schedules/create_with_dates' if params is not None: params = {self._envelope_key(): params} @@ -91,7 +91,7 @@ def create_with_schedule(self,params=None, headers=None): Returns: InstalmentSchedule """ - path = '/instalment_schedules' + path = '/instalment_schedules/create_with_schedule' if params is not None: params = {self._envelope_key(): params} diff --git a/setup.py b/setup.py index 3035c1c4..1daaed3f 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name = 'gocardless_pro', - version = '3.7.5', + version = '3.8.0', packages = find_packages(exclude=['tests']), install_requires = ['requests>=2.34.2'], python_requires = '>=3.6', diff --git a/tests/code_samples/instalment_schedules_code_samples_test.py b/tests/code_samples/instalment_schedules_code_samples_test.py index c982128e..14fd0294 100644 --- a/tests/code_samples/instalment_schedules_code_samples_test.py +++ b/tests/code_samples/instalment_schedules_code_samples_test.py @@ -26,7 +26,7 @@ @responses.activate def test_instalment_schedules_create_with_dates_code_sample(): # Convert :param placeholders to regex wildcards for flexible matching - stub_url = '/instalment_schedules' + stub_url = '/instalment_schedules/create_with_dates' url_pattern = re.compile('https://api.gocardless.com' + re.sub(r':[\w]+', r'[^/]+', stub_url)) # Mock response - repeat multiple times to handle code samples with multiple API calls response_body = { 'instalment_schedules': {} } @@ -82,7 +82,7 @@ def test_instalment_schedules_create_with_dates_code_sample(): @responses.activate def test_instalment_schedules_create_with_schedule_code_sample(): # Convert :param placeholders to regex wildcards for flexible matching - stub_url = '/instalment_schedules' + stub_url = '/instalment_schedules/create_with_schedule' url_pattern = re.compile('https://api.gocardless.com' + re.sub(r':[\w]+', r'[^/]+', stub_url)) # Mock response - repeat multiple times to handle code samples with multiple API calls response_body = { 'instalment_schedules': {} } diff --git a/tests/fixtures/instalment_schedules.json b/tests/fixtures/instalment_schedules.json index 72159a5d..8a587659 100644 --- a/tests/fixtures/instalment_schedules.json +++ b/tests/fixtures/instalment_schedules.json @@ -3,13 +3,13 @@ "create_with_dates": { "method": "POST", - "path_template": "/instalment_schedules", + "path_template": "/instalment_schedules/create_with_dates", "url_params": [], "body": {"instalment_schedules":{"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"IS123","links":{"customer":"CU123","mandate":"MD123","payments":["PM123","PM456"]},"metadata":{},"name":"Invoice 4404","payment_errors":{"0":[{"field":"charge_date","message":"must be on or after mandate's next_possible_customer_charge_date"}]},"status":"active","total_amount":1000}} }, "create_with_schedule": { "method": "POST", - "path_template": "/instalment_schedules", + "path_template": "/instalment_schedules/create_with_schedule", "url_params": [], "body": {"instalment_schedules":{"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"IS123","links":{"customer":"CU123","mandate":"MD123","payments":["PM123","PM456"]},"metadata":{},"name":"Invoice 4404","payment_errors":{"0":[{"field":"charge_date","message":"must be on or after mandate's next_possible_customer_charge_date"}]},"status":"active","total_amount":1000}} },