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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump Stripe API to 2018-08-23 #415
Bump Stripe API to 2018-08-23 #415
Conversation
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.
@mcrumm 馃挴 perfecto! Just a few comments/potential small changes. Really like what you did with the deprecation stuff.
@@ -28,7 +28,7 @@ defmodule Stripe.Coupon do | |||
max_redemptions: pos_integer | nil, | |||
metadata: Stripe.Types.metadata(), | |||
name: String.t() | nil, | |||
percent_off: pos_integer | nil, | |||
percent_off: number | nil, |
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.
馃憤
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.
Would you mind changing tax_percent
in invoice as well?
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.
No problem!
@@ -7,7 +7,8 @@ defmodule Stripe.CustomerTest do | |||
end | |||
|
|||
test "is retrievable" do | |||
assert {:ok, %Stripe.Customer{}} = Stripe.Customer.retrieve("cus_123") | |||
assert {:ok, %Stripe.Customer{} = cus} = Stripe.Customer.retrieve("cus_123") |
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.
cus
- is this variable unused?
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.
Oops, that's a hold-over from some manual verification. I will remove.
is deprecated. Use `Subscription.update/2` with | ||
`cancel_at_period_end: true` instead. | ||
""" | ||
@deprecated "Use Stripe.Subscription.update/2 with `cancel_at_period_end: true`" |
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.
馃帀
@deprecated "Use Stripe.Subscription.update/2 with `cancel_at_period_end: true`" | ||
@spec delete(Stripe.id() | t, %{at_period_end: true}) :: {:ok, t} | {:error, Stripe.Error.t()} | ||
def delete(id, %{at_period_end: true}), | ||
do: update(id, %{cancel_at_period_end: true}, []) |
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.
Could leave off the []
if you wanted. Up to you though.
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.
True. Good point.
852176d
to
2f1e40f
Compare
@snewcomer Okay, ready for another look! |
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.
One last spot.
@@ -137,7 +136,6 @@ defmodule Stripe.Subscription do | |||
optional(:metadata) => Stripe.Types.metadata(), | |||
optional(:prorate) => boolean, | |||
optional(:proration_date) => Stripe.timestamp(), | |||
optional(:source) => Stripe.id() | Stripe.Source.t(), | |||
optional(:tax_percent) => float, | |||
optional(:trial_end) => Stripe.timestamp(), | |||
optional(:trial_from_plan) => boolean |
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.
@mcrumm A couple more spots to remove :source
, specifically in the cast_to_id
helper function.
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.
Drat, thanks for catching that!
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.
@snewcomer Should be good to go now
2f1e40f
to
bc214c4
Compare
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 looks great!
Stripe.API
version to2018-08-23
tax_info
onStripe.Customer
(already exists! 馃帀)percent_off
inStripe.Coupon
business_vat_id
fromStripe.Customer
source
fromStripe.Subscription.create/2
source
fromStripe.Subscription.update/2
Stripe.Subscription.delete/2
withat_period_end: true
Stripe.Subscription.delete/3
@snewcomer Pretty sure all of the above are 馃憤, but if you wouldn't mind checking them off when you feel the same way, that would be great!