diff --git a/CHANGELOG.md b/CHANGELOG.md index a2a0bb3a..e5f41717 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v7.8.0 (2025-06-25) + +- Adds `params` to `requestPin` ensuring users can pass `easypost_details` to the call + ## v7.7.3 (2026-04-28) - Corrects nesting of `report` create parameters in request allowing params like `columns` and `additional_columns` to take effect correctly (closes #658) diff --git a/EasyPost.Tests/ServicesTests/WithParameters/FedExRegistrationServiceTest.cs b/EasyPost.Tests/ServicesTests/WithParameters/FedExRegistrationServiceTest.cs index 4ccd4f87..7d46101a 100644 --- a/EasyPost.Tests/ServicesTests/WithParameters/FedExRegistrationServiceTest.cs +++ b/EasyPost.Tests/ServicesTests/WithParameters/FedExRegistrationServiceTest.cs @@ -102,7 +102,12 @@ public async Task TestRequestPin() { UseMockClient(); - FedExRequestPinResponse response = await Client.FedExRegistration.RequestPin("123456789", "SMS"); + Parameters.FedExRegistration.RequestPin parameters = new Parameters.FedExRegistration.RequestPin + { + CarrierAccountId = "ca_123", + }; + + FedExRequestPinResponse response = await Client.FedExRegistration.RequestPin("123456789", "SMS", parameters); Assert.NotNull(response); Assert.NotNull(response.Message); diff --git a/EasyPost.nuspec b/EasyPost.nuspec index 1e98821a..3ebe223f 100644 --- a/EasyPost.nuspec +++ b/EasyPost.nuspec @@ -3,7 +3,7 @@ EasyPost-Official EasyPost (Official) - 7.7.3 + 7.8.0 EasyPost EasyPost https://www.easypost.com diff --git a/EasyPost/Parameters/FedExRegistration/RequestPin.cs b/EasyPost/Parameters/FedExRegistration/RequestPin.cs new file mode 100644 index 00000000..74887772 --- /dev/null +++ b/EasyPost/Parameters/FedExRegistration/RequestPin.cs @@ -0,0 +1,34 @@ +using System.Diagnostics.CodeAnalysis; +using EasyPost.Utilities.Internal.Attributes; + +namespace EasyPost.Parameters.FedExRegistration +{ + /// + /// Parameters for API calls. + /// + [ExcludeFromCodeCoverage] + public class RequestPin : BaseParameters, IFedExRegistrationParameter + { + #region Request Parameters + + /// + /// Action for the FedEx registration (create/update). + /// + [TopLevelRequestParameter(Necessity.Optional, "easypost_details", "action")] + public string? Action { get; set; } + + /// + /// Type of carrier account for the FedEx registration. + /// + [TopLevelRequestParameter(Necessity.Optional, "easypost_details", "type")] + public string? Type { get; set; } + + /// + /// Carrier account ID for the FedEx registration. + /// + [TopLevelRequestParameter(Necessity.Optional, "easypost_details", "carrier_account_id")] + public string? CarrierAccountId { get; set; } + + #endregion + } +} diff --git a/EasyPost/Properties/VersionInfo.cs b/EasyPost/Properties/VersionInfo.cs index 7f9d4f0c..2f52c1a8 100644 --- a/EasyPost/Properties/VersionInfo.cs +++ b/EasyPost/Properties/VersionInfo.cs @@ -2,6 +2,6 @@ // Version information for an assembly must follow semantic versioning // When releasing a release candidate, append a 4th digit being the number of the release candidate -[assembly: AssemblyVersion("7.7.3")] -[assembly: AssemblyFileVersion("7.7.3")] -[assembly: AssemblyInformationalVersion("7.7.3")] +[assembly: AssemblyVersion("7.8.0")] +[assembly: AssemblyFileVersion("7.8.0")] +[assembly: AssemblyInformationalVersion("7.8.0")] diff --git a/EasyPost/Services/FedExRegistrationService.cs b/EasyPost/Services/FedExRegistrationService.cs index eb1d7291..e64431db 100644 --- a/EasyPost/Services/FedExRegistrationService.cs +++ b/EasyPost/Services/FedExRegistrationService.cs @@ -42,18 +42,15 @@ public async Task RegisterAddress(string fedexAc /// /// The FedEx account number. /// The PIN delivery method: "SMS", "CALL", or "EMAIL". + /// parameter set. /// to use for the HTTP request. /// object confirming PIN was sent. - public async Task RequestPin(string fedexAccountNumber, string pinMethodOption, CancellationToken cancellationToken = default) + public async Task RequestPin(string fedexAccountNumber, string pinMethodOption, Parameters.FedExRegistration.RequestPin parameters, CancellationToken cancellationToken = default) { - Dictionary wrappedParams = new Dictionary + Dictionary wrappedParams = parameters.ToDictionary(); + wrappedParams["pin_method"] = new Dictionary { - { - "pin_method", new Dictionary - { - { "option", pinMethodOption }, - } - }, + { "option", pinMethodOption }, }; string endpoint = $"fedex_registrations/{fedexAccountNumber}/pin";