beam-community / stripity-stripe

An Elixir Library for Stripe
Other
965 stars 344 forks source link

`Stripe.Account.create_login_link` has wrong return type spec #815

Closed fschoenfeldt closed 9 months ago

fschoenfeldt commented 11 months ago

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()}
alisinabh commented 11 months ago

Actually this function is now removed in the main branch. But it still is not released!

github-actions[bot] commented 10 months ago

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.

github-actions[bot] commented 9 months ago

Closing this issue after a prolonged period of inactivity. If this issue is still relevant, feel free to re-open the issue. Thank you!