getWrappedTypeName :: Name -> Q Name
getWrappedTypeName name = do
  let ns = "Network.AuthorizeNet.TH.getWrappedTypeName: Name was " ++ showName name ++ ": "
  con <- getWrappedTypeCon name
  let ty = case con of
        RecC _ [(_,_,ty)] -> ty
        NormalC _ [(_, ty)] -> ty
        _ -> error $ ns ++ "Unexpected constructor"
  case ty of
      ConT x -> return x
      _ -> error $ ns ++ "Unexpected type"
getWrappedTypeName :: Name -> Q Name
getWrappedTypeName name = do
  let ns = "Network.AuthorizeNet.TH.getWrappedTypeName: Name was " ++ showName name ++ ": "
  con <- getWrappedTypeCon name
  let ty = case con of
        RecC _ [(_,_,ty)] -> ty
        NormalC _ [(_, ty)] -> ty
        _ -> error $ ns ++ "Unexpected constructor"
  case ty of
      ConT x -> return x
      _ -> error $ ns ++ "Unexpected type"
getWrappedTypeName name = do
  let ns = "Network.AuthorizeNet.TH.getWrappedTypeName: Name was " ++ showName name ++ ": "
  con <- getWrappedTypeCon name
  let ty = case con of
        RecC _ [(_,_,ty)] -> ty
        NormalC _ [(_, ty)] -> ty
        _ -> error $ ns ++ "Unexpected constructor"
  case ty of
      ConT x -> return x
      _ -> error $ ns ++ "Unexpected type"