Can't scan QR code with PostFinance App
gurtner-it opened this issue · 10 comments
Hi,
I can't scan a QR Code with my Postfinance App using this code:
SPC
0200
1
CH4431999123000889012
K
GURTNER IT SOLUTIONS
Weststrassse 19
3005 Bern
CH
239.00
CHF
S
Beat Gurtner
Grosse Marktgasse
28
9400
Rorschach
CH
QRR
000000000000000000000202218
EPD
Any ideas?
PS I'm using the code from the example.php:
// This is an example how to create a typical qr bill:
// - with reference number
// - with known debtor
// - with specified amount
// - with human-readable additional information
// - using your QR-IBAN
//
// Likely the most common use-case in the business world.
// Create a new instance of QrBill, containing default headers with fixed values
$qrBill = QrBill\QrBill::create();
// Add creditor information
// Who will receive the payment and to which bank account?
$qrBill->setCreditor(
QrBill\DataGroup\Element\CombinedAddress::create(
$Org->CompanyName,
$Org->Street,
$Org->zipCode.' '.$Org->city,
'CH'
));
$qrBill->setCreditorInformation(
QrBill\DataGroup\Element\CreditorInformation::create(
'CH4431999123000889012' // This is a special QR-IBAN. Classic IBANs will not be valid here.
));
// Add debtor information
// Who has to pay the invoice? This part is optional.
//
// Notice how you can use two different styles of addresses: CombinedAddress or StructuredAddress.
// They are interchangeable for creditor as well as debtor.
$res = $qrBill->setUltimateDebtor(
QrBill\DataGroup\Element\StructuredAddress::createWithStreet(
$patientName,
'Grosse Marktgasse',
'28',
'9400',
'Rorschach',
'CH'
));
// Add payment amount information
// What amount is to be paid?
$qrBill->setPaymentAmountInformation(
QrBill\DataGroup\Element\PaymentAmountInformation::create(
strtoupper($currency_code),
$bil_final_amount
));
// Add payment reference
// This is what you will need to identify incoming payments.
$referenceNumber = QrBill\Reference\QrPaymentReferenceGenerator::generate(
Null, // You receive this number from your bank (BESR-ID). Unless your bank is PostFinance, in that case use NULL.
$Money->genBillNo($data['sal_date'], $bill_id, "") // A number to match the payment with your internal data, e.g. an invoice number
);
$qrBill->setPaymentReference(
QrBill\DataGroup\Element\PaymentReference::create(
QrBill\DataGroup\Element\PaymentReference::TYPE_QR,
$referenceNumber
));
// Now get the QR code image and save it as a file.
try {
unlink($GLOBALS['rootUrl'] . 'files/qr.png');
$qrBill->getQrCode()->writeFile($GLOBALS['rootUrl'] . 'files/qr.png');
} catch (Exception $e) {
// foreach($qrBill->getViolations() as $violation) {
// print $violation->getMessage()."\n";
// }
// exit;
}
PPS: Also use the orignal lines from examlpe.php is not helping
Hello @gurtner-it – I can scan this and would be able execute the payment with my Raiffeisen app. I suggest you get in touch with PostFinance as it looks like this is an issue which is not related to this library.
Same problem here... Did you find something that could explain why the QR is getting rejected by the app ?
I suggest you get in touch with PostFinance as it looks like this is an issue which is not related to this library.
I had the same issue...
If your .pdf contain more than ONE QR . ( for example, a second for a html link ), the PosteFinance Apps can't choice the right one...
For exemple : rejected Postfinance Bill ( two QR code )
Have you other QR on your document ?