Closed wurschmedia closed 4 years ago
Found the answer myself :-)
// Add payment reference // Explicitly define that no reference number will be used by setting TYPE_NON. $qrBill->setPaymentReference( QrBill\DataGroup\Element\PaymentReference::create( QrBill\DataGroup\Element\PaymentReference::TYPE_NON ));
Normal IBANs can be used when using references of type SCOR or NON.
See these examples: https://github.com/sprain/php-swiss-qr-bill/blob/master/example/example_minimal.php https://github.com/sprain/php-swiss-qr-bill/blob/master/example/example_scor.php
Hi, thankyou for your work, I've only a question ... wat I need to change for use the example_scor.php ? my qr is generated only with the BESR number, in my case I've only a normal IBAN and no reference... Thankyou
@garga11 you probably want to use example_minimal.php, with the PaymentReference::TYPE_NON
.
thankyou Dominik, exactly, my questione is how can I use example_minimal.php ? I 've to copy the code in another file? thankyou
It's required, that your project has a proper Composer setup. You can check out the docs here: Introduction - Composer
Once done completely, you can composer require sprain/swiss-qr-bill
, copy the example_minimal.php to your project and adjust to your needs.
Thnakyou Dominik, I don't have composer, but I've solved only modifing this file app/Helpers/SwissQrGenerator.php at line 78 inserting this:
$qrBill->setCreditorInformation(
QrBill\DataGroup\Element\CreditorInformation::create(
'CHXXXXXXXXXXXXX' // This is a classic iban. QR-IBANs will not be valid in this minmal setup.
)
);
Is there a way to skip the reference number and use a normal IBAN (replacement for the red invoice slip) ? Right now it throws an error if I just delete the $qrBill->setPaymentReference() section