28 lines
620 B
PHP
28 lines
620 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use SimpleSoftwareIO\QrCode\Facades\QrCode;
|
|
|
|
class GiroCodeProvider {
|
|
function __construct(private string $recipient, private string $iban, private float $amount, private string $paymentPurpose) {}
|
|
|
|
public function create() {
|
|
$data = "BCD\n".
|
|
"001\n".
|
|
"1\n".
|
|
"SCT\n".
|
|
"\n".
|
|
"$this->recipient\n".
|
|
"$this->iban\n".
|
|
"EUR$this->amount\n".
|
|
"\n".
|
|
"$this->paymentPurpose";
|
|
|
|
return
|
|
QrCode::format('png')->size(300)->generate($data)
|
|
|
|
;
|
|
}
|
|
}
|