UPN QR code SLO

Hi team,

Here is a UPN QR code solution that has been verified to work on mobile banks in Slovenia.

  1. Dowload zip GitHub - DataLinx/php-upn-qr-generator: QR code generator for Slovenian UPN payment order
  2. Upload and extract to your app folder
  3. Edit Application/Views/Invoice_Templates/Pdf/your_file.php
  4. Add on top, before
<?php
// Vključite knjižnico php-upn-qr-generator
require_once('php-upn-qr-generator/src/UPNQR.php');

use DataLinx\PhpUpnQrGenerator\UPNQR;

// Ustvarite instanco razreda UPNQR
$QR = new UPNQR();

// Nastavite podatke za plačilo
$payerName = htmlsc(format_client($invoice));
$payerStreetAddress = htmlsc($invoice->client_address_1);
$payerCity = htmlsc($invoice->client_city);
$amount = htmlsc($invoice->invoice_balance);
$number = htmlsc($invoice->invoice_number);

// Nastavite podatke za plačilo
$QR->setPayerName($payerName)
   ->setPayerStreetAddress($payerStreerAddress)
   ->setPayerCity($payerCity)
   ->setRecipientIban('SI56000000000000000')
   ->setRecipientName('Your Name')
   ->setRecipientStreetAddress('Your Address)
   ->setRecipientCity('Post number and City')
   ->setAmount($amount)
   ->setRecipientReference('SI00' . $number)
   ->setPurposeCode('GDSV')
   ->setPaymentPurpose('Plačilo računa št.' . $number);

// Pot do shranjene QR kode
$qrFile = 'uploads/qrcode/upn_qrcode.png'; ** <-- You must create subdir in /uploads**

try {
    // Generirajte QR kodo in jo shranite kot PNG sliko
    $QR->generateQrCode($qrFile);
} catch (Exception $e) {
    throw new Exception("Napaka pri generiranju QR kode: " . $e->getMessage());
}
?>
  1. Place anywhare you want to show QR code, and edit css as you want:
    Code: <div><img src="../uploads/qrcode/upn_qrcode.png" alt="qrcode" style="float: left" width="120" height="120"> </div>
2 Likes

Hvala za tole! Če bi že včeraj AI tole našel, se ne bi X dni zafrkaval z lastno rešitvijo. Sprobam danes, woohoo.

Ma ni panike. Če bi si želel, ti lahko brezplačno ponudim uporabo mojega novega sistem za poslovanje, ki ima vse funkcionalnosti že vklopljene. Kratko predstavitev si preveri na https://s5apps.si in če ti je kul, sporoči na mail info@s5apps.si in urediva dostop. Lp

1 Like

This topic is temporarily closed for at least 4 hours due to a large number of community flags.