Skip to content

Commit

Permalink
[13.x] Fix async issue with webhooks (#1227)
Browse files Browse the repository at this point in the history
* Fix async issue with webhooks

* Update WebhookController.php

* Update WebhookController.php

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
driesvints and taylorotwell authored Aug 3, 2021
1 parent 6e71f6b commit 8963fc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Http/Controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ protected function newSubscriptionName(array $payload)
*/
protected function handleCustomerSubscriptionUpdated(array $payload)
{
// Prevent issue with subscription created webhook arriving too late...
sleep(1);

if ($user = $this->getUserByStripeId($payload['data']['object']['customer'])) {
$data = $payload['data']['object'];

Expand Down

0 comments on commit 8963fc2

Please sign in to comment.