Update for Swiss QR

This commit is contained in:
David Bomba 2023-11-01 12:14:58 +11:00
parent b7b55a7a91
commit 04b053fc29
4 changed files with 211 additions and 541 deletions

View File

@ -166,7 +166,7 @@ class SwissQrGenerator
// Now get the QR code image and save it as a file.
try {
$output = new QrBill\PaymentPart\Output\HtmlOutput\HtmlOutput($qrBill, $this->client->locale() ?: 'en');
$output = new QrBill\PaymentPart\Output\HtmlOutput\HtmlOutput($qrBill, $this->resolveLanguage());
$html = $output
->setPrintable(false)
@ -190,4 +190,28 @@ class SwissQrGenerator
// return $e->getMessage();
}
}
private function resolveLanguage(): string
{
$language = $this->client->locale() ?: 'en';
switch ($language) {
case 'de':
return 'de';
case 'en':
case 'en_GB':
return 'en';
case 'it':
return 'it';
case 'fr':
case 'fr_CA':
case 'fr_CH':
return 'fr';
default:
return 'en';
}
}
}

View File

@ -44,6 +44,8 @@ class PreviewReport implements ShouldQueue
else
$report = $export->run();
// nlog($report);
Cache::put($this->hash, $report, 60 * 60);
}

View File

@ -87,7 +87,7 @@
"socialiteproviders/apple": "^5.2",
"socialiteproviders/microsoft": "^4.1",
"spatie/laravel-data": "^3.5",
"sprain/swiss-qr-bill": "^3.2",
"sprain/swiss-qr-bill": "^4.3",
"square/square": "30.0.0.*",
"stripe/stripe-php": "^12",
"symfony/http-client": "^6.0",

722
composer.lock generated

File diff suppressed because it is too large Load Diff