mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 00:44:31 -04:00
Fixes for signing certificates
This commit is contained in:
parent
ce8fc061ed
commit
3e07acb5bb
@ -904,4 +904,18 @@ class Company extends BaseModel
|
|||||||
return $item->id == $this->getSetting('date_format_id');
|
return $item->id == $this->getSetting('date_format_id');
|
||||||
})->first()->format;
|
})->first()->format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getInvoiceCert()
|
||||||
|
{
|
||||||
|
if($this->e_invoice_certificate)
|
||||||
|
return base64_decode($this->e_invoice_certificate);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSslPassPhrase()
|
||||||
|
{
|
||||||
|
return $this->e_invoice_certificate_passphrase;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -174,9 +174,9 @@ class FacturaEInvoice extends AbstractService
|
|||||||
|
|
||||||
$disk = config('filesystems.default');
|
$disk = config('filesystems.default');
|
||||||
|
|
||||||
if (!Storage::disk($disk)->exists($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()))) {
|
// if (!Storage::disk($disk)->exists($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()))) {
|
||||||
Storage::makeDirectory($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()));
|
// Storage::makeDirectory($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()));
|
||||||
}
|
// }
|
||||||
|
|
||||||
$this->fac->export(Storage::disk($disk)->path($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()) . $this->invoice->getFileName("xsig")));
|
$this->fac->export(Storage::disk($disk)->path($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()) . $this->invoice->getFileName("xsig")));
|
||||||
|
|
||||||
@ -386,9 +386,12 @@ class FacturaEInvoice extends AbstractService
|
|||||||
|
|
||||||
private function signDocument(): self
|
private function signDocument(): self
|
||||||
{
|
{
|
||||||
// $ssl_cert = file_get_contents(base_path('e_invoice_cert.p12'));
|
|
||||||
|
|
||||||
// $this->fac->sign($ssl_cert, null, "SuperSecretPassword");
|
$ssl_cert = $this->invoice->company->getInvoiceCert();
|
||||||
|
$ssl_passphrase = $this->invoice->company->getSslPassPhrase();
|
||||||
|
|
||||||
|
if($ssl_cert)
|
||||||
|
$this->fac->sign($ssl_cert, null, $ssl_passphrase);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user