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.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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0
7.7.0
9 changes: 4 additions & 5 deletions lib/easypost/services/fedex_registration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
14 changes: 11 additions & 3 deletions spec/fedex_registration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand All @@ -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')
Expand Down
Loading