-
Notifications
You must be signed in to change notification settings - Fork 353
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
Conversation
|
||
describe "create/2" do | ||
test "creates a card for a customer" do | ||
assert {:ok, _} = Stripe.Payout.create(%{amount: 100, currency: "USD", source_type: "card"}) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
1 similar comment
aed2138
to
ed6f24e
Compare
@snewcomer I wonder if there's some warning we can add to the |
@mjadczak any thoughts about the above there? |
ed6f24e
to
3c02732
Compare
I've opened #306 as a follow-up issue to the above comment. |
Also @snewcomer I've now reformatted everything here using the new |
Changes Unknown when pulling 3c02732 on snewcomer:payout-endpoint into ** on code-corps:2.0-beta**. |
3c02732
to
5373199
Compare
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. |
@mjadczak I opened an issue for it. I was thinking maybe we could add some sort of |
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. |
5373199
to
dcb9f2a
Compare
lib/stripe/core_resources/payout.ex
Outdated
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 |
There was a problem hiding this comment.
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"}) |
There was a problem hiding this comment.
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)
dcb9f2a
to
7c0bc1a
Compare
🙌 |
No description provided.