From 186c1bd036f528262f29aacb6359b1e3f2a7b1ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 May 2025 01:48:05 +0200 Subject: [PATCH] NEW Add a delay to be sure that any Stripe action from webhooks are executed after interactive actions --- htdocs/public/stripe/ipn.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 6e92987b054..097fa6f595a 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -165,7 +165,6 @@ if (isModEnabled('multicompany') && !empty($conf->stripeconnect->enabled) && is_ $ret = $mc->switchEntity($key); } -// list of action $stripe = new Stripe($db); // Subject @@ -180,6 +179,10 @@ dol_syslog("***** Stripe IPN was called with event->type=".$event->type." servic dol_syslog("***** Stripe IPN was called with event->type=".$event->type." service=".$service, LOG_DEBUG, 0, '_payment'); +// Add a delay to be sure that any Stripe action from webhooks are executed after interactive actions +sleep(2); + + if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_PAYOUT')) { // When a payout is created by Stripe to transfer money to your account dol_syslog("object = ".var_export($event->data, true));