#Greggles
1 messages · Page 1 of 1 (latest)
Hey there
Hi there
You want to use payment_intent.succeeded or payment_intent.payment_failed to react to the outcome here.
You can use the payment_intent.processing webhook to know that a payment is in-flight and handle accordingly (don't provide your product until you get payment_intent.succeeded)
Thanks. My question might be a bit basic. I suppose I could create an entry in my database with a payment status:processing column and run a cron every hour on those entries to check the state?
Why do you need to check the state?
When payment is submitted, the status will be processing
Then you wait for the succeeded or failed webhook
No need to check the state in between those two events
3 minutes is a long time. Most people would close their browser window so although the payment status would resolve, we'd need to react to the payment success/failure with a fullfillment and email.
3 minutes is just the testing environment. These async payment methods take days to process
Yes
So yes your customer will no longer be on-session when the payment goes through
There are various ways to handle the async nature here in terms of how you interact with the customer, but from an integration stand point you really want to just rely on the payment_intent.processing webhook and then the payment_intent.succeeded or payment_intent.payment_failed webhook
No need for a cron job or anything like that
I see. Thank you for your time.