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));