feat: wb secret
This commit is contained in:
@@ -21,3 +21,5 @@ YANDEX_CLIENT_ID = os.environ.get('YANDEX_CLIENT_ID')
|
||||
|
||||
# Security
|
||||
API_KEY = os.environ.get('API_KEY')
|
||||
|
||||
WB_SECRET_TOKEN = os.environ.get('WB_SECRET_TOKEN')
|
||||
@@ -5,6 +5,7 @@ from typing import Union
|
||||
import jwt
|
||||
from aiohttp import ClientSession, ClientResponse
|
||||
|
||||
from backend import config
|
||||
from database import Marketplace
|
||||
from marketplaces.base import BaseMarketplaceApi
|
||||
|
||||
@@ -27,7 +28,8 @@ class WildberriesMarketplaceApi(BaseMarketplaceApi):
|
||||
self.headers = {
|
||||
'Authorization': token,
|
||||
'Content-Type': 'application/json',
|
||||
'User-Agent': 'wbas_seller.denco.store3547'
|
||||
'User-Agent': 'wbas_seller.denco.store3547',
|
||||
'X-Client-Secret': config.WB_SECRET_TOKEN
|
||||
}
|
||||
|
||||
def get_headers(self):
|
||||
@@ -38,6 +40,6 @@ class WildberriesMarketplaceApi(BaseMarketplaceApi):
|
||||
return 'https://marketplace-api.wildberries.ru'
|
||||
|
||||
async def update_stocks(self, data: Union[list, dict])-> (ClientSession, ClientResponse):
|
||||
warehouse_id = self.marketplace.warehouse_id
|
||||
warehouse_id = self.marketplace.warehouse_id.strip()
|
||||
return await self._method('PUT', f'/api/v3/stocks/{warehouse_id}', data={'stocks': data})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user