Skip to content
This repository has been archived by the owner on Jun 13, 2018. It is now read-only.

Re-authenticate with stamps api on two additional faults. #549

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 3 additions & 1 deletion lib/active_shipping/carriers/stamps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,9 @@ def parse_fault(fault, response_options)
end

# Renew the Authenticator if it has expired and retry the request
if error_code && error_code.downcase == '002b0202'
# Error code reference:
# http://developer.stamps.com/assets/documents/developer/downloads/Stamps.com_SWSIM_Reference_v42.pdf
if error_code && ['002b0202', '002b0203', '002b0204'].include?(error_code.downcase)
request = renew_authenticator(last_request)
commit(last_swsim_method, request)
else
Expand Down