#mounika_customer-sources-list
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1277722426632966288
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Yes those calls have a limit parameter that can be set as high as 100 https://docs.stripe.com/api/payment_methods/customer_list#list_customer_payment_methods-limit
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I am not finding the specific link for the sources list API but if you pass that limit parameter it should give you a longer list back
But in this java object PaymentSourceCollection sources = Customer.retrieve(customerId).getSources() how can i set the limit using java
Ah I was mistaken about which API call was being made here. That call is retrieving a customer and expanding its sources field. Unfortunately that only supports up to 10 sources. https://docs.stripe.com/api/customers/object#customer_object-sources
Though I think on the call that you make to list more sources you should be able to specify a higher limit. Looking in to what that would look like
Okay Got it, Thanks
I am still looking in to this. I haven't been able to find an API call to do this. I will ask my colleagues and get back to you.
Hi ๐
I'm stepping in as my colleague needs to go.
Unfortunately you cannot specify more than 10 sources when you retrieve them in this fashion, since you are expanding the sources in a Retrieve call to the Customer API.
You will need to make the first call to retrieve the Customer and a second call to retrieve the sources associated with that customer.
This might look like the following:
CustomerRetrieveParams customerParams =
CustomerRetrieveParams.builder()
.addExpand("sources")
.build();
Customer customer = Customer.retrieve("cus_123", customerParams, null);
PaymentSourceCollectionListParams sourcesCollectionParams =
PaymentSourceCollectionListParams.builder()
.setObject("card")
.build();
PaymentSourceCollection collection = customer.getSources().list(sourcesCollectionParams);