Include invoices with payment webhooks

This commit is contained in:
David Bomba 2021-09-23 21:01:26 +10:00
parent 15a00b3b73
commit 9330f51a86

View File

@ -29,6 +29,9 @@ class PaymentObserver
->where('event_id', Webhook::EVENT_CREATE_PAYMENT) ->where('event_id', Webhook::EVENT_CREATE_PAYMENT)
->exists(); ->exists();
if($payment->invoices()->exists())
$payment->load('invoices');
if ($subscriptions) { if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_CREATE_PAYMENT, $payment, $payment->company); WebhookHandler::dispatch(Webhook::EVENT_CREATE_PAYMENT, $payment, $payment->company);
} }