mvallim / emv-qrcode

Java Based EMV QR Code Generator and Parser (MPM, CPM)
https://mvallim.github.io/emv-qrcode/
Apache License 2.0
95 stars 46 forks source link

Adicionando construtores e métodos auxiliares para montagem de objetos #7

Closed volpatorafael closed 3 years ago

volpatorafael commented 3 years ago

Olá!

Inclui alguns construtores e métodos para tentar deixar a montagem dos objetos um pouco menos verbosa, por exemplo:

Ao invés de: MerchantAccountInformationTemplate merchantAccountInformationOutro = new MerchantAccountInformationTemplate(); merchantAccountInformationOutro.setTag("27"); merchantAccountInformationOutro.setValue(new MerchantAccountInformation()); merchantAccountInformationOutro.getValue().setGloballyUniqueIdentifier("BR.COM.OUTRO"); merchantAccountInformationOutro.getValue().addPaymentNetworkSpecific(new TagLengthString("01", "0123456789"));

Usar: MerchantAccountInformationTemplate merchantAccountInformationOutro = new MerchantAccountInformationTemplate("27", "BR.COM.OUTRO"); merchantAccountInformationOutro.addPaymentNetworkSpecific("01", "0123456789");

Outro exemplo, no lugar de: UnreservedTemplate unreservedTemplateOutro = new UnreservedTemplate(); unreservedTemplateOutro.setTag("81"); unreservedTemplateOutro.setValue(new Unreserved()); unreservedTemplateOutro.getValue().setGloballyUniqueIdentifier("BR.COM.OUTRO"); unreservedTemplateOutro.getValue().addContextSpecificData(new TagLengthString("01", "0123.ABCD.3456.WXYZ"));

Usar: UnreservedTemplate unreservedTemplateOutro = new UnreservedTemplate("81", "BR.COM.OUTRO"); unreservedTemplateOutro.addContextSpecificData("01", "0123.ABCD.3456.WXYZ");

Fiz essas mudanças para

mvallim commented 3 years ago

Thank you very much for your contribution @volpatorafael

mvallim commented 3 years ago

Released on 0.0.6

https://github.com/mvallim/emv-qrcode/releases/tag/emv-qrcode-0.0.6