getWrappedTypeCon :: Name -> Q Con
getWrappedTypeCon name = do
  let ns = "Network.AuthorizeNet.TH.getWrappedTypeName: Name was " ++ showName name ++ ": "
  info <- reify name
  case info of
    TyConI dec ->
      case dec of
        NewtypeD _ _ _ con _ -> return con
        DataD _ _ _ [con] _ -> return con
        _ -> error $ ns ++ "Unexpected declaration"
getWrappedTypeCon :: Name -> Q Con
getWrappedTypeCon name = do
  let ns = "Network.AuthorizeNet.TH.getWrappedTypeName: Name was " ++ showName name ++ ": "
  info <- reify name
  case info of
    TyConI dec ->
      case dec of
        NewtypeD _ _ _ con _ -> return con
        DataD _ _ _ [con] _ -> return con
        _ -> error $ ns ++ "Unexpected declaration"
getWrappedTypeCon name = do
  let ns = "Network.AuthorizeNet.TH.getWrappedTypeName: Name was " ++ showName name ++ ": "
  info <- reify name
  case info of
    TyConI dec ->
      case dec of
        NewtypeD _ _ _ con _ -> return con
        DataD _ _ _ [con] _ -> return con
        _ -> error $ ns ++ "Unexpected declaration"