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

Update payout endpoint and tests #297

Merged
merged 1 commit into from
Nov 22, 2017

Conversation

snewcomer
Copy link
Collaborator

No description provided.


describe "create/2" do
test "creates a card for a customer" do
assert {:ok, _} = Stripe.Payout.create(%{amount: 100, currency: "USD", source_type: "card"})
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshsmith why does it return a map instead of a struct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Means we're not doing something quite right.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check to see if the Converter has payout listed? My guess is that it probably does not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshsmith ah good idea. Fixed.

@coveralls
Copy link

coveralls commented Nov 21, 2017

Coverage Status

Coverage increased (+0.5%) to 68.365% when pulling 099a402 on snewcomer:payout-endpoint into 7d9da23 on code-corps:2.0-beta.

@coveralls
Copy link

coveralls commented Nov 21, 2017

Coverage Status

Coverage increased (+0.7%) to 68.533% when pulling 50b4229 on snewcomer:payout-endpoint into 7d9da23 on code-corps:2.0-beta.

@coveralls
Copy link

coveralls commented Nov 21, 2017

Coverage Status

Coverage increased (+5.7%) to 73.554% when pulling 34d3310 on snewcomer:payout-endpoint into 7d9da23 on code-corps:2.0-beta.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+5.7%) to 73.554% when pulling 34d3310 on snewcomer:payout-endpoint into 7d9da23 on code-corps:2.0-beta.

@joshsmith joshsmith changed the title Update payout enpoint and tests Update payout endpoint and tests Nov 21, 2017
@coveralls
Copy link

coveralls commented Nov 21, 2017

Coverage Status

Coverage increased (+0.6%) to 73.554% when pulling ed6f24e on snewcomer:payout-endpoint into 10e5fd1 on code-corps:2.0-beta.

@coveralls
Copy link

coveralls commented Nov 21, 2017

Coverage Status

Coverage increased (+0.6%) to 73.554% when pulling ed6f24e on snewcomer:payout-endpoint into 10e5fd1 on code-corps:2.0-beta.

@joshsmith
Copy link
Contributor

@snewcomer I wonder if there's some warning we can add to the Converter when we get an object that's not covered there.

@joshsmith
Copy link
Contributor

@mjadczak any thoughts about the above there?

@joshsmith
Copy link
Contributor

I've opened #306 as a follow-up issue to the above comment.

@joshsmith
Copy link
Contributor

Also @snewcomer I've now reformatted everything here using the new mix format.

@coveralls
Copy link

coveralls commented Nov 22, 2017

Coverage Status

Changes Unknown when pulling 3c02732 on snewcomer:payout-endpoint into ** on code-corps:2.0-beta**.

@coveralls
Copy link

coveralls commented Nov 22, 2017

Coverage Status

Coverage increased (+0.6%) to 74.044% when pulling 5373199 on snewcomer:payout-endpoint into c77ef86 on code-corps:2.0-beta.

@mjadczak
Copy link
Contributor

Sure, I’m all for adding a warning. Probably best to scope it to dev and test, and like with the unexpected keys, we should work out a way to prevent it showing in other projects using this library.

@joshsmith
Copy link
Contributor

@mjadczak I opened an issue for it. I was thinking maybe we could add some sort of debug key to the config so end users could show them if wanted.

@mjadczak
Copy link
Contributor

Yeah, that sounds like a good solution. I would just be careful to check this at compile time so we’re not getting an overhead on every single call.

@coveralls
Copy link

coveralls commented Nov 22, 2017

Coverage Status

Coverage increased (+0.6%) to 75.137% when pulling dcb9f2a on snewcomer:payout-endpoint into ae69e4b on code-corps:2.0-beta.

See the [Stripe docs](https://stripe.com/docs/api#cancel_payout).
"""
@spec cancel(Stripe.id() | t) :: {:ok, t} | {:error, Stripe.Error.t()}
def cancel(id) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should take Stripe.options() as the second param like the other functions.

describe "create/2" do
test "creates a card for a customer" do
assert {:ok, %Stripe.Payout{}} =
Stripe.Payout.create(%{amount: 100, currency: "USD", source_type: "card"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rewrite this to take the params and assign them to an intermediate variable:

params = %{amount: 100, currency: "USD", source_type: "card"}
assert {:ok, %Stripe.Payout{}} = Stripe.Payout.create(params)

@coveralls
Copy link

coveralls commented Nov 22, 2017

Coverage Status

Coverage increased (+0.6%) to 75.137% when pulling 7c0bc1a on snewcomer:payout-endpoint into e2e8bf5 on code-corps:2.0-beta.

@joshsmith joshsmith merged commit 6b1266b into beam-community:2.0-beta Nov 22, 2017
@joshsmith
Copy link
Contributor

🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants