Created
March 2, 2020 22:39
-
-
Save make-github-pseudonymous-again/d9bb05e3addedeea1e6b32b30061b0c5 to your computer and use it in GitHub Desktop.
Generate SEPA payment QR Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const generateQrCode = require('sepa-payment-qr-code'); | |
const QRCode = require('qrcode'); | |
const payload = generateQrCode({ | |
name: 'John Doe', | |
iban: 'BE71096123456769 ', | |
amount: 999999, | |
}); | |
process.stdout.write(payload); | |
process.stdout.write('\n'); | |
const options = { | |
errorCorrectionLevel: 'H', | |
type: 'terminal', | |
}; | |
QRCode.toDataURL(payload, options, function (err, url) { | |
console.log(url); | |
}); | |
QRCode.toString(payload, options, function (err, string) { | |
console.log(string); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment