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

Format CountrySpec #304

Merged
merged 1 commit into from
Nov 22, 2017
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
42 changes: 21 additions & 21 deletions lib/stripe/connect/country_spec.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ defmodule Stripe.CountrySpec do
import Stripe.Request

@type t :: %__MODULE__{
id: Stripe.id,
object: String.t,
default_currency: String.t,
supported_bank_account_currencies: %{
String.t => list(String.t)
},
supported_payment_currencies: list(String.t),
supported_payment_methods: list(Stripe.Source.source_type | String.t),
verification_fields: %{
individual: %{
minimum: list(String.t),
additional: list(String.t)
},
company: %{
minimum: list(String.t),
additional: list(String.t)
}
}
}
id: Stripe.id(),
object: String.t(),
default_currency: String.t(),
supported_bank_account_currencies: %{
String.t() => list(String.t())
},
supported_payment_currencies: list(String.t()),
supported_payment_methods: list(Stripe.Source.source_type() | String.t()),
verification_fields: %{
individual: %{
minimum: list(String.t()),
additional: list(String.t())
},
company: %{
minimum: list(String.t()),
additional: list(String.t())
}
}
}

defstruct [
:id,
Expand All @@ -44,7 +44,7 @@ defmodule Stripe.CountrySpec do
@doc """
Retrieve a country spec.
"""
@spec retrieve(Stripe.id | t, Stripe.options) :: {:ok, t} | {:error, Stripe.Error.t}
@spec retrieve(Stripe.id() | t, Stripe.options()) :: {:ok, t} | {:error, Stripe.Error.t()}
def retrieve(id, opts \\ []) do
new_request(opts)
|> put_endpoint(@plural_endpoint <> "/#{get_id!(id)}")
Expand All @@ -55,7 +55,7 @@ defmodule Stripe.CountrySpec do
@doc """
List all country specs.
"""
@spec list(map, Stripe.options) :: {:ok, Stripe.List.of(t)} | {:error, Stripe.Error.t}
@spec list(map, Stripe.options()) :: {:ok, Stripe.List.of(t)} | {:error, Stripe.Error.t()}
def list(params \\ %{}, opts \\ []) do
new_request(opts)
|> put_endpoint(@plural_endpoint)
Expand Down
4 changes: 2 additions & 2 deletions test/stripe/connect/country_spec_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ defmodule Stripe.CountrySpecTest do
describe "retrieve/2" do
test "retrieves a country spec" do
assert {:ok, %Stripe.CountrySpec{}} = Stripe.CountrySpec.retrieve("US")
assert_stripe_requested :get, "/v1/country_specs/US"
assert_stripe_requested(:get, "/v1/country_specs/US")
end
end

describe "list/2" do
test "lists all country specs" do
assert {:ok, %Stripe.List{data: country_specs}} = Stripe.CountrySpec.list()
assert_stripe_requested :get, "/v1/country_specs"
assert_stripe_requested(:get, "/v1/country_specs")
assert is_list(country_specs)
assert %Stripe.CountrySpec{} = hd(country_specs)
end
Expand Down