Unhandled UPS SUREPOST address #162

Closed
mperham opened this Issue Jun 6, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@mperham

mperham commented Jun 6, 2014

You can see they are returning a location with country code "ZZ" which is unhandled.

ActiveMerchant::InvalidCountryCodeError: No country could be found for the country ZZ
    from /Users/mikep/src/theclymb/.bundle/ruby/2.1.0/gems/active_utils-2.2.1/lib/active_utils/common/country.rb:326:in `find'
    from /Users/mikep/src/theclymb/.bundle/ruby/2.1.0/gems/active_shipping-0.12.3/lib/active_shipping/shipping/location.rb:30:in `initialize'
    from /Users/mikep/src/theclymb/.bundle/ruby/2.1.0/gems/active_shipping-0.12.3/lib/active_shipping/shipping/carriers/ups.rb:430:in `new'
    from /Users/mikep/src/theclymb/.bundle/ruby/2.1.0/gems/active_shipping-0.12.3/lib/active_shipping/shipping/carriers/ups.rb:430:in `location_from_address_node'
    from /Users/mikep/src/theclymb/.bundle/ruby/2.1.0/gems/active_shipping-0.12.3/lib/active_shipping/shipping/carriers/ups.rb:379:in `block in parse_tracking_response'

SUREPOST is a UPS service which delivers to USPS PO Boxes so I guess they are doing some funny stuff to indicate the transfer to the Post Office?

<TrackResponse>
  <Response>
    <ResponseStatusCode>1</ResponseStatusCode>
    <ResponseStatusDescription>Success</ResponseStatusDescription>
  </Response>
  <Shipment>
    <Shipper>
      <ShipperNumber>R08E82</ShipperNumber>
      <Address>
        <AddressLine1>*******</AddressLine1>
        <City>SHEPHERDSVILLE</City>
        <StateProvinceCode>KY</StateProvinceCode>
        <PostalCode>40165 7459</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </Shipper>
    <ShipTo>
      <Address>
        <City>HARMONY</City>
        <StateProvinceCode>RI</StateProvinceCode>
        <PostalCode>02829</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </ShipTo>
    <ShipmentWeight>
      <UnitOfMeasurement>
        <Code>LBS</Code>
      </UnitOfMeasurement>
      <Weight>2.90</Weight>
    </ShipmentWeight>
    <Service>
      <Code>093</Code>
      <Description>UPS SUREPOST</Description>
    </Service>
    <ReferenceNumber>
      <Code>01</Code>
      <Value>5714440</Value>
    </ReferenceNumber>
    <ShipmentIdentificationNumber>
    1ZR08E82YW14507755</ShipmentIdentificationNumber>
    <PickupDate>20140602</PickupDate>
    <ScheduledDeliveryDate>20140606</ScheduledDeliveryDate>
    <Package>
      <TrackingNumber>******************</TrackingNumber>
      <PackageServiceOptions>
        <USPSPICNumber>92612999951762571000010232</USPSPICNumber>
      </PackageServiceOptions>
      <Activity>
        <ActivityLocation>
          <Address>
            <StateProvinceCode>RI</StateProvinceCode>
            <PostalCode>02829</PostalCode>
            <CountryCode>US</CountryCode>
          </Address>
        </ActivityLocation>
        <Status>
          <StatusType>
            <Code>D</Code>
            <Description>DELIVERED</Description>
          </StatusType>
          <StatusCode>
            <Code>YC</Code>
          </StatusCode>
        </Status>
        <Date>20140605</Date>
        <Time>100100</Time>
      </Activity>
      <Activity>
        <ActivityLocation>
          <Address>
            <CountryCode>ZZ</CountryCode>
          </Address>
        </ActivityLocation>
        <Status>
          <StatusType>
            <Code>I</Code>
            <Description>RECEIVED BY THE LOCAL POST
            OFFICE</Description>
          </StatusType>
          <StatusCode>
            <Code>YH</Code>
          </StatusCode>
        </Status>
        <Date>20140605</Date>
        <Time>140100</Time>
      </Activity>
      <Activity>
        <ActivityLocation>
          <Address>
            <City>WARWICK</City>
            <StateProvinceCode>RI</StateProvinceCode>
            <CountryCode>US</CountryCode>
          </Address>
        </ActivityLocation>
        <Status>
          <StatusType>
            <Code>I</Code>
            <Description>PACKAGE TRANSFERRED TO POST
            OFFICE.</Description>
          </StatusType>
          <StatusCode>
            <Code>LX</Code>
          </StatusCode>
        </Status>
        <Date>20140605</Date>
        <Time>095600</Time>
      </Activity>
      <Activity>
        <ActivityLocation>
          <Address>
            <City>WARWICK</City>
            <StateProvinceCode>RI</StateProvinceCode>
            <CountryCode>US</CountryCode>
          </Address>
        </ActivityLocation>
        <Status>
          <StatusType>
            <Code>I</Code>
            <Description>DESTINATION SCAN</Description>
          </StatusType>
          <StatusCode>
            <Code>DS</Code>
          </StatusCode>
        </Status>
        <Date>20140605</Date>
        <Time>044500</Time>
      </Activity>
      <Activity>
        <ActivityLocation>
          <Address>
            <City>WARWICK</City>
            <StateProvinceCode>RI</StateProvinceCode>
            <CountryCode>US</CountryCode>
          </Address>
        </ActivityLocation>
        <Status>
          <StatusType>
            <Code>I</Code>
            <Description>DESTINATION SCAN</Description>
          </StatusType>
          <StatusCode>
            <Code>DS</Code>
          </StatusCode>
        </Status>
        <Date>20140604</Date>
        <Time>220200</Time>
      </Activity>
      <Activity>
        <ActivityLocation>
          <Address>
            <City>WARWICK</City>
            <StateProvinceCode>RI</StateProvinceCode>
            <CountryCode>US</CountryCode>
          </Address>
        </ActivityLocation>
        <Status>
          <StatusType>
            <Code>I</Code>
            <Description>ARRIVAL SCAN</Description>
          </StatusType>
          <StatusCode>
            <Code>AR</Code>
          </StatusCode>
        </Status>
        <Date>20140604</Date>
        <Time>191300</Time>
      </Activity>
      <Activity>
        <ActivityLocation>
          <Address>
            <City>LOUISVILLE</City>
            <StateProvinceCode>KY</StateProvinceCode>
            <CountryCode>US</CountryCode>
          </Address>
        </ActivityLocation>
        <Status>
          <StatusType>
            <Code>I</Code>
            <Description>DEPARTURE SCAN</Description>
          </StatusType>
          <StatusCode>
            <Code>DP</Code>
          </StatusCode>
        </Status>
        <Date>20140603</Date>
        <Time>000300</Time>
      </Activity>
      <Activity>
        <ActivityLocation>
          <Address>
            <City>LOUISVILLE</City>
            <StateProvinceCode>KY</StateProvinceCode>
            <CountryCode>US</CountryCode>
          </Address>
        </ActivityLocation>
        <Status>
          <StatusType>
            <Code>I</Code>
            <Description>ORIGIN SCAN</Description>
          </StatusType>
          <StatusCode>
            <Code>OR</Code>
          </StatusCode>
        </Status>
        <Date>20140602</Date>
        <Time>155200</Time>
      </Activity>
      <Activity>
        <ActivityLocation>
          <Address>
            <CountryCode>US</CountryCode>
          </Address>
        </ActivityLocation>
        <Status>
          <StatusType>
            <Code>M</Code>
            <Description>BILLING INFORMATION RECEIVED</Description>
          </StatusType>
          <StatusCode>
            <Code>MP</Code>
          </StatusCode>
        </Status>
        <Date>20140602</Date>
        <Time>234901</Time>
      </Activity>
      <PackageWeight>
        <UnitOfMeasurement>
          <Code>LBS</Code>
        </UnitOfMeasurement>
        <Weight>2.90</Weight>
      </PackageWeight>
      <ReferenceNumber>
        <Code>01</Code>
        <Value>5714440</Value>
      </ReferenceNumber>
      <ReferenceNumber>
        <Code>01</Code>
        <Value>S12825986</Value>
      </ReferenceNumber>
      <ReferenceNumber>
        <Code>01</Code>
        <Value>133A</Value>
      </ReferenceNumber>
    </Package>
  </Shipment>
</TrackResponse>

kknd113 pushed a commit to dotandbo/active_shipping that referenced this issue May 12, 2015

Add the product package javascripts to the precompile list.
Signed-off-by: Nathan Lowrie <nate@finelineautomation.com>

Fixes #162

@trishume trishume closed this in #287 Jun 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment