#mvhirsch

1 messages ยท Page 1 of 1 (latest)

valid eagleBOT
vernal dust
#

Hello ๐Ÿ‘‹
Not sure I completely understand the question. Do you have an example you can share so that I'm on the same page? Like do you want to retrieve all the checkout sessions in let's say last few months?

noble ether
#

yeah, I know about that. I even tried it before. Problem is: I can't tell when the user payed. It's just when the user created that session.

vernal dust
#

Technically, checkout.session.completed timestamp only reflects when a checkout session was completed, not when the customer was actually charged and when the payment succeeded.

noble ether
#

I know, it's more complex. How could I retrieve the paid at for every session, then?

vernal dust
#

hmm thinking..

noble ether
#

Would it be possible to retrieve such a timestamp iterating through all Charges (only taking account paid: true)?

vernal dust
#

I was thinking about that but a charge would only have created timestamp not when it succeeded. Also, There's an easier way to get to the latest charge from a checkout session rather than listing all charges.

A checkout session would have a PaymentIntent that you can expand
https://stripe.com/docs/expand

Then on the PaymentIntent, you can look at the latest_charge
https://stripe.com/docs/api/payment_intents/object?lang=node#payment_intent_object-latest_charge

Which should get you to the most recent charge for that transaction
(You'd need to expand that as well)

noble ether
#

I see. That would ease the mapping of my and stripes data. But still I only get some created timestamps?

#

Is there a possibility that a created-timestamp of a charge and a paid-at-timestamp would not be within 24 hours?

vernal dust
noble ether
#

currently I only use these payment_method_types: card, giropay, sofort, sepa_debit. I think sofort would be a delayed payment. isn't it?

vernal dust
#

Yup it is

noble ether
#

damn ๐Ÿ˜„

#

okay, thank you very much! I'm still not sure how I can solve my problem, but I feel enlightened (and will take a look in the reporting API).

vernal dust
#

NP! ๐Ÿ™‚ Sorry couldn't help much
Let us know if you have any follow ups