`Stripe.Account.create_login_link` has wrong return type spec
fschoenfeldt opened this issue · 3 comments
According to the spec, this function either returns an {:error, Stripe.Error.t()}
or an {:ok, Stripe.Account.t()}
which is wrong because the function delegates to Stripe.LoginLink.create
which really returns a {:ok, Stripe.LoginLink.t()
.
# deps/stripity_stripe/lib/stripe/connect/account.ex:343~353
@doc """
Create a login link.
"""
@spec create_login_link(Stripe.id() | t, params, Stripe.options()) ::
{:ok, t} | {:error, Stripe.Error.t()}
when params: %{
optional(:redirect_url) => String.t()
}
def create_login_link(id, params, opts \\ []) do
Stripe.LoginLink.create(id, params, opts)
end
This only creates issues with dialyzer so I just used Stripe.LoginLink.create/2
.
I'm not able to find the according code in the repository, so I propose the following change
@spec create_login_link(Stripe.id() | t, params, Stripe.options()) ::
-- {:ok, t} | {:error, Stripe.Error.t()}
++ {:ok, Stripe.LoginLink.t()} | {:error, Stripe.Error.t()}
Actually this function is now removed in the main branch. But it still is not released!
This issue has been automatically marked as "stale:discard". If this issue still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment.
Closing this issue after a prolonged period of inactivity. If this issue is still relevant, feel free to re-open the issue. Thank you!