mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 09:34:30 -04:00
Resolve client correctly in webhooks
This commit is contained in:
parent
6b9b12d723
commit
b2baadc429
@ -120,7 +120,7 @@ class WebhookHandler implements ShouldQueue
|
||||
SystemLog::CATEGORY_WEBHOOK,
|
||||
SystemLog::EVENT_WEBHOOK_SUCCESS,
|
||||
SystemLog::TYPE_WEBHOOK_RESPONSE,
|
||||
$this->company->clients->first(),
|
||||
$this->resolveClient(),
|
||||
$this->company
|
||||
);
|
||||
|
||||
@ -137,7 +137,7 @@ class WebhookHandler implements ShouldQueue
|
||||
SystemLog::CATEGORY_WEBHOOK,
|
||||
SystemLog::EVENT_WEBHOOK_RESPONSE,
|
||||
SystemLog::TYPE_WEBHOOK_RESPONSE,
|
||||
$this->company->clients->first(),
|
||||
$this->resolveClient(),
|
||||
$this->company,
|
||||
);
|
||||
|
||||
@ -145,6 +145,15 @@ class WebhookHandler implements ShouldQueue
|
||||
|
||||
}
|
||||
|
||||
private function resolveClient()
|
||||
{
|
||||
if($this->entity->client()->exists()){
|
||||
return $this->entity->client;
|
||||
}
|
||||
|
||||
return $this->company->clients->first();
|
||||
}
|
||||
|
||||
public function failed($exception)
|
||||
{
|
||||
nlog(print_r($exception->getMessage(), 1));
|
||||
|
@ -135,6 +135,7 @@ class PaymentEmailEngine extends BaseEmailEngine
|
||||
{
|
||||
$data = [];
|
||||
|
||||
|
||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
||||
$data['$number'] = ['value' => $this->payment->number ?: ' ', 'label' => ctrans('texts.payment_number')];
|
||||
|
Loading…
x
Reference in New Issue
Block a user