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

Remove legacy parameter support in invoices.retrieveUpcoming() #621

Merged
merged 1 commit into from
May 9, 2019

Conversation

ob-stripe
Copy link
Contributor

@ob-stripe ob-stripe commented May 8, 2019

r? @rattrayalex-stripe @remi-stripe
cc @stripe/api-libraries @irace-stripe

  • Removes support for legacy customer and subscription parameters in invoices.retrieveUpcoming(). All parameters must now be provided in a hash.

  • While I was at it, I also noticed that retrieveLines() should really be called listLineItems() because it returns a list object containing a list of line_items.

  • I also added listUpcomingLineItems() because I think that's much cleaner than telling users to use listLines() with "upcoming" as the ID.

Copy link
Contributor

@remi-stripe remi-stripe left a comment

Choose a reason for hiding this comment

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

Flagged a minor comment otherwise LGTM but deferring to alex.

urlParams: ['id'],
}),

listLinesUpcoming: stripeMethod({
Copy link
Contributor

Choose a reason for hiding this comment

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

In other libraries we do this by passing upcoming as the id.

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 actually think this'd be listUpcomingLines...

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also uncomfortable-but-peaceful with an 'upcoming' id if that's what we do in other libs (and if it has not caused user confusion/sadness)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed it listUpcomingLineItems, which is consistent with what we do in .NET: https://stripe.com/docs/api/invoices/upcoming_invoice_lines?lang=dotnet.

We should also add this to other languages because having users pass a magic ID as a string is terrible.

@remi-stripe remi-stripe removed their assignment May 8, 2019
@ob-stripe ob-stripe force-pushed the ob-remove-legacy-params branch from 818a0ec to e2600a2 Compare May 8, 2019 23:09
@rattrayalex-stripe
Copy link
Contributor

Thanks for doing this!
Looks great. Would like to settle the question around listLinesUpcoming, then we can ship.

ptal @ob-stripe

@ob-stripe ob-stripe force-pushed the ob-remove-legacy-params branch from e2600a2 to 0e281ad Compare May 9, 2019 00:45
@ob-stripe
Copy link
Contributor Author

@remi-stripe @rattrayalex-stripe Are you both okay with listUpcomingLineItems()?

@rattrayalex-stripe
Copy link
Contributor

rattrayalex-stripe commented May 9, 2019

I am okay with that!
Per slack, remi is also okay with it.

LGTM

Thanks for this ob!

@ob-stripe
Copy link
Contributor Author

Cool. I updated the WIP migration guide with the changes here. Pulling this in!

@ob-stripe ob-stripe merged commit 17f1281 into v7.0.0 May 9, 2019
@ob-stripe ob-stripe deleted the ob-remove-legacy-params branch May 9, 2019 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants