#Ajay479
1 messages ยท Page 1 of 1 (latest)
Hi there
Can you clarify what you are trying to do?
Looks like you are listing Subs by customer?
Yes that is what we are trying to do, we are getting a warning that the method we are using is deprecated
So I was wondering how we can achieve the same results without the customerId
Thanks for clarifying. One sec, let me grab latest state on this
Take your time, appreciate your help
It looks like the new method has list options that can take a customerid?
Would this return the same results?
public List<StripeSubscription> GetAllCustomerSubscriptions(string customerId) { var subscriptionService = new StripeSubscriptionService(); var listOptions = new StripeSubscriptionListOptions() { CustomerId = customerId }; return (List<StripeSubscription>) subscriptionService.List(listOptions); // optional StripeListOptions }
Ah yes I believe that's correct. What version are you using currently.
What is the best way to tell? I see version 10.0.0.0
Hello ๐
Stepping in
That's a quite old version of the library
We deprecated the old way in version 19.0.0
https://github.com/stripe/stripe-dotnet/blob/13886fe8385ce68db56c56567444585aa1b73bfe/CHANGELOG.md#1900---2018-08-27
Request methods on StripeSubscriptionService no longer accept a string customerId argument. Instead, the customer ID should be provided in the appropriate options class (StripeSubscriptionCreateOptions, etc.)
So yes, the code you've shared above where you're passing customer ID in the SubscriptionListOptions should work
Have you had a chance to test the code yet? @main raven
I actually just tested it and it works as expected!
My team is also aware that we are using a very old version
Perfect. Glad that it worked ๐
Thank you both for the help, hopefully you are not the hanzo that is always one tapping me