Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it matters but phone numbers are 10 digits not 9

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first param is for a FedEx account number, though next to the 2nd param I can see the confusion!


Assert.NotNull(response);
Assert.NotNull(response.Message);
Expand Down
2 changes: 1 addition & 1 deletion EasyPost.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>EasyPost-Official</id>
<title>EasyPost (Official)</title>
<version>7.7.3</version>
<version>7.8.0</version>
<authors>EasyPost</authors>
<owners>EasyPost</owners>
<projectUrl>https://www.easypost.com</projectUrl>
Expand Down
34 changes: 34 additions & 0 deletions EasyPost/Parameters/FedExRegistration/RequestPin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Diagnostics.CodeAnalysis;
using EasyPost.Utilities.Internal.Attributes;

namespace EasyPost.Parameters.FedExRegistration
{
/// <summary>
/// Parameters for <see cref="EasyPost.Services.FedExRegistrationService.RequestPin(string, string, RequestPin, System.Threading.CancellationToken)"/> API calls.
/// </summary>
[ExcludeFromCodeCoverage]
public class RequestPin : BaseParameters<Models.API.FedExRequestPinResponse>, IFedExRegistrationParameter
{
#region Request Parameters

/// <summary>
/// Action for the FedEx registration (create/update).
/// </summary>
[TopLevelRequestParameter(Necessity.Optional, "easypost_details", "action")]
public string? Action { get; set; }

/// <summary>
/// Type of carrier account for the FedEx registration.
/// </summary>
[TopLevelRequestParameter(Necessity.Optional, "easypost_details", "type")]
public string? Type { get; set; }

/// <summary>
/// Carrier account ID for the FedEx registration.
/// </summary>
[TopLevelRequestParameter(Necessity.Optional, "easypost_details", "carrier_account_id")]
public string? CarrierAccountId { get; set; }

#endregion
}
}
6 changes: 3 additions & 3 deletions EasyPost/Properties/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
13 changes: 5 additions & 8 deletions EasyPost/Services/FedExRegistrationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,15 @@ public async Task<FedExAccountValidationResponse> RegisterAddress(string fedexAc
/// </summary>
/// <param name="fedexAccountNumber">The FedEx account number.</param>
/// <param name="pinMethodOption">The PIN delivery method: "SMS", "CALL", or "EMAIL".</param>
/// <param name="parameters"><see cref="Parameters.FedExRegistration.RequestPin"/> parameter set.</param>
/// <param name="cancellationToken"><see cref="CancellationToken"/> to use for the HTTP request.</param>
/// <returns><see cref="FedExRequestPinResponse"/> object confirming PIN was sent.</returns>
public async Task<FedExRequestPinResponse> RequestPin(string fedexAccountNumber, string pinMethodOption, CancellationToken cancellationToken = default)
public async Task<FedExRequestPinResponse> RequestPin(string fedexAccountNumber, string pinMethodOption, Parameters.FedExRegistration.RequestPin parameters, CancellationToken cancellationToken = default)
{
Dictionary<string, object> wrappedParams = new Dictionary<string, object>
Dictionary<string, object> wrappedParams = parameters.ToDictionary();
wrappedParams["pin_method"] = new Dictionary<string, object>
{
{
"pin_method", new Dictionary<string, object>
{
{ "option", pinMethodOption },
}
},
{ "option", pinMethodOption },
};
string endpoint = $"fedex_registrations/{fedexAccountNumber}/pin";

Expand Down
Loading