-- EG: maybeIDFromLocation [("Location", "https://sandbox.bluesnap.com/services/2/shoppers/19575974")]
-- Just "19575974"
maybeIDFromLocation :: [Header] -> Maybe String
maybeIDFromLocation headers =
  ((find (("location"==) . map toLower . fst) headers) >>= (return . snd) >>= parseURI >>= getOID)
  where
    getOID :: URI -> Maybe String
    getOID = last . splitOn "/" . uriPath
maybeIDFromLocation :: [Header] -> Maybe String
maybeIDFromLocation headers =
  ((find (("location"==) . map toLower . fst) headers) >>= (return . snd) >>= parseURI >>= getOID)
  where
    getOID :: URI -> Maybe String
    getOID = last . splitOn "/" . uriPath
maybeIDFromLocation headers =
  ((find (("location"==) . map toLower . fst) headers) >>= (return . snd) >>= parseURI >>= getOID)
  where
    getOID :: URI -> Maybe String
    getOID = last . splitOn "/" . uriPath