From 1a6eb174e9efe94ee9bc64852af9d9e3b063cddb Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 24 Jun 2026 13:58:52 -0600 Subject: [PATCH 1/2] feat: add params to request_pin Co-Authored-By: Claude Sonnet 4.5 --- CHANGELOG.md | 4 ++++ VERSION | 2 +- lib/easypost/services/fedex_registration.rb | 9 ++++----- spec/fedex_registration_spec.rb | 9 ++++++++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5722174..9199909 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v7.7.0 (2026-06-25) + +- Adds `params` to `request_pin` ensuring users can pass `easypost_details` to the call + ## v7.6.0 (2026-02-25) - Adds generic `make_api_call` function diff --git a/VERSION b/VERSION index 93c8dda..1985849 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.6.0 +7.7.0 diff --git a/lib/easypost/services/fedex_registration.rb b/lib/easypost/services/fedex_registration.rb index f1d9e7d..9fc99a7 100644 --- a/lib/easypost/services/fedex_registration.rb +++ b/lib/easypost/services/fedex_registration.rb @@ -14,11 +14,10 @@ def register_address(fedex_account_number, params = {}) end # Request a PIN for FedEx account verification. - def request_pin(fedex_account_number, pin_method_option) - wrapped_params = { - pin_method: { - option: pin_method_option, - }, + def request_pin(fedex_account_number, pin_method_option, params = {}) + wrapped_params = wrap_pin_validation(params) + wrapped_params[:pin_method] = { + option: pin_method_option, } endpoint = "fedex_registrations/#{fedex_account_number}/pin" diff --git a/spec/fedex_registration_spec.rb b/spec/fedex_registration_spec.rb index 84b9364..827176c 100644 --- a/spec/fedex_registration_spec.rb +++ b/spec/fedex_registration_spec.rb @@ -50,10 +50,17 @@ describe '.request_pin' do it 'requests a pin' do fedex_account_number = '123456789' + easypost_details = { + carrier_account_id: 'ca_123', + } + params = { + easypost_details: easypost_details, + } wrapped_params = { pin_method: { option: 'SMS', }, + easypost_details: easypost_details, } json_response = { @@ -66,7 +73,7 @@ wrapped_params, ).and_return(json_response) - response = client.fedex_registration.request_pin(fedex_account_number, 'SMS') + response = client.fedex_registration.request_pin(fedex_account_number, 'SMS', params) expect(response).to be_an_instance_of(EasyPost::Models::EasyPostObject) expect(response.message).to eq('sent secured Pin') From d13be5e68fd84ed29603d688e2f02bec4117e654 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 24 Jun 2026 14:35:01 -0600 Subject: [PATCH 2/2] fix: test --- spec/fedex_registration_spec.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/spec/fedex_registration_spec.rb b/spec/fedex_registration_spec.rb index 827176c..de72a7a 100644 --- a/spec/fedex_registration_spec.rb +++ b/spec/fedex_registration_spec.rb @@ -50,17 +50,18 @@ describe '.request_pin' do it 'requests a pin' do fedex_account_number = '123456789' - easypost_details = { - carrier_account_id: 'ca_123', - } params = { - easypost_details: easypost_details, + easypost_details: { + carrier_account_id: 'ca_123', + }, } - wrapped_params = { + expected_params = { + easypost_details: { + carrier_account_id: 'ca_123', + }, pin_method: { option: 'SMS', }, - easypost_details: easypost_details, } json_response = { @@ -70,7 +71,7 @@ allow(client).to receive(:make_request).with( :post, "fedex_registrations/#{fedex_account_number}/pin", - wrapped_params, + expected_params, ).and_return(json_response) response = client.fedex_registration.request_pin(fedex_account_number, 'SMS', params)