-
Notifications
You must be signed in to change notification settings - Fork 355
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
Fetching upcoming invoice's line items loses the request's original parameters #451
Comments
I believe this is essentially the same issue as #264 -- the collection returned by A workaround is to re-fetch the line items and explicitly pass params/options. It's what we do in this test: stripe-java/src/test/java/com/stripe/functional/InvoiceTest.java Lines 139 to 156 in e797590
This is sub-optimal as it forces you to re-fetch the line items that were already returned with the invoice object. We could reintroduce the fix from #275, or try the second approach described by @brandur-stripe here: #264 (comment). @brandur-stripe wdyt? |
Thanks for the great summary @remi-stripe / @oliver-stripe! I must admit that I'd totally forgotten about pretty much all of this stuff ...
Maybe both are in order? It seems like having the option to send parameters and options as seen in #275 can't hurt, but even if it's possible, it still strikes me as more of a workaround than anything else — as a library user, I think I'd still be surprised that I'd have to send parameters/options twice when fetching something like additional invoice items. I'm not a fan of reflection-based solutions by any means (as described by the aforementioned "second approach), but it does strike me as the most foolproof option — parameters/options would plumb through automatically, which is probably what most people want most of the time. Do you guys have an opinion? |
@brandur-stripe I agree with everything you said :) I opened a PR for the first approach in #459. |
Hi, is this issue going to be fixed? |
@rabzu Unfortunately this is a gnarly one to fix reliably but it's definitely on our radar to focus on. I've bumped it internally to see if it's something we can prioritize this quarter to fix. |
Hey everyone, any updates on this? We recently updated our development (test) version from stripe-java 11.0.0 to stripe-java 19.32.0 (and I just tried with 19.34.0 too), and this issue popped up. Note that the Stripe API version we're using in production (live) is still 2019-08-14 - not sure if the newer stripe-java communicates with the new API version, or with our old production version and if that may be affecting the results. But I'd like to know if this issue will persist before we start migrating our production codebase. It seems This code used to work fine on stripe-java 11.0.0 (we used to do I've tried passing in the Is this something I'm doing wrong, and is there a workaround to this? I suppose this would work if I manually do the pagination with |
@itgeorge Thanks for the ping and sorry for the lack of update on that one. This is not an issue we have fixed yet because it's unfortunately a tricky edge-case that we are trying to fix another way by adding a client/service infrastructure that would let you explicitly call the endpoint you expect instead. We'll investigate again though to see if there's something we can temporarily introduce to fix this. |
The original issue with the upcoming invoice line item iteration should be fixed on the service side now. |
When you retrieve an upcoming invoice in the API, your invoice might have more than 10 items. In that case you end up having to paginate the invoice. When doing so, you want to make sure that your parameters are passed automatically so that things like proration or plan changes are still taken into account on the next page(s).
Today, this is not working properly. This was originally reported in #264 and fixed in #275 so that you could explicitly pass the parameters to
autoPagingIterable()
. This was broken again in #294 when we removedStripeCollectionAPIResource
though.To reproduce the issue you need to do something like this:
Example code:
The text was updated successfully, but these errors were encountered: