#yingwg
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- yingwg-checkout-customerupdate, 6 days ago, 14 messages
Hi, we document this here: https://stripe.com/docs/search#data-freshness. I would recommend that you listen to webhook events like https://stripe.com/docs/api/events/types#event_types-charge.succeeded if you're trying to take actions after a payment succeeds.
hi, what is difference between payment_intent.succeeded and charge.succeeded? we are currently listen to payment_intent.succeeded event
That works too, they are the same in that once the charge is succeeded, you would get both if you're listening to both
One is on the charge oject, and the other one is on the Payment Intent object.
yeah, event with paymet_intent.succeded, I found the latest payments doesn't show up in search payments API
upon receiving the payment_intent.succeeded event, the webhook event handler is trying to all success payments from the customer that has made previously and do some post processing logic based on that
during the test I found each time, it is missing the latest payment
Are you referring to the latest_charge? Can you share the event id where the latest charge, https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge is missing?
"id": "evt_3OgcDOLZYTcA9IFh14MBlECF",
event type: payment_intent.succeeded
then we call search payment API immediately with filer "customer:'cus_PSfS9x3cgCrP0e' AND currency:'usd' AND status:'succeeded' AND amount>0",
The the result give me $115, but it should $121
I do see the latest_charge, "latest_charge": "ch_3OgcDOLZYTcA9IFh1aDvimPS" on this event, https://dashboard.stripe.com/test/events/evt_3OgcDOLZYTcA9IFh14MBlECF
then why the search payment API doesn't include that payment?
we call search payment intent API when receiving this event
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Is that because there is a propagation delay?
or because I didn't set the filter correctly?
Don’t use search for read-after-write flows (for example, searching immediately after a charge is made) because the data won’t be immediately available to search. Under normal operating conditions, data is searchable in under 1 minute. Propagation of new or updated data could be delayed during an outage.
Please note that there is a data freshness lag.
If you make the request now, does the amount match?
That is due to https://stripe.com/docs/search#data-freshness. You should not use the search immediately after a charge is made. You need to wait.
would t hat be enough if I wait for 1 min?
Under normal operating conditions yes
Sure!
What does 'default deadline' mean?
The way webhooks works is that Stripe send real time events, https://stripe.com/docs/webhooks and expect you to return a successful response immediately. Otherwise, it will time out.
if I return succcessful response after 30s, is taht okay?
No, we recommend that you immediately respond. There is not a specific timeline we can share here
Sure!