diff --git a/CHANGELOG.md b/CHANGELOG.md index b010f7f..94f0bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v10.7.0 (2026-06-25) + +- Adds `params` to `request_pin` ensuring users can pass `easypost_details` to the call. + ## v10.6.0 (2026-02-25) - Adds generic `make_api_call` function diff --git a/easypost/constant.py b/easypost/constant.py index b83a932..07760d4 100644 --- a/easypost/constant.py +++ b/easypost/constant.py @@ -1,6 +1,6 @@ # flake8: noqa # Library version -VERSION = "10.6.0" +VERSION = "10.7.0" VERSION_INFO = [str(number) for number in VERSION.split(".")] # Client defaults diff --git a/easypost/services/fedex_registration_service.py b/easypost/services/fedex_registration_service.py index 7406246..ed73910 100644 --- a/easypost/services/fedex_registration_service.py +++ b/easypost/services/fedex_registration_service.py @@ -19,9 +19,10 @@ def register_address(self, fedex_account_number: str, **params) -> dict[str, Any return convert_to_easypost_object(response=response) - def request_pin(self, fedex_account_number: str, pin_method_option: str) -> dict[str, Any]: + def request_pin(self, fedex_account_number: str, pin_method_option: str, **params) -> dict[str, Any]: """Request a PIN for FedEx account verification.""" - wrapped_params = {"pin_method": {"option": pin_method_option}} + wrapped_params = self._wrap_pin_validation(params) + wrapped_params["pin_method"] = {"option": pin_method_option} url = f"/fedex_registrations/{fedex_account_number}/pin" response = Requestor(self._client).request(method=RequestMethod.POST, url=url, params=wrapped_params) diff --git a/pyproject.toml b/pyproject.toml index 3b7c6ba..fbda4c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "easypost" description = "EasyPost Shipping API Client Library for Python" -version = "10.6.0" +version = "10.7.0" readme = "README.md" requires-python = ">=3.9" license = { file = "LICENSE" } diff --git a/tests/test_fedex_registration.py b/tests/test_fedex_registration.py index c37d07c..ea4e534 100644 --- a/tests/test_fedex_registration.py +++ b/tests/test_fedex_registration.py @@ -44,6 +44,9 @@ def test_register_address(prod_client, monkeypatch): def test_request_pin(prod_client, monkeypatch): """Tests requesting a pin.""" fedex_account_number = "123456789" + params = { + "easypost_details": {"carrier_account_id": "ca_123"}, + } json_response = {"message": "sent secured Pin"} @@ -52,7 +55,7 @@ def test_request_pin(prod_client, monkeypatch): monkeypatch.setattr("easypost.services.fedex_registration_service.Requestor", mock_requestor) - response = prod_client.fedex_registration.request_pin(fedex_account_number, "SMS") + response = prod_client.fedex_registration.request_pin(fedex_account_number, "SMS", **params) assert isinstance(response, EasyPostObject) assert response.message == "sent secured Pin"