This commit is contained in:
parent
18ceef8351
commit
478ce4ec41
@ -29,4 +29,4 @@ jobs:
|
||||
|
||||
- name: Run Docker container
|
||||
run: |
|
||||
docker run -d -p 8000:8000 --name giga_tcg_container giga_tcg
|
||||
docker run -d -v /mnt/user/appdata/gigatcg/giga_tcg/cookies:/app/app/cookies -v /mnt/user/appdata/gigatcg/tmp:/app/app/tmp -p 8000:8000 --name giga_tcg_container giga_tcg
|
@ -221,6 +221,22 @@ class TCGPlayerAPIService:
|
||||
pricing_data = self.get_tcgplayer_pricing_data_for_product(card.product_id)
|
||||
if pricing_data:
|
||||
self.save_tcgplayer_pricing_data(card.product_id, pricing_data)
|
||||
|
||||
def get_packing_slip_pdf_for_orders(self, order_ids: list[str]):
|
||||
url = f"{self.config.ORDER_BASE_URL}/packing-slips/export{self.config.API_VERSION}"
|
||||
payload = {
|
||||
"sortingType": "byRelease",
|
||||
"format": "default",
|
||||
"timezoneOffset": -4,
|
||||
"orderNumbers": [order_ids]
|
||||
}
|
||||
response = self.requests_util.send_request(url, method='POST', cookies=self.cookies, json=payload)
|
||||
if response:
|
||||
# get filename from response headers
|
||||
filename = response.headers.get('Content-Disposition').split('filename=')[1].strip('"')
|
||||
# save file to disk
|
||||
with open(filename, 'wb') as f:
|
||||
f.write(response.content)
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user