Git Product home page Git Product logo

Comments (5)

schoero avatar schoero commented on July 30, 2024

SwissQRBill uses the npm module iban to verify the provided IBAN.

Unlike the web page you have mentioned, the module verifies not only if the checksum is valid, but also whether the structure of the IBAN matches country specific specifications. Based on the source code of the iban module, letters in the account number should be supported. Therefore I think the error is more likely to be found in these structure checks.
Since only IBAN numbers from Switzerland and Lichtenstein are allowed, and both have the same structure, this additional checks could be simplified.

I have made a branch, which removes the iban dependency and implements the simplified IBAN checks directly into the library. You can install it using
npm i https://github.com/schoero/SwissQRBill.git#Fix-#215-iban-validation

Please let me know if your IBAN passes the simplified checks.

from swissqrbill.

TheNetStriker avatar TheNetStriker commented on July 30, 2024

I've just tested this, but I'm still getting an error:

/usr/local/bin/node ./RechnungMedlist.js
(node:89421) UnhandledPromiseRejectionWarning: Error: Creditor Reference requires the use of a conventional IBAN.
    at PDF._validateData (.../node_modules/swissqrbill/lib/swissqrbill.js:416:27)
    at new PDF (.../node_modules/swissqrbill/lib/swissqrbill.js:47:14)
    at new PDF (.../node_modules/swissqrbill/lib/node.js:42:13)
    at .../my.js:270:21
    at new Promise (<anonymous>)
    at generateQrInovice (.../my.js:269:12)
    at /my.js:317:17

from swissqrbill.

schoero avatar schoero commented on July 30, 2024

Thank you for testing.
I just realized that I messed up the error messages there. The correct error message would be QR-Reference requires the use of a QR-IBAN (and vice versa).

I'm guessing you are trying to use a 27-digit QR-Reference in conjunction with your normal IBAN?

This is not allowed according the specifications (page 32, "Customer references"). If you want to continue using a 27-digit reference number (as in the orange ISR), you must request a QR-IBAN from your bank.

from swissqrbill.

TheNetStriker avatar TheNetStriker commented on July 30, 2024

Thanks for the hint. I did not know that. I will check this with my bank.

from swissqrbill.

schoero avatar schoero commented on July 30, 2024

I'm going to close this issue for now.
I have released v2.3.1 on npm including the changes regarding the iban checks and the wrong error messages.

If you need any further assistance, feel free to comment or create a new issue.

from swissqrbill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.