Knihovna je pod opensource licencí Apache, takže jsem na jejím základě vyrobil knihovnu Geek SPAYD, která je orientovaná na vývojářův prožitek. Zdrojáky jsou na GitHubu a binárky v centrálním Mavenu.
This file contains 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
BankAccount acc = new CzechBankAccount("2000009442/2010"); | |
CzechSpaydPayment payment = new CzechSpaydPayment(acc); | |
payment.setAmount(100); | |
payment.setDate(new Date()); | |
payment.setVs("123"); | |
final SpaydQRFactory factory = new SpaydQRFactory(); | |
factory.saveQRCode(payment, "png", new File("payment.png")); |
This file contains 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
SpaydPaymentAttributes attrs = new SpaydPaymentAttributes(); | |
CzechBankAccount acc = new CzechBankAccount("0", "2000009442", "2010") | |
attrs.setBankAccount(acc); | |
attrs.setAmount(100); | |
attrs.setCurrency("CZK"); | |
attrs.setDate(new Date()); | |
SpaydExtendedPaymentAttributeMap params | |
= new SpaydExtendedPaymentAttributeMap(singletonMap("X-VS", "123")); | |
String spayd = SpaydPayment.paymentStringFromAccount(attrs, params, true); | |
BufferedImage qrCode = SpaydQRUtils.getQRCode(200, spayd, true); | |
ImageIO.write(qrCode, "png", new File("payment.png")); |