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..de72a7a 100644 --- a/spec/fedex_registration_spec.rb +++ b/spec/fedex_registration_spec.rb @@ -50,7 +50,15 @@ describe '.request_pin' do it 'requests a pin' do fedex_account_number = '123456789' - wrapped_params = { + params = { + easypost_details: { + carrier_account_id: 'ca_123', + }, + } + expected_params = { + easypost_details: { + carrier_account_id: 'ca_123', + }, pin_method: { option: 'SMS', }, @@ -63,10 +71,10 @@ 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') + 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')