DannielWhatever / emvqr

help to work with emv qr code specification for digital payments
10 stars 11 forks source link

Code Halts Indefinitely for Invalid QR #4

Closed mfaisaltariq closed 3 years ago

mfaisaltariq commented 3 years ago

Expected Behaviour

Error should be thrown that the QR code decoding failed or the QR String is Invalid.

Current Behaviour

No result is returned and execution is halted

Code Example

const emvqr = require('emvqr');
const qrString = '000201010212041554652400000000428180014A0000000 0410105204507253035865802PK5912ABC HARDWARE6009ISLAMABAD622802129230797708870708000020776304a7bb540210';
const decodedQRJSON = emvqr.decode(qrString);
console.log('decodedQRJSON', decodedQRJSON);
DannielWhatever commented 3 years ago

Hi, first of all, thanks for your feedback and sorry for my delay, i have not be able to be active in Github these months.

I tested your scenario with a new version and its working as expected, I added your example like an unit test to prevent future mistakes. The actual version is emvqr@1.0.0-alpha.0 , but i will publish a non-alpha version soon.

Have a great weekend n_n