Skip to content

Commit

Permalink
Merge pull request #75 from gmile/remove-warnings
Browse files Browse the repository at this point in the history
Remove warnings
  • Loading branch information
gmile authored Aug 10, 2016
2 parents 7c4f4db + 6a279cd commit 61cf49d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/stripe.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defmodule Stripe do
Returns binary
"""
def config_or_env_key do
require_stripe_key
require_stripe_key()
end

@doc """
Expand Down Expand Up @@ -108,7 +108,7 @@ defmodule Stripe do
Returns tuple
"""
def make_request(method, endpoint, body \\ [], headers \\ [], options \\ []) do
make_request_with_key( method, endpoint, config_or_env_key, body, headers, options )
make_request_with_key( method, endpoint, config_or_env_key(), body, headers, options )
end

@doc """
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/accounts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ defmodule Stripe.Accounts do
```
"""
def delete_all key do
case all do
case all() do
{:ok, accounts} ->
Enum.each accounts, fn c -> delete(c["id"], key) end
{:error, err} -> raise err
Expand Down
7 changes: 4 additions & 3 deletions lib/stripe/connect.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ defmodule Stripe.Connect do
"""
def generate_button_url( csrf_token ) do
client_id = Stripe.config_or_env_platform_client_id
url = base_url <> "oauth/authorize?response_type=code"
url = base_url() <> "oauth/authorize?response_type=code"
url = url <> "&scope=read_write"
url = url <> "&client_id=#{Stripe.config_or_env_platform_client_id}"

if String.length(csrf_token) > 0 do
url = url <> "&state=#{csrf_token}"
url <> "&state=#{csrf_token}"
else
url
end
url
end

@doc """
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/customers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ defmodule Stripe.Customers do
```
"""
def delete_all do
case all do
case all() do
{:ok, customers} ->
Enum.each customers, fn c -> delete(c["id"]) end
{:error, err} -> raise err
Expand All @@ -205,7 +205,7 @@ defmodule Stripe.Customers do
```
"""
def delete_all key do
case all do
case all() do
{:ok, customers} ->
Enum.each customers, fn c -> delete(c["id"], key) end
{:error, err} -> raise err
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/plans.ex
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ end
```
"""
def delete_all key do
case all do
case all() do
{:ok, plans} ->
Enum.each plans, fn p -> delete(p["id"], key) end
{:error, err} -> raise err
Expand Down
9 changes: 6 additions & 3 deletions lib/stripe/util.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ defmodule Stripe.Util do
def list_raw( endpoint, key, limit, starting_after) do
q = "#{endpoint}?limit=#{limit}"

if String.length(starting_after) > 0 do
q = q <> "&starting_after=#{starting_after}"
end
q =
if String.length(starting_after) > 0 do
q <> "&starting_after=#{starting_after}"
else
q
end

Stripe.make_request_with_key(:get, q, key )
|> Stripe.Util.handle_stripe_full_response
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ defmodule Stripe.Mixfile do
def project do
[ app: :stripity_stripe,
version: "1.4.0",
description: description,
package: package,
description: description(),
package: package(),
elixir: "~> 1.1",
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
Expand Down

0 comments on commit 61cf49d

Please sign in to comment.