#surgical

1 messages · Page 1 of 1 (latest)

sour oarBOT
sleek badge
#

Hi there

#

The date of when the Checkout Session was completed?

slate pawn
#

hi yes

sleek badge
#

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?

slate pawn
#

okay. is there one for payment intent succeeded?

sleek badge
#

There is a webhook for that and there will be a created date associated with the PaymentIntent, yes.

slate pawn
#

but is the created when the payment intent was created right? not when it' status was updated as succeeded?

sleek badge
#

Yes that's correct.

slate pawn
#

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

sleek badge
#

When do you create the order in your database and what do you use as the timestamp for that?

slate pawn
#

we use the current time , like NOW()

sleek badge
#

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

slate pawn
#

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

sleek badge
#

They actually probably take the charge date

slate pawn
#

and not may 10

sleek badge
#

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

slate pawn
#

ah

#

so payment_intent.succeeded comes in and we can grab the charges property, and take that created date

sleek badge
#

Yep that would be my recommendation

slate pawn
#

okay! thanks so much