Skip to content

Commit

Permalink
Add params argument to Subscription.delete/2
Browse files Browse the repository at this point in the history
  • Loading branch information
dbstratta committed Jun 13, 2018
1 parent 8ada585 commit 361909c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/stripe/subscriptions/subscription.ex
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,15 @@ defmodule Stripe.Subscription do
Takes the `id` and an optional map of `params`.
"""
@spec delete(Stripe.id() | t, Stripe.options()) :: {:ok, t} | {:error, Stripe.Error.t()}
def delete(id, opts \\ []) do
@spec delete(Stripe.id() | t, params, Stripe.options()) :: {:ok, t} | {:error, Stripe.Error.t()}
when params: %{
optional(:at_period_end) => boolean
}
def delete(id, params \\ %{}, opts \\ []) do
new_request(opts)
|> put_endpoint(@plural_endpoint <> "/#{get_id!(id)}")
|> put_method(:delete)
|> put_params(params)
|> make_request()
end

Expand Down

0 comments on commit 361909c

Please sign in to comment.