From d38b09f75f19bf00092458fb07addc552806768b Mon Sep 17 00:00:00 2001 From: Robin Dunlop Date: Mon, 16 Oct 2017 08:47:39 -0500 Subject: [PATCH] Re-authenticate with stamps api on two additional faults. According to the Stamps API documentation re-authenticating is also a potential fix for 'Conversation Out-Of-Sync' and 'Invalid Conversation Token' faults. Ref: http://developer.stamps.com/assets/documents/developer/downloads/Stamps.com_SWSIM_Reference_v42.pdf --- lib/active_shipping/carriers/stamps.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/active_shipping/carriers/stamps.rb b/lib/active_shipping/carriers/stamps.rb index b41ba6869..2fdad0d77 100644 --- a/lib/active_shipping/carriers/stamps.rb +++ b/lib/active_shipping/carriers/stamps.rb @@ -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