Skip to content

Commit

Permalink
Merge pull request #304 from code-corps/format-country-spec
Browse files Browse the repository at this point in the history
Format CountrySpec
  • Loading branch information
joshsmith authored Nov 22, 2017
2 parents f610ef7 + 06762a2 commit 869718c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
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

0 comments on commit 869718c

Please sign in to comment.