#ignasidedieu_api

1 messages ยท Page 1 of 1 (latest)

dense streamBOT
#

๐Ÿ‘‹ 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/1336663826333958194

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

jolly badger
#

To add more information, right now we are processing the "checkout.session.completed" event for this Payment Intent, however when we get latest charge object it returns null.

drifting shale
#

You'll need to retrieve the Payment Intent expand the latest_charge field. It's not included in the event payload by default

jolly badger
#

I retrieve the PaymentIntent, here is a piece of code "PaymentIntent paymentIntent = stripePaymentIntentService.retrievePaymentIntent(checkoutSession.getPaymentIntent(), requestOptions);", and then we're using paymentIntent.getLatestChargeObject(). According to the classe, it should check if there is a latestCharge and if so return the Charge object. public Charge getLatestChargeObject() {
return this.latestCharge != null ? (Charge)this.latestCharge.getExpanded() : null;
}

drifting shale
#

Are you expanding the latest_charge field? What does requestOptions look like?

jolly badger
#

According to our logs, the PaymentIntent object has this latest_charge id associated: "latest_charge": "ch_3Qp6mZLOFmVUUygj0mF7VDK2",

#

requestOptions only contains the accountId: acct_1NsnARLOFmVUUygj

drifting shale
jolly badger
#

Sorry, how should we expand the "latest_charge" field? Shouldn't it be returned by .getLatestCharge() method? ๐Ÿ™‚

#

I think I got it, we should use the PaymentIntent retrieve method with expandable methods. PaymentIntent.retrieve(paymentIntentId, expandList, requestOptions);

drifting shale
#

Yep!

jolly badger
#

List<String> list= new ArrayList<>();
list.add("charge");
Map<String, Object> expandList= new HashMap<>();
params.put("expand", list);

#

Should it be like this?

drifting shale
#

Yes, but latest_charge

dense streamBOT