Skip to content

Commit e6a618d

Browse files
Justintime50claude
andauthored
feat: add params to request_pin (#347)
# Description Adds `params` to `request_pin` ensuring users can pass `easypost_details` to the call. # Testing Updated test to accept new param. # Pull Request Type Please select the option(s) that are relevant to this PR. - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc) --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 146a821 commit e6a618d

4 files changed

Lines changed: 20 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## v7.7.0 (2026-06-25)
4+
5+
- Adds `params` to `request_pin` ensuring users can pass `easypost_details` to the call
6+
37
## v7.6.0 (2026-02-25)
48

59
- Adds generic `make_api_call` function

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.6.0
1+
7.7.0

lib/easypost/services/fedex_registration.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ def register_address(fedex_account_number, params = {})
1414
end
1515

1616
# Request a PIN for FedEx account verification.
17-
def request_pin(fedex_account_number, pin_method_option)
18-
wrapped_params = {
19-
pin_method: {
20-
option: pin_method_option,
21-
},
17+
def request_pin(fedex_account_number, pin_method_option, params = {})
18+
wrapped_params = wrap_pin_validation(params)
19+
wrapped_params[:pin_method] = {
20+
option: pin_method_option,
2221
}
2322
endpoint = "fedex_registrations/#{fedex_account_number}/pin"
2423

spec/fedex_registration_spec.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@
5050
describe '.request_pin' do
5151
it 'requests a pin' do
5252
fedex_account_number = '123456789'
53-
wrapped_params = {
53+
params = {
54+
easypost_details: {
55+
carrier_account_id: 'ca_123',
56+
},
57+
}
58+
expected_params = {
59+
easypost_details: {
60+
carrier_account_id: 'ca_123',
61+
},
5462
pin_method: {
5563
option: 'SMS',
5664
},
@@ -63,10 +71,10 @@
6371
allow(client).to receive(:make_request).with(
6472
:post,
6573
"fedex_registrations/#{fedex_account_number}/pin",
66-
wrapped_params,
74+
expected_params,
6775
).and_return(json_response)
6876

69-
response = client.fedex_registration.request_pin(fedex_account_number, 'SMS')
77+
response = client.fedex_registration.request_pin(fedex_account_number, 'SMS', params)
7078

7179
expect(response).to be_an_instance_of(EasyPost::Models::EasyPostObject)
7280
expect(response.message).to eq('sent secured Pin')

0 commit comments

Comments
 (0)