lineofflight / peddler

Amazon Selling Partner API (SP-API) in Ruby
MIT License
307 stars 130 forks source link

Retrieving pdf document data #91

Closed faralbrt closed 7 years ago

faralbrt commented 7 years ago

Hello @hakanensari , I know this is unrelated to the gem, but I have been stuck on this for hours. Any insight is extremely appreciated.

I am using the get_bill_of_lading operation which returns PdfDocumentData (an encoded string which must be decoded, and unzipped)

Link to instructions from Amazon Docs

I can decode the string and write it to a zip file, but i cannot unzip it. I'm using the rubyzip library, and it does not pick up on any entries in the zipfile to iterate over.

However when I unzip it in the terminal, I get my unzipped file perfectly.

How can I successfully unzip it using ruby?

faralbrt commented 7 years ago

Figured it out. The zip file I was writing was corrupt. A fresh hit to the api solved it