Closed aron123 closed 1 year ago
I also simplified getResult a little bit.
Line cb(null, result, httpResponse)
was redundant and was called at the end of every branches. Line 207 is not necessary anymore as pdf field is set in (it is used by reverseInvoice
method.issueInvoice
too so I put it back)
@aron123 Thanks for your contribution, and sorry for my fabulously late reply! Would you please rework your PR? The codebase has been ported to async/await and ECMAScript modules in the meantime.
Yes, I will rework it.
I've tested it, and found that you are already fixed this issue with the new major version. Only documentation changes are missed out, I did it here: #29
PDF content generated with
reverseInvoice
method was handled as a UTF8 string, so it can not be converted to the original binary format, and it cannot be saved directly to the filesystem as a valid PDF file.I changed code to handle the response as binary content, so
reverseInvoice
returns PDF as a Buffer from now. This format is also consistent with the output ofissueInvoice
.Incrementing major version number and extending changelog is necessary before merging this PR. Please let me know if you are ready to approve these changes, and I can do these steps too.
It closes #23