#surgical
1 messages · Page 1 of 1 (latest)
hi yes
Hmm yeah no exact timestamp will be provided for that. You can either use the created timestamp for the Checkout Session or I would ingest the time at which you receive the webhook.
What is your use-case here for the exact completed time?
okay. is there one for payment intent succeeded?
There is a webhook for that and there will be a created date associated with the PaymentIntent, yes.
but is the created when the payment intent was created right? not when it' status was updated as succeeded?
Yes that's correct.
the use case is we pre-create an order and we save it to our database, but we don't have an order "marked succeeded" date. so when we pull a report for "orders on May 10", it is not the same as "payment made on May 10". A customer can have an order that was created at 11:59:59pm, but then it doesn't get paid until the next day
so when we pull an orders report on May 10, we want to be the consistent with the stripe balance report on May 10
When do you create the order in your database and what do you use as the timestamp for that?
we use the current time , like NOW()
Yeah so I think what I'd recommend is instead just aligning that timestamp with the Stripe timestamp
Otherwise it will never be perfect
In terms of the Stripe reports though
right - how do we get the stripe timestamp? even with a payment intent, if it was created at 11:59:59pm may 10, but not succeeded until may 11, the balance report will show this payment as may 11
They actually probably take the charge date
and not may 10
Yeah I'm not overly familiar with our Reports since I focus on the API
But pretty sure they would use the timestamp of the Charge itself
So that is actually what you want to align to
ah
so payment_intent.succeeded comes in and we can grab the charges property, and take that created date
Yep that would be my recommendation
okay! thanks so much