From 951311ad8c43fb0bd288115d9b0e12714047ff89 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 24 Jun 2026 13:33:27 -0600 Subject: [PATCH] feat: add params to requestPin --- CHANGELOG.md | 4 ++++ README.md | 4 ++-- VERSION | 2 +- pom.xml | 2 +- .../java/com/easypost/service/FedExRegistrationService.java | 6 ++++-- src/test/java/com/easypost/FedExRegistrationTest.java | 5 ++++- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c698e824f..cc6bc464f 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/README.md b/README.md index ec6aaff5b..6c80cb359 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this to your project's POM: com.easypost easypost-api-client - 8.7.0 + 8.8.0 ``` @@ -25,7 +25,7 @@ Add this to your project's POM: Add this to your project's build file: ```groovy -implementation "com.easypost:easypost-api-client:8.7.0" +implementation "com.easypost:easypost-api-client:8.8.0" ``` **NOTE:** [Google Gson](http://code.google.com/p/google-gson/) is required. diff --git a/VERSION b/VERSION index df5119ec6..3b6825376 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.7.0 +8.8.0 diff --git a/pom.xml b/pom.xml index 23bd125d5..bf5655851 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.easypost easypost-api-client - 8.7.0 + 8.8.0 jar com.easypost:easypost-api-client diff --git a/src/main/java/com/easypost/service/FedExRegistrationService.java b/src/main/java/com/easypost/service/FedExRegistrationService.java index 3b92e220e..bf929afd6 100644 --- a/src/main/java/com/easypost/service/FedExRegistrationService.java +++ b/src/main/java/com/easypost/service/FedExRegistrationService.java @@ -46,12 +46,14 @@ public FedExAccountValidationResponse registerAddress(final String fedexAccountN * * @param fedexAccountNumber The FedEx account number. * @param pinMethodOption The PIN delivery method: "SMS", "CALL", or "EMAIL". + * @param params Map of parameters. * @return FedExRequestPinResponse object confirming PIN was sent. * @throws EasyPostException when the request fails. */ - public FedExRequestPinResponse requestPin(final String fedexAccountNumber, final String pinMethodOption) + public FedExRequestPinResponse requestPin(final String fedexAccountNumber, final String pinMethodOption, + final Map params) throws EasyPostException { - Map wrappedParams = new HashMap<>(); + Map wrappedParams = wrapPinValidation(params); Map pinMethodMap = new HashMap<>(); pinMethodMap.put("option", pinMethodOption); wrappedParams.put("pin_method", pinMethodMap); diff --git a/src/test/java/com/easypost/FedExRegistrationTest.java b/src/test/java/com/easypost/FedExRegistrationTest.java index ff0de37a7..0237d44b3 100644 --- a/src/test/java/com/easypost/FedExRegistrationTest.java +++ b/src/test/java/com/easypost/FedExRegistrationTest.java @@ -94,8 +94,11 @@ public void testRequestPin() throws EasyPostException { String fedexAccountNumber = "123456789"; Map pinMethodMap = new java.util.HashMap<>(); pinMethodMap.put("option", "SMS"); + Map easypostDetails = new java.util.HashMap<>(); + easypostDetails.put("carrier_account_id", "ca_123"); Map params = new java.util.HashMap<>(); params.put("pin_method", pinMethodMap); + params.put("easypost_details", easypostDetails); String jsonResponse = "{\"message\":\"sent secured Pin\"}"; FedExRequestPinResponse pinResponse = Constants.Http.GSON.fromJson(jsonResponse, FedExRequestPinResponse.class); @@ -109,7 +112,7 @@ public void testRequestPin() throws EasyPostException { vcr.client)) .thenReturn(pinResponse); - FedExRequestPinResponse response = vcr.client.fedexRegistration.requestPin(fedexAccountNumber, "SMS"); + FedExRequestPinResponse response = vcr.client.fedexRegistration.requestPin(fedexAccountNumber, "SMS", params); assertEquals("sent secured Pin", response.getMessage()); }