diff --git a/CHANGELOG.md b/CHANGELOG.md index b12d7209..c5dda903 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v8.8.0 (2026-06-25) + +- Adds `params` to `requestPin` ensuring users can pass `easypost_details` to the call. + ## v8.7.0 (2026-02-25) - Adds generic `makeApiCall` function diff --git a/composer.json b/composer.json index 50a8ed8a..352bfd89 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "easypost/easypost-php", "description": "EasyPost Shipping API Client Library for PHP", - "version": "8.7.0", + "version": "8.8.0", "keywords": [ "shipping", "api", diff --git a/lib/EasyPost/Constant/Constants.php b/lib/EasyPost/Constant/Constants.php index 5c03b8cc..bad59171 100644 --- a/lib/EasyPost/Constant/Constants.php +++ b/lib/EasyPost/Constant/Constants.php @@ -11,7 +11,7 @@ abstract class Constants const BETA_API_VERSION = 'beta'; // Library constants - const LIBRARY_VERSION = '8.7.0'; + const LIBRARY_VERSION = '8.8.0'; const SUPPORT_EMAIL = 'support@easypost.com'; // Validation diff --git a/lib/EasyPost/Service/FedExRegistrationService.php b/lib/EasyPost/Service/FedExRegistrationService.php index dd0f29be..6843494c 100644 --- a/lib/EasyPost/Service/FedExRegistrationService.php +++ b/lib/EasyPost/Service/FedExRegistrationService.php @@ -33,14 +33,14 @@ public function registerAddress(string $fedexAccountNumber, mixed $params = null * * @param string $fedexAccountNumber * @param string $pinMethodOption + * @param mixed $params * @return mixed */ - public function requestPin(string $fedexAccountNumber, string $pinMethodOption): mixed + public function requestPin(string $fedexAccountNumber, string $pinMethodOption, mixed $params = null): mixed { - $wrappedParams = [ - 'pin_method' => [ - 'option' => $pinMethodOption, - ], + $wrappedParams = $this->wrapPinValidation($params); + $wrappedParams['pin_method'] = [ + 'option' => $pinMethodOption, ]; $url = "/fedex_registrations/{$fedexAccountNumber}/pin"; diff --git a/test/EasyPost/FedExRegistrationTest.php b/test/EasyPost/FedExRegistrationTest.php index afbbda6d..e7226271 100644 --- a/test/EasyPost/FedExRegistrationTest.php +++ b/test/EasyPost/FedExRegistrationTest.php @@ -112,8 +112,13 @@ public function testRegisterAddress(): void public function testRequestPin(): void { $fedexAccountNumber = '123456789'; + $params = [ + 'easypost_details' => [ + 'carrier_account_id' => 'ca_123', + ], + ]; - $response = self::$client->fedexRegistration->requestPin($fedexAccountNumber, 'SMS'); + $response = self::$client->fedexRegistration->requestPin($fedexAccountNumber, 'SMS', $params); $this->assertInstanceOf(EasyPostObject::class, $response); $this->assertEquals('sent secured Pin', $response->message); // @phpstan-ignore-line