#dida-java-nested

1 messages · Page 1 of 1 (latest)

void willowBOT
cerulean sky
#

dida-java-nested

#

@jaunty kelp can you share your exact code? I'll show you how to add what you need

jaunty kelp
#

Well, Im trying the request on POSTMAN as of now.

Requirement : Extract list of payments from the start date to the end date.

cerulean sky
#

ah with postman you want created[gt] not created.gt

jaunty kelp
#

Excellent! That worked.

How can i send this in JAVA ?

#

This is what I have in JAVA

cerulean sky
#

I can't do much with a picture of code

#

please share real/exact code

jaunty kelp
#

Stripe.apiKey = env.getProperty("stripe.key");
Map<String, Object> params = new HashMap<> ();
params.put ("starting_after", env.getProperty("stripe.starting.after"));
params.put("limit", 3);

    PaymentIntentCollection paymentIntents = new PaymentIntentCollection ();
cerulean sky
#
params.put ("gt", <Timestamp>));

Map<String, Object> params = new HashMap<> ();
params.put ("starting_after", env.getProperty("stripe.starting.after"));
params.put ("created", paramsCreated);
params.put("limit", 3);

PaymentIntentCollection paymentIntents = new PaymentIntentCollection ();```
jaunty kelp
#

Gotcha! Thank you!!

cerulean sky
#

you can also use typed parameters which is way better, let me show you an example (will take a few minutes, I need to write it first)

#
PaymentIntentListParams params = PaymentIntentListParams.builder()
  .setLimit(10L)
  .setCreated(
    PaymentIntentListParams.Created.builder()
      .setGte(1663657200L)
      .build())
  .build();
#

like this is cleaner

jaunty kelp
#

can you give an example of "dictionary " for the created .gte date ?

#

is there helper method in Stripe API to convert a simple date into the required format ?

#

eg : start of the month in UTC