mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 17:14:31 -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::CATEGORY_WEBHOOK,
|
||||||
SystemLog::EVENT_WEBHOOK_SUCCESS,
|
SystemLog::EVENT_WEBHOOK_SUCCESS,
|
||||||
SystemLog::TYPE_WEBHOOK_RESPONSE,
|
SystemLog::TYPE_WEBHOOK_RESPONSE,
|
||||||
$this->company->clients->first(),
|
$this->resolveClient(),
|
||||||
$this->company
|
$this->company
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ class WebhookHandler implements ShouldQueue
|
|||||||
SystemLog::CATEGORY_WEBHOOK,
|
SystemLog::CATEGORY_WEBHOOK,
|
||||||
SystemLog::EVENT_WEBHOOK_RESPONSE,
|
SystemLog::EVENT_WEBHOOK_RESPONSE,
|
||||||
SystemLog::TYPE_WEBHOOK_RESPONSE,
|
SystemLog::TYPE_WEBHOOK_RESPONSE,
|
||||||
$this->company->clients->first(),
|
$this->resolveClient(),
|
||||||
$this->company,
|
$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)
|
public function failed($exception)
|
||||||
{
|
{
|
||||||
nlog(print_r($exception->getMessage(), 1));
|
nlog(print_r($exception->getMessage(), 1));
|
||||||
|
@ -135,6 +135,7 @@ class PaymentEmailEngine extends BaseEmailEngine
|
|||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
|
|
||||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||||
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
||||||
$data['$number'] = ['value' => $this->payment->number ?: ' ', 'label' => ctrans('texts.payment_number')];
|
$data['$number'] = ['value' => $this->payment->number ?: ' ', 'label' => ctrans('texts.payment_number')];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user