#dida-list-java
1 messages · Page 1 of 1 (latest)
@fervent folio the list call will only return the first 10 by default. I can't think of a way to do a select on this that will also paginate automatically without writing the full code for it yourself so that's what I'd do.
I would write a for loop that loops over that list and for each element checks if it matches your criteria and if so push it in an array or something or start storing the json.
Also unclear why you want the entire raw JSON instead of extracting what you care about/need.
hmmm...
What I need is the entire list payments made in a month.
I need "resposnse.getData()"
dida-list-java
Why do you need the entire list in a month and why in java. Like what are you really doing?
You can call .toJson() on each PaymentIntent at least so if you loop over the whole list then you can build the JSON as you need right?
I need the entire list for tax purposes.
Step 1: Collect the response.getData()
Step 2 : Iterate on each PI and convert to JSON and then cast to custom pojo ?
yes
Would you suggest gson, object mapper ?
I am not familiar with GSON. Our API is quite complex really so you'll have to test and see if that fits your needs. I still don't see why you need the raw JSON versus storing the information you need like date, amount, currency, fees, etc.
What's the simpler way to extract the data ....
I was hoping to use a POJO with @tacit sandalproperties....
I need about 25 fields from the response.getData()
I have never used a POJO
I would mostly just try to start
like you have access to it all in Test mode, just retrieve one PaymentIntent and start testing the GSON parser on your end and extracting what you care about
can you give an example for the gson parser ?
or can you point me to someone who is more familiar with parsing data ?
I don't have any example no and no one will have more details
what have you tried, you're the java developer with experience with POJO and JSON
I can try and help but you need to start with something at least
Sorry, I didn't mean to offend you.
Since most of the objects in JAVA are built using gson in stripe. I Assumed your team would be familiar with it on how to deserialize objects in cleaner way.
I can certainly share what I tried so far
Basically you get a PaymentIntent pi you can do pi.toJson() to get JSON
as long as you are familiar with JSON and your POJO system that should be enough right? Then what you need is to parse that GSON into your model/table
and no offense, I just meant that there's no one on my team deeply familiar with that part of java, but we likely can help after you try this yourself to debug