#Ida

1 messages ยท Page 1 of 1 (latest)

elder gladeBOT
timid vapor
#

Can you share a PaymentIntent object where you are facing this?

#

Payment Intent ID rather

prisma linden
#

You mean you need the ID, or the full object?

timid vapor
#

Just the ID works

prisma linden
#

Basically I had this issue with all of them ๐Ÿ˜…
Let me have another go and supply you with a recent one.

timid vapor
#

Ok thanks

prisma linden
#

I actually get null from:
PaymentIntent.getLatestChargeObject(), so I cannot access the .getPaymentMethodDetails().getCardPresent().getCaptureBefore()
I just tested it with:
pi_3Mc4FaKUVeVlk6JS1ol1z33a
It's in 'TestMode', not production

timid vapor
#

Can you try calling getLatestCharge() instead?

#

Does that return null?

prisma linden
#

let me check

#

I get the charge Id: ch_3Mc4FaKUVeVlk6JS1K3ZW1Pr

#

should I try to retrieve this charge object with this id?

timid vapor
#

So I think the issue is you're not expanding latestCharge

#

Then getLatestChargeObject should return the object

#

Alternatively, yeah you can retrieve it if you like

prisma linden
#

I tried to retrieve the charge, but the cardPresent is null
Let me check the expand option

timid vapor
#

Which part was null?

#

Probably it was getPaymentMethodDetails

#

And you need to expand

#

Actually getPaymentMethodDetails shouldn't need an expansion. Which method call in the chain returned null?

prisma linden
#

PaymentIntent.getLatestChargeObject() is returning null, which property I need to expend?

timid vapor
#

latest charge needs to be expanded

#

It has expandable next to the field

#

By default we only return an ID

prisma linden
#

Ok, I expanded the latest_charge and now the PaymentIntent.getLatestChargeObject() is returning the object, but card_present is null. Should I addExpend it? full path?

#

I tried

addExpand("latest_charge.payment_method_details.card_present")
But the card_present is still null

crystal jasper
#

What are you hoping to achieve by expanding card_present?

prisma linden
#

access to the capture_before

#

From the documantions I understood this is the way to get it. If there is a different way to the get the capture_before field, please let me know

crystal jasper
#

Are you accepting these card payments via an in-person transaction on a physical Terminal device?

prisma linden
#

online payments

crystal jasper
#

Okay yeah, as far as I know, card_present will only be populated with data if the card was processed in person (e.g. the card was present). What are you actually trying to do with this information? It sounds like you're trying to figure out when the authorization will drop off of the customer's account, is that right?

prisma linden
#

Yes, I want to know when the pre-authorization will expire.

#

we know that it is card dependent, and configuration dependent. We might need to restrict the costumer purchase according that period. For example, purchasing a service in the future. We secure it with pre-authorization, but if the future date is after the expiration date, we need to know it and consider not allowing it

#

I believe if this field is part of the payment intent, there should be a way to retrieve it using java

#

I can get the card object, but it has no 'capture_before' field

crystal jasper
#

So that's nested under a Charge object and has nothing to do with card_present. Is that Event an example of one where you would want to get the capture_before field? In other words, do you have a webhook handler that is listening for that event? And is that handler going to be responsible for getting capture_before?

prisma linden
#

I'm not using a webhook for event in this case, I'm using stripe lib something like:
PaymentIntent.retrieve(intentId, requestOptions). Supplying the key in the requestOptions

#

My apologies, I really appreciate you trying to help me, but I need to go now. I hope you can write me your suggestions, I will back tomorrow morning, UTC+1 time.
Thanks a lot for your advices

crystal jasper
#

Sure thing! Will circle back with a suggestion here shortly