Add a slight delay the payment observers in case all the data is not being sent
This commit is contained in:
parent
d58d0d0fd1
commit
aa6fb24a8f
3 changed files with 4 additions and 6 deletions
|
|
@ -88,6 +88,8 @@ class WebhookHandler implements ShouldQueue
|
|||
|
||||
private function process($subscription)
|
||||
{
|
||||
$this->entity->refresh();
|
||||
|
||||
// generate JSON data
|
||||
$manager = new Manager();
|
||||
$manager->setSerializer(new ArraySerializer());
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class PaymentObserver
|
|||
->exists();
|
||||
|
||||
if ($subscriptions) {
|
||||
WebhookHandler::dispatch(Webhook::EVENT_CREATE_PAYMENT, $payment, $payment->company, 'invoices,client');
|
||||
WebhookHandler::dispatch(Webhook::EVENT_CREATE_PAYMENT, $payment, $payment->company, 'invoices,client')->delay(5);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ class PaymentObserver
|
|||
->exists();
|
||||
|
||||
if ($subscriptions) {
|
||||
WebhookHandler::dispatch(Webhook::EVENT_DELETE_PAYMENT, $payment, $payment->company, 'invoices,client');
|
||||
WebhookHandler::dispatch(Webhook::EVENT_DELETE_PAYMENT, $payment, $payment->company, 'invoices,client')->delay(5);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,12 +44,8 @@
|
|||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@if($quote->invoice()->exists())
|
||||
<div class="mt-5 sm:mt-0 sm:ml-6 flex justify-end">
|
||||
<div class="inline-flex rounded-md shadow-sm">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue