#Greggles

1 messages · Page 1 of 1 (latest)

sacred orioleBOT
sick bloom
#

Hey there

young night
#

Hi there

sick bloom
#

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)

young night
#

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?

sick bloom
#

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

young night
#

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.

sick bloom
#

3 minutes is just the testing environment. These async payment methods take days to process

young night
#

Yes

sick bloom
#

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

young night
#

I see. Thank you for your time.