-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] Add custom parameter sets for FedEx and UPS account creation (#…
…509) - Add custom parameter sets for FedEx and UPS account creation - Prevent users from using generic account creation parameter set for FedEx and UPS - Add unit tests, cassettes to confirm required/optional parameter set validation, confirm custom workflow carrier account parameter set usage - Add custom message option in MissingParameter exception
- Loading branch information
Showing
15 changed files
with
425 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,6 +230,36 @@ internal static ParameterSets.CarrierAccount.Create Create(Dictionary<string, ob | |
RegistrationData = fixture.GetOrNull<Dictionary<string, object?>>("registration_data"), | ||
}; | ||
} | ||
|
||
internal static ParameterSets.CarrierAccount.CreateFedEx CreateFedEx(Dictionary<string, object>? fixture) | ||
{ | ||
fixture ??= new Dictionary<string, object>(); | ||
|
||
return new ParameterSets.CarrierAccount.CreateFedEx | ||
{ | ||
Description = fixture.GetOrNull<string>("description"), | ||
Reference = fixture.GetOrNull<string>("reference"), | ||
Credentials = fixture.GetOrNull<Dictionary<string, object?>>("credentials"), | ||
TestCredentials = fixture.GetOrNull<Dictionary<string, object?>>("test_credentials"), | ||
AccountNumber = "123456789", | ||
CorporateAddressCity = "San Francisco", | ||
CorporateAddressCountryCode = "US", | ||
CorporateAddressPostalCode = "94105", | ||
CorporateAddressState = "CA", | ||
CorporateAddressStreet = "345 California St", | ||
CorporateCompanyName = "EasyPost", | ||
CorporateEmailAddress = "[email protected]", | ||
CorporateFirstName = "Demo", | ||
CorporateLastName = "User", | ||
CorporateJobTitle = "Developer", | ||
CorporatePhoneNumber = "5555555555", | ||
ShippingAddressCity = "San Francisco", | ||
ShippingAddressCountryCode = "US", | ||
ShippingAddressPostalCode = "94105", | ||
ShippingAddressState = "CA", | ||
ShippingAddressStreet = "345 California St", | ||
}; | ||
} | ||
} | ||
|
||
internal static class CustomsInfo | ||
|
@@ -618,7 +648,7 @@ internal static ParameterSets.Shipment.Create Create(Dictionary<string, object>? | |
Parcel = Parcels.Create(parcelFixture), | ||
CustomsInfo = CustomsInfo.Create(customsInfoFixture), | ||
Options = Options(optionsFixture), | ||
CarbonOffset = fixture.GetOrDefault<bool>("carbon_offset"), // this will always be true or false, never null | ||
CarbonOffset = fixture.GetOrDefault<bool>("carbon_offset"), // this will always be true or false, never null | ||
CarrierAccountIds = fixture.GetOrNull<List<string>>("carrier_accounts"), | ||
Carrier = fixture.GetOrNull<string>("carrier"), | ||
Service = fixture.GetOrNull<string>("service"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 27 additions & 27 deletions
54
EasyPost.Tests/cassettes/net/carrier_account_service_with_parameters/create.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.