#mrcsj
1 messages · Page 1 of 1 (latest)
You can listen to payment_intent.succeeded event, the timestamp of this event is the time when the payment is suceeded.
But, the time when this event is notified to our service is still somewhat different from the actual payment time. Multiple retries after event notification failures, or factors such as network delays are common online problems. In addition to this method, is there any other way to obtain a more accurate payment time?
you mean the 'created' in event body?
The event's created timestamp won't change if if the event was delivered after a few attempts
ok, i got it
However, in some extreme cases, we do not receive the callback notification, and only obtain the status of the payment order by querying the paymentIntent interface. In this case, how to obtain the accurate payment time?
https://stripe.com/docs/api/events/list#list_events-types you can also programmatically retrieve the event list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, i both use paymentIntent retrive and event retrive? firstly i use payment intent retrive to obtain ths status of this intent. If it was success, then i use the event retrive to obtain the accurate pay time about this payment intent?
b.t.w when i retrive events i can give the payment intent id {pi_*} as request param to filter the events result?
No you can't.
And I don't understand why you want to do all these. You can just simply listen to payment_intent.suceeded webhook event.
yeah i know the webhook event can slove this question. But some times webhook events is not available in some extreme cases. In this stituation, we can also want to get the accurate pay time about specific payment intent. (webhook is not available and only retrive interface can works well)