Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warnings #75

Merged
merged 2 commits into from
Aug 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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