Skip to content

Commit 4153574

Browse files
Merge pull request #66 from LinkNacional/dev
3.3.2 Notification fixes
2 parents 8fce06b + 61308ce commit 4153574

File tree

9 files changed

+67
-29
lines changed

9 files changed

+67
-29
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 3.3.2 - 06/11/2024
2+
* Fixed invoice notifications with non existing parameter for asaas url.
3+
14
# 3.3.1 - 09/08/2024
25
* Fixed unsuspended order notification;
36
* Fixed ticket open notification;

src/modules/addons/lknhooknotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "linknacional/hooknotification",
3-
"version": "3.3.1",
3+
"version": "3.3.2",
44
"license": "proprietary",
55
"autoload": {
66
"psr-4": {

src/modules/addons/lknhooknotification/src/Notifications/WhatsApp/Invoice15DaysLate/Invoice15DaysLateNotification.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ private function getAsaasPayUrl()
102102

103103
public function defineParameters(): void
104104
{
105+
$asaasTable = Capsule::schema()->hasTable('mod_cobrancaasaasmpay');
106+
107+
if ($asaasTable) {
108+
$this->parameters = ['invoice_pdf_url_asaas_pay' => [
109+
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
110+
'parser' => fn () => $this->getAsaasPayUrl()
111+
]];
112+
}
113+
105114
$this->parameters = [
106115
'invoice_id' => [
107116
'label' => $this->lang['invoice_id'],
@@ -135,10 +144,6 @@ public function defineParameters(): void
135144
'label' => $this->lang['invoice_pdf_url'],
136145
'parser' => fn () => self::getInvoicePdfUrlByInvocieId($this->hookParams['invoice_id'])
137146
],
138-
'invoice_pdf_url_asaas_pay' => [
139-
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
140-
'parser' => fn () => $this->getAsaasPayUrl()
141-
],
142147
'client_first_name' => [
143148
'label' => $this->lang['client_first_name'],
144149
'parser' => fn () => $this->getClientFirstNameByClientId($this->clientId),

src/modules/addons/lknhooknotification/src/Notifications/WhatsApp/Invoice6DaysLate/Invoice6DaysLateNotification.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ private function getAsaasPayUrl()
102102

103103
public function defineParameters(): void
104104
{
105+
$asaasTable = Capsule::schema()->hasTable('mod_cobrancaasaasmpay');
106+
107+
if ($asaasTable) {
108+
$this->parameters = ['invoice_pdf_url_asaas_pay' => [
109+
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
110+
'parser' => fn () => $this->getAsaasPayUrl()
111+
]];
112+
}
113+
105114
$this->parameters = [
106115
'invoice_id' => [
107116
'label' => $this->lang['invoice_id'],
@@ -131,10 +140,6 @@ public function defineParameters(): void
131140
'label' => $this->lang['invoice_pdf_url'],
132141
'parser' => fn () => self::getInvoicePdfUrlByInvocieId($this->hookParams['invoice_id'])
133142
],
134-
'invoice_pdf_url_asaas_pay' => [
135-
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
136-
'parser' => fn () => $this->getAsaasPayUrl()
137-
],
138143
'client_first_name' => [
139144
'label' => $this->lang['client_first_name'],
140145
'parser' => fn () => $this->getClientFirstNameByClientId($this->clientId),

src/modules/addons/lknhooknotification/src/Notifications/WhatsApp/InvoiceCancelled/InvoiceCancelledNotification.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ private function getAsaasPayUrl()
100100

101101
public function defineParameters(): void
102102
{
103+
$asaasTable = Capsule::schema()->hasTable('mod_cobrancaasaasmpay');
104+
105+
if ($asaasTable) {
106+
$this->parameters = ['invoice_pdf_url_asaas_pay' => [
107+
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
108+
'parser' => fn () => $this->getAsaasPayUrl()
109+
]];
110+
}
111+
103112
$this->parameters = [
104113
'invoice_id' => [
105114
'label' => $this->lang['invoice_id'],
@@ -117,10 +126,6 @@ public function defineParameters(): void
117126
'label' => $this->lang['invoice_pdf_url'],
118127
'parser' => fn (): string => self::getInvoicePdfUrlByInvocieId($this->hookParams['invoiceid'])
119128
],
120-
'invoice_pdf_url_asaas_pay' => [
121-
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
122-
'parser' => fn () => $this->getAsaasPayUrl()
123-
],
124129
'invoice_balance' => [
125130
'label' => $this->lang['invoice_balance'],
126131
'parser' => fn (): string => self::getInvoiceBalance($this->hookParams['invoiceid'])

src/modules/addons/lknhooknotification/src/Notifications/WhatsApp/InvoicePaid/InvoicePaidNotification.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ private function getAsaasPayUrl()
6565

6666
public function defineParameters(): void
6767
{
68+
$asaasTable = Capsule::schema()->hasTable('mod_cobrancaasaasmpay');
69+
70+
if ($asaasTable) {
71+
$this->parameters = ['invoice_pdf_url_asaas_pay' => [
72+
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
73+
'parser' => fn () => $this->getAsaasPayUrl()
74+
]];
75+
}
76+
6877
$this->parameters = [
6978
'invoice_id' => [
7079
'label' => $this->lang['invoice_id'],
@@ -82,10 +91,6 @@ public function defineParameters(): void
8291
'label' => $this->lang['invoice_pdf_url'],
8392
'parser' => fn (): string => self::getInvoicePdfUrlByInvocieId($this->hookParams['invoiceid'])
8493
],
85-
'invoice_pdf_url_asaas_pay' => [
86-
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
87-
'parser' => fn () => $this->getAsaasPayUrl()
88-
],
8994
'invoice_balance' => [
9095
'label' => $this->lang['invoice_balance'],
9196
'parser' => fn (): string => self::getInvoiceBalance($this->hookParams['invoiceid'])

src/modules/addons/lknhooknotification/src/Notifications/WhatsApp/InvoiceReminder/InvoiceReminderNotification.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ private function getAsaasPayUrl()
5353

5454
public function defineParameters(): void
5555
{
56+
$asaasTable = Capsule::schema()->hasTable('mod_cobrancaasaasmpay');
57+
58+
if ($asaasTable) {
59+
$this->parameters = ['invoice_pdf_url_asaas_pay' => [
60+
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
61+
'parser' => fn () => $this->getAsaasPayUrl()
62+
]];
63+
}
64+
5665
$this->parameters = [
5766
'invoice_id' => [
5867
'label' => $this->lang['invoice_id'],
@@ -82,10 +91,6 @@ public function defineParameters(): void
8291
'label' => $this->lang['invoice_pdf_url'],
8392
'parser' => fn () => self::getInvoicePdfUrlByInvocieId($this->hookParams['invoiceId'])
8493
],
85-
'invoice_pdf_url_asaas_pay' => [
86-
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
87-
'parser' => fn () => $this->getAsaasPayUrl()
88-
],
8994
'client_id' => [
9095
'label' => $this->lang['client_id'],
9196
'parser' => fn () => $this->clientId

src/modules/addons/lknhooknotification/src/Notifications/WhatsApp/InvoiceReminderPdf/InvoiceReminderPdfNotification.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ private function getAsaasPayUrl()
5252

5353
public function defineParameters(): void
5454
{
55+
$asaasTable = Capsule::schema()->hasTable('mod_cobrancaasaasmpay');
56+
57+
if ($asaasTable) {
58+
$this->parameters = ['invoice_pdf_url_asaas_pay' => [
59+
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
60+
'parser' => fn () => $this->getAsaasPayUrl()
61+
]];
62+
}
63+
5564
$this->parameters = [
5665
'invoice_id' => [
5766
'label' => $this->lang['invoice_id'],
@@ -69,10 +78,6 @@ public function defineParameters(): void
6978
'label' => $this->lang['invoice_pdf_url'],
7079
'parser' => fn () => self::getInvoicePdfUrlByInvocieId($this->hookParams['invoiceId'])
7180
],
72-
'invoice_pdf_url_asaas_pay' => [
73-
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
74-
'parser' => fn () => $this->getAsaasPayUrl()
75-
],
7681
'invoice_balance' => [
7782
'label' => $this->lang['invoice_balance'],
7883
'parser' => fn (): string => self::getInvoiceBalance($this->hookParams['invoiceId'])

src/modules/addons/lknhooknotification/src/Notifications/WhatsApp/NewServiceInvoice/NewServiceInvoiceNotification.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ private function getAsaasPayUrl()
107107

108108
public function defineParameters(): void
109109
{
110+
$asaasTable = Capsule::schema()->hasTable('mod_cobrancaasaasmpay');
111+
112+
if ($asaasTable) {
113+
$this->parameters = ['invoice_pdf_url_asaas_pay' => [
114+
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
115+
'parser' => fn () => $this->getAsaasPayUrl()
116+
]];
117+
}
118+
110119
$this->parameters = [
111120
'invoice_id' => [
112121
'label' => $this->lang['invoice_id'],
@@ -124,10 +133,6 @@ public function defineParameters(): void
124133
'label' => $this->lang['invoice_pdf_url'],
125134
'parser' => fn (): string => self::getInvoicePdfUrlByInvocieId($this->hookParams['invoiceid'])
126135
],
127-
'invoice_pdf_url_asaas_pay' => [
128-
'label' => $this->lang['invoice_pdf_url_asaas_pay'],
129-
'parser' => fn () => $this->getAsaasPayUrl()
130-
],
131136
'invoice_balance' => [
132137
'label' => $this->lang['invoice_balance'],
133138
'parser' => fn (): string => self::getInvoiceBalance($this->hookParams['invoiceid'])

0 commit comments

Comments
 (0)