intuit / oauth-jsclient

Intuit's NodeJS OAuth client provides a set of methods to make it easier to work with OAuth2.0 and Open ID
https://developer.intuit.com/
Apache License 2.0
120 stars 154 forks source link

PDF Transport #97

Closed haislip closed 3 years ago

haislip commented 3 years ago

This library currently does not seem to actually work when pulling the generated PDF files from an environment. It's relying on the default transport options from the popsicle libraries, which is text. This means that we get a text representation of the PDF instead of the actual buffer that we need in order to save the file once we've received it. If you save/view the PDF response without this, it just appears as a blank document.

I've hacked working solution together here that gets this to work by allowing the user to pass in the transport directly (and defaults back to text when it's not provided).

abisalehalliprasan commented 3 years ago

Thanks, @haislip for coming up with a quick fix. We are currently opening up our SDK's for contributions for the month of october : hacktoberfest.

As you have already provided the suggestion Could you create a PR, please?

haislip commented 3 years ago

Hacktastic: https://github.com/intuit/oauth-jsclient/pull/98

abisalehalliprasan commented 3 years ago

@haislip . Thanks for the contribution. Will review the PR's soon 🚀

ghost commented 3 years ago

@abisalehalliprasan Is there any possibility you can review and merge this?

/v3/company/${companyID}/invoice/${invoiceId}/pdf Download pdf API is really not working without this.

Many thanks!